Examine¶
- class pyroSAR.examine.ExamineGamma[source]¶
Bases:
object
Class to check if GAMMA is installed.
Examples
>>> from pyroSAR.examine import ExamineGamma >>> config = ExamineGamma() >>> print(config.home) >>> print(config.version)
- class pyroSAR.examine.ExamineSnap[source]¶
Bases:
object
Class to check if ESA SNAP is installed. Upon initialization, this class searches for relevant binaries and the accompanying relative directory structure, which uniquely identify an ESA SNAP installation on a system. First, all relevant file and folder names are read from the pyroSAR config file if it exists and their existence is verified. If this fails, a system check is performed to find relevant binaries in the system PATH variable and additional files and folders relative to them. In case SNAP is not installed, a default snap.auxdata.properties file delivered with pyroSAR will be copied to $HOME/.snap/etc so that SNAP download URLS and local directory structure can be adapted by other software.
SNAP configuration can be read and modified via the attribute snap_properties of type
SnapProperties
or the propertiesuserpath
andauxdatapath
.- property auxdatapath¶
Get/set the SNAP configuration for AuxDataPath in snap.auxdata.properties.
Example
>>> from pyroSAR.examine import ExamineSnap >>> config = ExamineSnap() >>> config.auxdatapath = '/path/to/snap/auxdata' # This is equivalent to >>> config.snap_properties['AuxDataPath'] = '/path/to/snap/auxdata'
- get_suffix(operator)[source]¶
get the file name suffix for an operator
- Parameters:
operator (str) – the name of the operator
- Returns:
the file suffix or None if unknown
- Return type:
str or None
Examples
>>> from pyroSAR.examine import ExamineSnap >>> config = ExamineSnap() >>> print(config.get_suffix('Terrain-Flattening')) 'TF'
- get_version(module)[source]¶
Read the version and date of different SNAP modules. This scans a file ‘messages.log’, which is re-written every time SNAP is started.
- property userpath¶
Get/set the SNAP configuration for snap.userdir in snap.properties.
Example
>>> from pyroSAR.examine import ExamineSnap >>> config = ExamineSnap() >>> config.userpath = '/path/to/snap/data' # This is equivalent to >>> config.snap_properties['snap.userdir'] = '/path/to/snap/data'
- class pyroSAR.examine.SnapProperties(path)[source]¶
Bases:
object
SNAP configuration interface. This class enables reading and modifying SNAP configuration in properties files. Modified properties are directly written to the files. Currently, the files snap.properties and snap.auxdata.properties are supported. These files can be found in two locations:
<SNAP installation directory>/etc
<user directory>/.snap/etc
Configuration in the latter has higher priority and modified properties will always be written there so that the installation directory is not modified.
- Parameters:
path (str) – SNAP installation directory path
Examples
>>> from pyroSAR.examine import ExamineSnap, SnapProperties >>> path = ExamineSnap().path >>> config = SnapProperties(path=path) >>> config['snap.userdir'] = '/path/to/snap/auxdata'
- property userpath¶
- property userpath_auxdata_properties¶
- property userpath_properties¶