Model list of the snappy

Hi @marpet and colleagues,

I am working on using snappy api to develop some algorithms. But I have not found many document of it. Does any one have any clues of how to use a model with python script, which can be found in SNAP-desktop? This is a general question.

To tell more about this. To use the model in SNAP-desktop Radar-Radiometric-Calibrate, we can write the script like the following. It is easy to find the relevant parameters in the script and SNAP-desktop UIs.

parameters = HashMap() 
parameters.put('outputSigmaBand', True) 
parameters.put('sourceBands', 'Intensity_' + polarization) 
parameters.put('selectedPolarisations', polarization) 
parameters.put('outputImageScaleInDb', False)  
target_0 = GPF.createProduct("Calibration", parameters, p) 
ProductIO.writeProduct(target_0, 'test_clib'+polarization, 'GeoTIFF-BigTiff')

However, if I am trying to use another model, i.e. “SNAP-desktop-Radar-Apply Orbit File”, how do I know the parameter names and the model names? Like what can I replace the “Calibration” for the above codes? And how to find them?

Thanks

Solved by looking into other posts.

Usually when you try to use a model like SNAP-desktop with snappy, you can refer to this:

The list of the operators (models) can be found typing “gpt” in command line.

Here are all of them supported in 6.0:

 - Aatsr.SST                            Computes sea surface temperature (SST) from (A)ATSR products.
- AATSR.Ungrid                        Ungrids (A)ATSR L1B products and extracts geolocation and pixel field of view data.
-  AdaptiveThresholding                 Detect ships using Constant False Alarm Rate detector.
-  AddElevation                         Creates a DEM band
-  AddLandCover                         Creates a land cover band
-  AerosolRetrieval.S2.Master           Aerosol retrieval from S2 MSI following USwansea algorithm as used in GlobAlbedo project.
-  ALOS-Deskewing                       Deskewing ALOS product
-  Apply-Orbit-File                     Apply orbit file
-  Arc.SST                              Computes sea surface temperature (SST) from (A)ATSR products.
-  ArviOp                               Atmospherically Resistant Vegetation Index belongs to a family of indices with built-in atmospheric corrections.
-  AzimuthFilter                        Azimuth Filter
-  Back-Geocoding                       Bursts co-registration using orbit and DEM
-  BandMaths                            Create a product with one or more bands using mathematical expressions.
-  BandMerge                            Allows copying raster data from any number of source products to a specified 'master' product.
-  BandSelect                           Creates a new product with only selected bands
-  Bi2Op                                The Brightness index represents the average of the brightness of a satellite image.
                                       This index is sensitive to the brightness of soils which is highly correlated with the humidity and the presence of salts in surface
-  Binning                              Performs spatial and temporal aggregation of pixel values into cells ('bins') of a planetary grid
-  BiOp                                 The Brightness index represents the average of the brightness of a satellite image.
-  BiophysicalOp                        The 'Biophysical Processor' operator retrieves LAI from atmospherically corrected Sentinel-2 products
-  c2rcc.landsat8                       Performs atmospheric correction and IOP retrieval with uncertainties on Landsat-8 L1 data products.
-  c2rcc.meris                          Performs atmospheric correction and IOP retrieval with uncertainties on MERIS L1b data products.
-  c2rcc.meris4                         Performs atmospheric correction and IOP retrieval with uncertainties on MERIS L1b data products from the 4th reprocessing.
-  c2rcc.modis                          Performs atmospheric correction and IOP retrieval on MODIS L1C_LAC data products.
-  c2rcc.msi                            Performs atmospheric correction and IOP retrieval with uncertainties on Sentinel-2 MSI L1C data products.
-  c2rcc.olci                           Performs atmospheric correction and IOP retrieval with uncertainties on SENTINEL-3 OLCI L1B data products.
-  c2rcc.seawifs                        Performs atmospheric correction and IOP retrieval on SeaWifs L1C data products.
-  c2rcc.viirs                          Performs atmospheric correction and IOP retrieval on Viirs L1C data products.
-  Calibration                          Calibration of products
-  CCICloudShadow                       Algorithm detecting cloud shadow...
-  Change-Detection                     Change Detection.
-  CiOp                                 Colour Index  was developed to differentiate soils in the field.
                                       In most cases the CI gives complementary information with the BI and the NDVI.
                                        Used for diachronic analyses, they help for a better understanding of the evolution of soil surfaces.
-  CloudProb                            Applies a clear sky conservative cloud detection algorithm.
-  Coherence                            Estimate coherence from stack of coregistered images
-  Collocate                            Collocates two products based on their geo-codings.
-  Convert-Datatype                     Convert product data type
-  CreateStack                          Collocates two or more products based on their geo-codings.
-  Cross-Channel-SNR-Correction         Compute general polarimetric parameters
-  Cross-Correlation                    Automatic Selection of Ground Control Points
-  CrossResampling                      Estimate Resampling Polynomial using SAR Image Geometry, and Resample Input Images
-  DeburstWSS                           Debursts an ASAR WSS product
-  DEM-Assisted-Coregistration          Orbit and DEM based co-registration
-  Double-Difference-Interferogram      Compute double difference interferogram
-  DviOp                                Difference Vegetation Index retrieves the Isovegetation lines parallel to soil line
-  EAP-Phase-Correction                 EAP Phase Correction
-  Ellipsoid-Correction-GG              GG method for orthorectification
-  Ellipsoid-Correction-RD              Ellipsoid correction with RD method and average scene height
-  EMClusterAnalysis                    Performs an expectation-maximization (EM) cluster analysis.
-  Enhanced-Spectral-Diversity          Estimate constant range and azimuth offsets for the whole image
-  Fill-DEM-Hole                        Fill holes in given DEM product file.
-  Find-Image-Pair                      DB query to find matching image pair
-  FlhMci                               Computes fluorescence line height (FLH) or maximum chlorophyll index (MCI).
-  Flip                                 flips a product horizontal/vertical
-  FUB.Water                            FUB/WeW WATER Processor to retrieve case II water properties and atmospheric properties
-  FuClassification                     Colour classification based on the discrete Forel-Ule scale.
-  GemiOp                               This retrieves the Global Environmental Monitoring Index (GEMI).
-  GenericRegionMergingOp               The 'Generic Region Merging' operator computes the distinct regions from a product
-  GLCM                                 Extract Texture Features
-  GndviOp                              Green Normalized Difference Vegetation Index
-  GoldsteinPhaseFiltering              Phase Filtering
-  GRD-Post                             Applies GRD post-processing
-  Idepix.Envisat.Meris                 Pixel identification and classification for MERIS.
-  Idepix.Landsat8.OLI                  Pixel identification and classification for Landsat-8 OLI instrument.
-  Idepix.OrbView2.Seawifs              Pixel identification and classification for SeaWiFS.
-  Idepix.Probav.Vegetation             Pixel identification and classification for PROBA-V.
-  Idepix.Sentinel2                     Pixel identification and classification for Sentinel-2.
-  Idepix.Sentinel3.Olci                Pixel identification and classification for OLCI.
-  Idepix.SuomiNpp.Viirs                Pixel identification and classification for VIIRS.
-  Idepix.TerraAqua.Modis               Pixel identification and classification for MODIS.
-  Image-Filter                         Common Image Processing Filters
-  Import-Vector                        Imports a shape file into a product
-  IntegerInterferogram                 Create integer interferogram
-  Interferogram                        Compute interferograms from stack of coregistered S-1 images
-  IpviOp                               Infrared Percentage Vegetation Index retrieves the Isovegetation lines converge at origin
-  IreciOp                              Inverted red-edge chlorophyll index
- KDTree-KNN-Classifier                KDTree KNN classifier
-  KMeansClusterAnalysis                Performs a K-Means cluster analysis.
-  KNN-Classifier                       K-Nearest Neighbour classifier
-  Land-Cover-Mask                      Perform decision tree classification
-  Land-Sea-Mask                        Creates a bitmask defining land vs ocean.
-  LandWaterMask                        Operator creating a target product with a single band containing a land/water-mask.
-  LinearToFromdB                       Converts bands to/from dB
-  Maximum-Likelihood-Classifier        Maximum Likelihood classifier
-  McariOp                              Modified Chlorophyll Absorption Ratio Index, developed to be responsive to chlorophyll variation
-  Mci.s2                               Computes maximum chlorophyll index (MCI) for Sentinel-2 MSI.
-  Merge                                Allows merging of several source products by using specified 'master' as reference product.
-  Meris.CorrectRadiometry              Performs radiometric corrections on MERIS L1b data products.
-  Meris.N1Patcher                      Copies an existing N1 file and replaces the data for the radiance bands
-  Minimum-Distance-Classifier          Minimum Distance classifier
-  MndwiOp                              Modified Normalized Difference Water Index, allowing for the measurement of surface water extent
-  Mosaic                               Creates a mosaic out of a set of source products.
-  MphChl                               This operator computes maximum peak height of chlorophyll (MPH/CHL).
-  Msavi2Op                             This retrieves the second Modified Soil Adjusted Vegetation Index (MSAVI2).
-  MsaviOp                              This retrieves the Modified Soil Adjusted Vegetation Index (MSAVI).
-  MtciOp                               The Meris Terrestrial Chlorophyll Index,  aims at estimating the Red Edge Position (REP).
                                       This is the maximum slant point in the red and near-infrared region of the vegetal spectral reflectance.
                                       It is useful for observing the chlorophyll contents, vegetation senescence, and stress for water and nutritional deficiencies, but it is less suitable for land classification
-  Multi-size Mosaic                    Creates a multi-size mosaic out of a set of source products.
-  Multi-Temporal-Speckle-Filter        Speckle Reduction using Multitemporal Filtering
-  Multilook                            Averages the power across a number of lines in both the azimuth and range directions
-  Ndi45Op                              Normalized Difference Index using bands 4 and 5
-  NdpiOp                               The normalized differential pond index, combines the short-wave infrared band-I and the green band
-  NdtiOp                               Normalized difference turbidity index, allowing for the measurement of water turbidity
-  NdviOp                               The retrieves the Normalized Difference Vegetation Index (NDVI).
-  Ndwi2Op                              The Normalized Difference Water Index, allowing for the measurement of surface water extent
-  NdwiOp                               The Normalized Difference Water Index was developed for the extraction of water features
-  Object-Discrimination                Remove false alarms from the detected objects.
-  Offset-Tracking                      Create velocity vectors from offset tracking
-  Oil-Spill-Clustering                 Remove small clusters from detected area.
-  Oil-Spill-Detection                  Detect oil spill.
-  Orientation-Angle-Correction         Perform polarization orientation angle correction for given coherency matrix
-  Oversample                           Oversample the datset
-  OWTClassification                    Performs an optical water type classification based on atmospherically corrected reflectances.
-  PCA                                  Performs a Principal Component Analysis.
-  PduStitching                         Stitches multiple SLSTR L1B product dissemination units (PDUs) of the same orbit to a single product.
-  PhaseFilter                          Interferometric phase filtering
-  PhaseToDisplacement                  Phase To Displacement Conversion along LOS
-  PhaseToElevation                     DEM Generation
-  PhaseToHeight                        Phase to Height conversion
-  PixEx                                Extracts pixels from given locations and source products.
-  Polarimetric-Classification          Perform Polarimetric classification of a given product
-  Polarimetric-Decomposition           Perform Polarimetric decomposition of a given product
-  Polarimetric-Matrices                Generates covariance or coherency matrix for given product
-  Polarimetric-Parameters              Compute general polarimetric parameters
-  Polarimetric-Speckle-Filter          Polarimetric Speckle Reduction
-  Principle-Components                 Principle Component Analysis
-  ProductSet-Reader                    Adds a list of sources
-  PssraOp                              Pigment Specific Simple Ratio, chlorophyll index
-  PviOp                                Perpendicular Vegetation Index retrieves the Isovegetation lines parallel to soil line. Soil line has an arbitrary slope and passes through origin
-  Rad2Refl                             Provides conversion from radiances to reflectances or backwards.
-  Random-Forest-Classifier             Random Forest based classifier
-  RangeFilter                          Range Filter
-  RayleighCorrection                   Performs radiometric corrections on OLCI, MERIS L1b and S2 MSI data products.
-  Read                                 Reads a data product from a given file location.
-  ReflectanceToRadianceOp              The 'Reflectance To Radiance Processor' operator retrieves the radiance from reflectance using Sentinel-2 products
-  ReipOp                               The red edge inflection point index
-  Remove-GRD-Border-Noise              Mask no-value pixels for GRD product
-  RemoveAntennaPattern                 Remove Antenna Pattern
-  ReplaceMetadata                      Replace the metadata of the first product with that of the second
-  Reproject                            Reprojection of a source product to a target Coordinate Reference System.
-  Resample                             Resampling of a multi-size source product to a single-size target product.
-  RiOp                                 The Redness Index was developed to identify soil colour variations.
-  RviOp                                Ratio Vegetation Index retrieves the Isovegetation lines converge at origin
-  S2.WaterVapour                       Water Vapour retrieval from S2 MSI
-  S2repOp                              Sentinel-2 red-edge position index
-  S2tbx-Reproject                      Reprojection of a source product to a target Coordinate Reference System.
-  SAR-Mosaic                           Mosaics two or more products based on their geo-codings.
-  SAR-Simulation                       Rigorous SAR Simulation
-  SARSim-Terrain-Correction            Orthorectification with SAR simulation
-  SaviOp                               This retrieves the Soil-Adjusted Vegetation Index (SAVI).
-  SetNoDataValue                       Set NoDataValueUsed flag and NoDataValue for all bands
-  SliceAssembly                        Merges Sentinel-1 slice products
-  SmacOp                               Applies the Simplified Method for Atmospheric Corrections of Envisat MERIS/(A)ATSR measurements.
-  SmosNetcdfExport                     Exports SMOS Earth Explorer products to NetCDF format.
-  SnaphuExport                         Export data and prepare conf file for SNAPHU processing
-  SnaphuImport                         Ingest SNAPHU results into InSAR product.
-  Speckle-Divergence                   Detect urban area.
-  Speckle-Filter                       Speckle Reduction
-  SRGR                                 Converts Slant Range to Ground Range
-  Stack-Averaging                      Averaging multi-temporal images
-  Stack-Split                          Writes all bands to files.
-  StampsExport                         Export data for StaMPS processing
-  StatisticsOp                         Computes statistics for an arbitrary number of source products.
-  SubGraph                             Encapsulates a graph within a graph.
-  Subset                               Create a spatial and/or spectral subset of a data product.
-  Supervised-Wishart-Classification    Perform supervised Wishart classification
-  TemporalPercentile                   Computes percentiles over a given time period.
-  Terrain-Correction                   RD method for orthorectification
-  Terrain-Flattening                   Terrain Flattening
-  Terrain-Mask                         Terrain Mask Generation
-  ThermalNoiseRemoval                  Removes thermal noise from products
-  Three-passDInSAR                     Differential Interferometry
-  TileWriter                           Writes a data product to a tiles.
-  TndviOp                              Transformed Normalized Difference Vegetation Index retrieves the Isovegetation lines parallel to soil line
-  ToolAdapterOp                        Tool Adapter Operator
-  TopoPhaseRemoval                     Compute and subtract TOPO phase
-  TOPSAR-Deburst                       Debursts a Sentinel-1 TOPSAR product
-  TOPSAR-Merge                         Merge subswaths of a Sentinel-1 TOPSAR product
-  TOPSAR-Split                         Creates a new product with only the selected subswath
-  TsaviOp                              This retrieves the Transformed Soil Adjusted Vegetation Index (TSAVI).
-  Undersample                          Undersample the datset
-  Unmix                                Performs a linear spectral unmixing.
-  Update-Geo-Reference                 Update Geo Reference
-  Warp                                 Create Warp Function And Get Co-registrated Images
-  WdviOp                               Weighted Difference Vegetation Index retrieves the Isovegetation lines parallel to soil line. Soil line has an arbitrary slope and passes through origin
-  Wind-Field-Estimation                Estimate wind speed and direction
-  Write                                Writes a data product to a file.

When you try to figure out which parameters need to be specified. Use the following code below:

from snappy import GPF
GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis()
op_spi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi('OperatorName')
print('Op name:', op_spi.getOperatorDescriptor().getName())
print('Op alias:', op_spi.getOperatorDescriptor().getAlias())
param_Desc = op_spi.getOperatorDescriptor().getParameterDescriptors()
for param in param_Desc:
    print(param.getName(), "or", param.getAlias())
8 Likes

This is the script I wrote to pre-process Sentinel-1 GRD products https://github.com/wajuqi/Sentinel-1-preprocessing-using-Snappy.

The processing steps I used are:

  1. Apply orbit file
  2. Thermal noise removal
  3. Radiometric calibration
  4. Speckle filtering
  5. Terrain correction
  6. Subset

Please let me know if you have any questions. Thanks.

1 Like