Skip to end of metadata
Go to start of metadata

Note: This is a working document - contributions are welcome.

Extending BEAM with scripting capabilities gives the user a powerful tool to automate repeatedly tasks e.g. to concatenate processing operations, to do specific map projections on several data products, converting raster data using band arithmetic, etc. Scripting languages are easy to learn and no compilation is required. Suitable scripting languages are Phyton, JavaScript or Groovy.

Use Cases

  • Small algorithm running over all pixel in an image (of a given product) and performing a calculation. The result is a new band in the product.
  • Loading the values of a band into an array ( in the same way do this in IDL or matlab) 
  • Reading and manipulating the meta data of a product
  • Reading and manipulating the properties of a band (e.g. no data value, wavelength etc)
  • Automation of working with pins: loading pins and exporting the pin values to a file
  • Automation of working with transects: loading a transect and exporting pixel values to a file
  • Exporting average perpendicular to a transect
  • Using the capabilities of the arithmetic expression editor in a script: sending an expression etc to a method and getting the result band open in my current product
  • Using the ROI in a script: loading the ROI defintion and extracting the statistics, sending this to a file; running this over all bands of a product
  • Loading a predefined set of bitmasks (expression, colour, transpareny etc)
  • Displaying a customized bitmasks overlay (different ordering of bitmasks, colours etc)
  • Add a product to VISAT.
  • React to events in VISAT. A product has been opened or closed, an image view has been opened or closed, the user clicked into an image, etc.
  • Extend VISAT user interface by new actions and tool windows.
  • Directly access operators of the graph processing framework (GPF), concatenate operators.
  • Use a script to configure VISAT.
  • Debug at runtime.
  • Prototyping and exploratory programming.

Feature List

  • Access products opened in VISAT
  • Open products from file
  • Access bands, meta data, tie-point grids of products open in VISAT and opened from external file
  • Create new products
    • define dimensions (width and height) manually (how to define the geocoding then?)
    • copy dimensions and geocoding from available product
  • Create subsets
    Select a subset from an existing product according to lat and lon; create a new product according to this subset
  • Access a pixel matching a given geo-location X,Y = function(lat,lon)
  • Read a vector of pixel values for a given pixel coordinate X,Y, where the bands can be specified
  • Read a spectrum
  • Create new bands
  • Create new flag bands
  • Loop over pixel
  • Logical branch (if - then - else)
  • Use commonly used math functions
  • Use band values and flag values in math expressions
    In math expressions, access to all bands/tie-point grids/meta data of compatible products shall be possible
    access to other pixels in math expression: if X,Y are the pixel coordinates of the pixel to be calculated, the expression permits to access pixel X+i, Y+j.
  • Work with variables: scalars, multi-dimensional arrays, structures
  • Define and use constants
  • Open external files (read mode, write mode)
  • Read formatted and binary data from external files into variables
  • Nice to have: use operators from GPF (e.g. SMAC, smile correction etc); needs further thinking
  • Write debugging information on a console
  • Write to an external file
  • Save and restore scripts
  • Define and use subroutines
  • Access to pins, ROIs, transects but with all information incl. aux data
  • Access to solar flux data
  • Import ascii files from outside, e.g. with coordinates
  • Acess to functions in beam
    Examples: like calculations from geogr. Coordinates to pixel coordinates

Integration Features

  • VISAT should provide a scriping console comprising a simple script editor, script output panel.
  • The a script editor should support basic syntax highlighting.
  • The console should also at least provide the actions
    • run: to run the script
    • stop: to stop a running script
    • open file: to read a script from file
    • save file: to write script to file
  • Ideally, the user can choose from the list of available scripting languages. At least one scripting language shall be offered by default. Java SE 6 has an in-build support for JavaScript.
  • Debugger?
  • Undo?

Sample Scripts

JavaScript sample script:

Python sample script:

Java Scripting Programmer's Guide
Java Scripting Project
Scripting Languages For Java

Labels
  • None