Skip to content

PyRAT data layers

Anderl edited this page Feb 12, 2019 · 1 revision

PyRAT works with so-called data layers, which are the basics of all processing tasks. You can imagine them as SAR images or similar. A processing module usually has one or several layers as input, and one or several layers as output.

  • Each layer has a unique name (string, e.g. "/L7") which cannot be modified and is set by PyRAT
  • Each layer contains data and metadata. It usually resists somewhere in a temporary file.
  • New layers are generated by loading data sets, or as output of some processing steps. Processing modules return the name of the newly generated layer (not the layer object itself!)
  • Processing tasks are usually applied to the so-called "active" layer(s).
  • The result of the last processing task is automatically activated and its input is deactivated.

Some examples for manipulating layers:

>>> listlayer()			print all existing layers (aktive = *)
>>> activate(layer)		Activate layer(s)
>>> delete(layer)		Delete layer(s)
>>> var = getdata()		Extract layer content into a numpy ndarray
>>> addlayer(var)		Write numpy ndarray into new layer
>>> var = getmeta()		Extract meta information
>>> setmeta(meta)		Set meta information

Programming trick: If a nested list is used for layer specification, either as the active ones, or via keyword), the data will be provided in your module exactly in this structure (i.e. as nested list of numpy.ndarrays). This might be useful when implementing complex processing chains.

Clone this wiki locally