WriteProduct - where to find allowed formatName

I wrote following part of code, to save my results to a file:

OutputType = [".dim",“BEAM-DIMAP”]

from snappy import ProductIO
ProductIO.writeProduct(sub_product, newFile, OutputType[1])

However, I use “BEAM-DIMAP” only because I found it within the snappy examples (I am not aware of the advantages of this format).

I can’t find list of allowed output formats within the documentation (which I believe is in http://step.esa.int/docs/v2.0/apidoc/engine/org/esa/snap/core/dataio/ProductIO.html#writeProduct-org.esa.snap.core.datamodel.Product-java.lang.String-java.lang.String-

Could you tell me:

  1. What are the allowed output formats?
  2. Do I need to save intermediate results to a file or can I redirect output from one operation to another? For example - can I subset one product and without saving apply calibration to obtain sigma0?

Good point. We have it on the agenda to make it easier access this information.
For now you can use a python script to print the formats.
formats.py (713 Bytes)

@marpet Great work, thanks to your script, I know that:

Allowed formats to write: GeoTIFF-BigTIFF,HDF5,Snaphu,BEAM-DIMAP,GeoTIFF+XML,PolSARPro,NetCDF-CF,NetCDF-BEAM,ENVI,JP2,Generic Binary BSQ,Gamma,CSV,NetCDF4-CF,GeoTIFF,NetCDF4-BEAM 

However, there are no default extensions listed with formats, for example:

OutputType = [".dim", “BEAM-DIMAP”]

Is it possible to obtain them as well?

1 Like

Hi,
I have slightly adapted the script to also output the extensions.

formats_and_extensions.py (787 Bytes)

2 Likes
Writer formats
   .rgb GDAL-SGI-WRITER
   .tif GeoTIFF-BigTIFF
   .grd GDAL-GSBG-WRITER
   .ntf GDAL-NITF-WRITER
   jpg JP2
   .sdat GDAL-SAGA-WRITER
   .nc NetCDF4-BEAM
   .hdr ENVI
   .tif GeoTIFF+XML
   .par Gamma
   .img GDAL-HFA-WRITER
   .h5 HDF5
   .hdr PolSARPro
   .rst GDAL-RST-WRITER
   .jp2 JPEG2000
   .tif GDAL-GTiff-WRITER
   .bin Generic Binary BSQ
   .nc NetCDF4-CF
   .pix GDAL-PCIDSK-WRITER
   .dim BEAM-DIMAP
   .grd GDAL-GS7BG-WRITER
   .hdr GDAL-MFF-WRITER
   .tif GeoTIFF
   .mpr GDAL-ILWIS-WRITER
   .csv CSV
   .gtx GDAL-GTX-WRITER
   .pnm GDAL-PNM-WRITER
   .bmp GDAL-BMP-WRITER
   .kro GDAL-KRO-WRITER
   .hdr Snaphu
   .bt GDAL-BT-WRITER
   .par Gamma for PyRate
   .rsw GDAL-RMF-WRITER
Reader formats
   .hdf HDF-EOS
   .xml SENTINEL-2-MSI-MultiRes-UTM17N
   .xml SENTINEL-2-MSI-MultiRes-UTM55N
   .rgb GDAL-SGI-READER
   .xml SENTINEL-2-MSI-MultiRes-UTM40N
   .xml PAZ
   .gtx GDAL-GTX-READER
   .xml SENTINEL-2-MSI-MultiRes-UTM28S
   .xml SENTINEL-2-MSI-MultiRes-UTM05N
   .xml Sen3_SLSTRL1B_500m
   .bin SMOS Light-BUFR
   .xml SENTINEL-2-MSI-MultiRes-UTM41S
   .he5 GOCI-L1B
    PRISM
   .xml SENTINEL-2-MSI-MultiRes-UTM57S
   .ers GDAL-ERS-READER
   .xml SENTINEL-2-MSI-MultiRes-UTM51S
   bin Complex Binary
   .xml SENTINEL-2-MSI-MultiRes-UTM56S
   h5 Kompsat5
   .xml SENTINEL-2-MSI-MultiRes-UTM12S
   .txt SPOT-VGT
   .xml SENTINEL-2-MSI-MultiRes-UTM12N
   .xml SENTINEL-2-MSI-MultiRes-UTM51N
   .xml SENTINEL-2-MSI-MultiRes-UTM24S
    ERS CEOS
   .hdf MODIS
   .xml AlosPRIDimap
   .xml MER_L1_S3
   .xml SENTINEL-2-MSI-MultiRes-UTM24N
   .tif GeoTIFF-BigTIFF
   .dat FAST L5
   .xml SPOT5Take5
   .bufr SMOS BUFR
   .nc NetCDF-BEAM
   .xml SENTINEL-2-MSI-MultiRes-UTM25S
   .xml WorldView2GeoTIFF
   .xml SENTINEL-2-MSI-MultiRes-UTM31S
   .jp2 JPEG2000
   .xml SENTINEL-2-MSI-MultiRes-UTM29N
   .xml SENTINEL-2-MSI-MultiRes-UTM49N
   .xml ATS_L1_S3
   .xml SENTINEL-2-MSI-MultiRes-UTM50N
    NOAA_AVHRR_3_L1B
   .xml SENTINEL-2-MSI-MultiRes-UTM16N
   .xml SENTINEL-2-MSI-MultiRes-UTM44S
   .rst GDAL-RST-READER
   .h5 VIIRS
   .xml SENTINEL-2-MSI-MultiRes-UTM35N
   .xml RapidEyeNITF
   .dim SPOTDimap
   .xml SENTINEL-2-MSI-MultiRes-UTM49S
   .xml SENTINEL-2-MSI-MultiRes-UTM54N
   .xml SENTINEL-2-MSI-MultiRes-UTM44N
   .xml TerraSarX
   .xml SENTINEL-2-MSI-MultiRes-UTM47S
   .xml SENTINEL-2-MSI-MultiRes-UTM58S
   .xml SENTINEL-2-MSI-MultiRes-UTM39S
   .xml SENTINEL-2-MSI-MultiRes-UTM42N
   .xml SPOT6Dimap
   .xml SENTINEL-2-MSI-MultiRes-UTM36N
   .xml SENTINEL-2-MSI-MultiRes-UTM17S
   .xml SENTINEL-2-MSI-MultiRes-UTM25N
   .xml SENTINEL-2-MSI-MultiRes-UTM40S
   .xml SENTINEL-2-MSI-MultiRes-UTM11N
   .xml SENTINEL-2-MSI-MultiRes-UTM60S
   .xml SENTINEL-2-MSI-MultiRes-UTM09N
   .hdf SeaDAS-L1
   .xml SENTINEL-2-MSI-MultiRes-UTM03S
   .xml SENTINEL-2-MSI-MultiRes-UTM04S
   .xml SENTINEL-2-MSI-MultiRes-UTM34S
   .xml SENTINEL-2-MSI-MultiRes-UTM47N
   .dim BEAM-DIMAP
    AVNIR-2
   .xml SENTINEL-2-MSI-MultiRes-UTM38N
   .xml SENTINEL-2-MSI-MultiRes-UTM15N
   .ACE ACE
   .xml SENTINEL-2-MSI-MultiRes-UTM11S
   .xml SENTINEL-2-MSI-MultiRes-UTM29S
   .xml SENTINEL-2-MSI-MultiRes-UTM18S
   .hdr ENVI
   .he5 DSCOVER-L2
   .xml SENTINEL-2-MSI-MultiRes-UTM48S
   .kro GDAL-KRO-READER
   tif ALOS-2 GeoTIFF
   .xml SENTINEL-2-MSI-MultiRes-UTM01N
   .xml SENTINEL-2-MSI-MultiRes-UTM39N
   .txt Landsat8GeoTIFF15m
   .xml Sen3
    Basic CEOS
   .xml SENTINEL-2-MSI-MultiRes-UTM38S
   .xml SENTINEL-2-MSI-MultiRes-UTM07S
   .dim DEIMOSDimap
   .txt LandsatGeoTIFF
   .hdf OCM2-L1B
   .nc Binned_data_product
   .xml SENTINEL-2-MSI-MultiRes-UTM14N
   .xemt SAOCOM
   .xml SENTINEL-2-MSI-MultiRes-UTM31N
   .xml SENTINEL-2-MSI-MultiRes-UTM46S
   .xml SENTINEL-2-MSI-MultiRes-UTM32S
   .img GDAL-HFA-READER
   .xml SENTINEL-2-MSI-MultiRes-UTM16S
   .l1b NOAA_POD_AVHRR_HRPT
   .xml SENTINEL-2-MSI-MultiRes-UTM56N
   .nc L3_ENV_MER
   .xml SENTINEL-2-MSI-MultiRes-UTM03N
   .xml SENTINEL-2-MSI-MultiRes-UTM05S
   .xml SENTINEL-2-MSI-MultiRes-UTM45N
   .xml SENTINEL-2-MSI-MultiRes-UTM06S
   .xml SENTINEL-2-MSI-MultiRes-UTM01S
   .xml SENTINEL-2-MSI-MultiRes-UTM20S
   .xml SENTINEL-2-MSI-MultiRes-UTM41N
   .xml RapidEyeGeoTIFF
   .xml Sen3_SLSTRL1B_1km
   .nc SMOS-NC
   .hdr GDAL-MFF-READER
   .nc PACE-L1B
   .pix GDAL-PCIDSK-READER
   .HDR SMOS-EEF
   bin Generic Binary
   .xml SENTINEL-2-MSI-MultiRes-UTM30S
   .hdf SeaDAS-L3
   .ntf GDAL-NITF-READER
   .nc SeaDAS-L2
   xml RCM
   .txt Landsat8GeoTIFF30m
   .xml SENTINEL-2-MSI-MultiRes-UTM37N
   .xml SENTINEL-2-MSI-MultiRes-UTM10S
   .xml MER_L2_S3
   .xml SENTINEL-2-MSI-MultiRes-UTM13S
   .xml SENTINEL-2-MSI-MultiRes-UTM21N
   .xml AlosAV2Dimap
   .ACE2 ACE2
   .L1B-M_SNPP.nc VIIRS-L1B
   .xml MUSCATE
   .xml SENTINEL-2-MSI-MultiRes-UTM59N
   .xml SPOT4Take5
   .xml WorldViewGeoTIFF
   .xml SENTINEL-2-MSI-MultiRes-UTM28N
   .rat.hdr RAT
   .xml SENTINEL-2-MSI-MultiRes-UTM32N
   .sdat GDAL-SAGA-READER
   .grd GDAL-GSBG-READER
   .xml SENTINEL-2-MSI-MultiRes-UTM59S
   .nc.bz2 NetCDF
    ALOS PALSAR CEOS
   .xml SENTINEL-2-MSI-MultiRes-UTM43N
   .xml SENTINEL-2-MSI-MultiRes-UTM52S
   .grd GDAL-GS7BG-READER
   .xml SENTINEL-2-MSI-MultiRes-UTM55S
   .xml SENTINEL-2-MSI-MultiRes-UTM35S
   .xml SENTINEL-2-MSI-MultiRes-UTM09S
   .hdr PolSARPro
   .json Capella
    ARC_INFO_BIN_GRID
   .pgx PGX
   .xml SENTINEL-2-MSI-MultiRes-UTM50S
   .xml SENTINEL-2-MSI-MultiRes-UTM34N
   .xml SENTINEL-2-MSI-MultiRes-UTM14S
   .xml SENTINEL-2-MSI-MultiRes-UTM46N
   .mpr GDAL-ILWIS-READER
   .hdf MODIS-L1B
   .xml SENTINEL-2-MSI-MultiRes-UTM33S
   txt RISAT-1
   .xml SENTINEL-2-MSI-L1B-MultiRes
   .xml SENTINEL-2-MSI-MultiRes-UTM04N
   .xml SENTINEL-2-MSI-MultiRes-UTM58N
   .xml SENTINEL-2-MSI-MultiRes-UTM54S
   .xml IkonosGeoTIFF
   h5 CosmoSkymed
   .xml SENTINEL-2-MSI-MultiRes-UTM57N
   .xml SENTINEL-2-MSI-MultiRes-UTM23S
   .xml SENTINEL-2-MSI-MultiRes-UTM19N
   mat Matlab
   .xml SENTINEL-2-MSI-MultiRes-UTM02S
   .xml SENTINEL-2-MSI-MultiRes-UTM36S
   dem GTOPO30
   .xml LandsatL2GeoTIFF
   .hdr HICO
   h5 IceyeProduct
   .rsw GDAL-RMF-READER
   .meta.xml Gaofen3
   hgt HGT
   .xml SENTINEL-2-MSI-MultiRes-UTM43S
   .xml SENTINEL-2-MSI-MultiRes-UTM06N
   .par Gamma
   .xml SENTINEL-2-MSI-MultiRes-UTM27S
   .h5 HICO-L1B
   .xml SENTINEL-2-MSI-60M
   .xml SENTINEL-2-MSI-MultiRes-UTM48N
   .bt GDAL-BT-READER
   .snaphu.hdr SNAPHU
   .xml SENTINEL-2-MSI-MultiRes-UTM19S
   xml SeaSat
   .xml Kompsat2GeoTIFF
    RADARSAT-1
   .xml SENTINEL-2-MSI-MultiRes-UTM37S
   .getasse30 GETASSE30
   .tif GDAL-GTiff-READER
   .xml SPOTView
   .N1 ENVISAT
   .xml SENTINEL-2-MSI-MultiRes-UTM26S
   .xml PleiadesDimap
   .xml SENTINEL-2-MSI-20M
   .hdf SeaDAS-Browse
   .xml SENTINEL-2-MSI-MultiRes-UTM42S
   xml RADARSAT-2
   .png IMAGE
   .xml SENTINEL-2-MSI-MultiRes-UTM33N
   .xml SENTINEL-2-MSI-MultiRes-UTM53N
   .csv CSV
   .xml SENTINEL-2-MSI-MultiRes-UTM22S
   .xml SENTINEL-2-MSI-MultiRes-UTM08S
   .xml SENTINEL-2-MSI-MultiRes-UTM23N
   .xml SENTINEL-2-MSI-MultiRes-UTM45S
   .xml SENTINEL-2-MSI-MultiRes-UTM13N
   .xml SENTINEL-2-MSI-MultiRes-UTM15S
    ALOS-2 CEOS
   .HDF5 PROBA-V-L2A/L3
   .xml SENTINEL-2-MSI-MultiRes-UTM60N
   .nc NetCDF-CF
   safe SENTINEL-1
    METOP_AVHRR_3_L1B
    ATSR
   .xml SENTINEL-2-MSI-MultiRes-UTM26N
   .xml SENTINEL-2-MSI-10M
   .h5 Aquarius
   .xml SENTINEL-2-MSI-MultiRes-UTM02N
   .xml SENTINEL-2-MSI-MultiRes-UTM22N
   .xml SENTINEL-2-MSI-MultiRes-UTM27N
   .xml SENTINEL-2-MSI-MultiRes-UTM21S
   .xml SENTINEL-2-MSI-MultiRes-UTM20N
   .xml SENTINEL-2-MSI-MultiRes-UTM52N
   .xml SENTINEL-2-MSI-MultiRes-UTM08N
   .hdf SeaDAS-ANC
   .tif GeoTIFF
   .xml SENTINEL-2-MSI-MultiRes-UTM53S
   .xml SENTINEL-2-MSI-MultiRes-UTM10N
   .xml SENTINEL-2-MSI-MultiRes-UTM18N
    JERS CEOS
   .xml SENTINEL-2-MSI-MultiRes-UTM07N
   .xml SENTINEL-2-MSI-MultiRes-UTM30N