# Multi-size Mosaic will not work with gpt command line

gpt -h has this row printed

Multi-size Mosaic Creates a multi-size mosaic out of a set of source products.

trying to make gpt Multi-size Mosaic -h returns
Unknown operator ‘Multi-size’.

gpt ‘Multi-size Mosaic’ -h works, but it would be nicer if the keyword would be Multi-size-Mosaic as other operators with multiple words.

Thanks
Mikko

When using the command line, every string containing spaces (e.g directories names) must be enclosed by quotes. It’s the same situation here.
It’s a minor detail, not an issue. The operator name will be updated.

1 Like

I do have this other issue as well with this operator:

[smart@mosa.fmi.fi sen2]$echo ifiles S2A_MSIL1C_20190515T094031_N0207_R036_T34VFM_20190515T101656.SAFE/GRANULE/L1C_T34VFM_A020339_20190515T094034/IMG_DATA/T34VFM_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T34VFN_20190515T101656.SAFE/GRANULE/L1C_T34VFN_A020339_20190515T094034/IMG_DATA/T34VFN_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T34VFP_20190515T101656.SAFE/GRANULE/L1C_T34VFP_A020339_20190515T094034/IMG_DATA/T34VFP_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VLG_20190515T101656.SAFE/GRANULE/L1C_T35VLG_A020339_20190515T094034/IMG_DATA/T35VLG_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VLH_20190515T101656.SAFE/GRANULE/L1C_T35VLH_A020339_20190515T094034/IMG_DATA/T35VLH_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VLJ_20190515T101656.SAFE/GRANULE/L1C_T35VLJ_A020339_20190515T094034/IMG_DATA/T35VLJ_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VMG_20190515T101656.SAFE/GRANULE/L1C_T35VMG_A020339_20190515T094034/IMG_DATA/T35VMG_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VMH_20190515T101656.SAFE/GRANULE/L1C_T35VMH_A020339_20190515T094034/IMG_DATA/T35VMH_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VMJ_20190515T101656.SAFE/GRANULE/L1C_T35VMJ_A020339_20190515T094034/IMG_DATA/T35VMJ_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VMK_20190515T101656.SAFE/GRANULE/L1C_T35VMK_A020339_20190515T094034/IMG_DATA/T35VMK_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VML_20190515T101656.SAFE/GRANULE/L1C_T35VML_A020339_20190515T094034/IMG_DATA/T35VML_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VNG_20190515T101656.SAFE/GRANULE/L1C_T35VNG_A020339_20190515T094034/IMG_DATA/T35VNG_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VNH_20190515T101656.SAFE/GRANULE/L1C_T35VNH_A020339_20190515T094034/IMG_DATA/T35VNH_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VNJ_20190515T101656.SAFE/GRANULE/L1C_T35VNJ_A020339_20190515T094034/IMG_DATA/T35VNJ_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VNK_20190515T101656.SAFE/GRANULE/L1C_T35VNK_A020339_20190515T094034/IMG_DATA/T35VNK_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VNL_20190515T101656.SAFE/GRANULE/L1C_T35VNL_A020339_20190515T094034/IMG_DATA/T35VNL_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VPG_20190515T101656.SAFE/GRANULE/L1C_T35VPG_A020339_20190515T094034/IMG_DATA/T35VPG_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VPH_20190515T101656.SAFE/GRANULE/L1C_T35VPH_A020339_20190515T094034/IMG_DATA/T35VPH_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VPJ_20190515T101656.SAFE/GRANULE/L1C_T35VPJ_A020339_20190515T094034/IMG_DATA/T35VPJ_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VPK_20190515T101656.SAFE/GRANULE/L1C_T35VPK_A020339_20190515T094034/IMG_DATA/T35VPK_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35VPL_20190515T101656.SAFE/GRANULE/L1C_T35VPL_A020339_20190515T094034/IMG_DATA/T35VPL_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WMM_20190515T101656.SAFE/GRANULE/L1C_T35WMM_A020339_20190515T094034/IMG_DATA/T35WMM_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WNM_20190515T101656.SAFE/GRANULE/L1C_T35WNM_A020339_20190515T094034/IMG_DATA/T35WNM_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WNN_20190515T101656.SAFE/GRANULE/L1C_T35WNN_A020339_20190515T094034/IMG_DATA/T35WNN_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WNP_20190515T101656.SAFE/GRANULE/L1C_T35WNP_A020339_20190515T094034/IMG_DATA/T35WNP_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WNQ_20190515T101656.SAFE/GRANULE/L1C_T35WNQ_A020339_20190515T094034/IMG_DATA/T35WNQ_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPM_20190515T101656.SAFE/GRANULE/L1C_T35WPM_A020339_20190515T094034/IMG_DATA/T35WPM_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPN_20190515T101656.SAFE/GRANULE/L1C_T35WPN_A020339_20190515T094034/IMG_DATA/T35WPN_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPP_20190515T101656.SAFE/GRANULE/L1C_T35WPP_A020339_20190515T094034/IMG_DATA/T35WPP_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPQ_20190515T101656.SAFE/GRANULE/L1C_T35WPQ_A020339_20190515T094034/IMG_DATA/T35WPQ_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPR_20190515T101656.SAFE/GRANULE/L1C_T35WPR_A020339_20190515T094034/IMG_DATA/T35WPR_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPS_20190515T101656.SAFE/GRANULE/L1C_T35WPS_A020339_20190515T094034/IMG_DATA/T35WPS_20190515T094031_B02.jp2 S2A_MSIL1C_20190515T094031_N0207_R036_T35WPT_20190515T101656.SAFE/GRANULE/L1C_T35WPT_A020339_20190515T094034/IMG_DATA/T35WPT_20190515T094031_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34VCN_20190515T123204.SAFE/GRANULE/L1C_T34VCN_A011431_20190515T103030/IMG_DATA/T34VCN_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34VCP_20190515T123204.SAFE/GRANULE/L1C_T34VCP_A011431_20190515T103030/IMG_DATA/T34VCP_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34VCQ_20190515T123204.SAFE/GRANULE/L1C_T34VCQ_A011431_20190515T103030/IMG_DATA/T34VCQ_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34VCR_20190515T123204.SAFE/GRANULE/L1C_T34VCR_A011431_20190515T103030/IMG_DATA/T34VCR_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34VDQ_20190515T123204.SAFE/GRANULE/L1C_T34VDQ_A011431_20190515T103030/IMG_DATA/T34VDQ_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34VDR_20190515T123204.SAFE/GRANULE/L1C_T34VDR_A011431_20190515T103030/IMG_DATA/T34VDR_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDA_20190515T123204.SAFE/GRANULE/L1C_T34WDA_A011431_20190515T103030/IMG_DATA/T34WDA_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDB_20190515T123204.SAFE/GRANULE/L1C_T34WDB_A011431_20190515T103030/IMG_DATA/T34WDB_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDC_20190515T123204.SAFE/GRANULE/L1C_T34WDC_A011431_20190515T103030/IMG_DATA/T34WDC_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDD_20190515T123204.SAFE/GRANULE/L1C_T34WDD_A011431_20190515T103030/IMG_DATA/T34WDD_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDS_20190515T123204.SAFE/GRANULE/L1C_T34WDS_A011431_20190515T103030/IMG_DATA/T34WDS_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDT_20190515T123204.SAFE/GRANULE/L1C_T34WDT_A011431_20190515T103030/IMG_DATA/T34WDT_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDU_20190515T123204.SAFE/GRANULE/L1C_T34WDU_A011431_20190515T103030/IMG_DATA/T34WDU_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WDV_20190515T123204.SAFE/GRANULE/L1C_T34WDV_A011431_20190515T103030/IMG_DATA/T34WDV_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WEA_20190515T123204.SAFE/GRANULE/L1C_T34WEA_A011431_20190515T103030/IMG_DATA/T34WEA_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WEB_20190515T123204.SAFE/GRANULE/L1C_T34WEB_A011431_20190515T103030/IMG_DATA/T34WEB_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WEC_20190515T123204.SAFE/GRANULE/L1C_T34WEC_A011431_20190515T103030/IMG_DATA/T34WEC_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WEE_20190515T123204.SAFE/GRANULE/L1C_T34WEE_A011431_20190515T103030/IMG_DATA/T34WEE_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WES_20190515T123204.SAFE/GRANULE/L1C_T34WES_A011431_20190515T103030/IMG_DATA/T34WES_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WET_20190515T123204.SAFE/GRANULE/L1C_T34WET_A011431_20190515T103030/IMG_DATA/T34WET_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WEU_20190515T123204.SAFE/GRANULE/L1C_T34WEU_A011431_20190515T103030/IMG_DATA/T34WEU_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WEV_20190515T123204.SAFE/GRANULE/L1C_T34WEV_A011431_20190515T103030/IMG_DATA/T34WEV_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WFA_20190515T123204.SAFE/GRANULE/L1C_T34WFA_A011431_20190515T103030/IMG_DATA/T34WFA_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WFB_20190515T123204.SAFE/GRANULE/L1C_T34WFB_A011431_20190515T103030/IMG_DATA/T34WFB_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WFC_20190515T123204.SAFE/GRANULE/L1C_T34WFC_A011431_20190515T103030/IMG_DATA/T34WFC_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WFU_20190515T123204.SAFE/GRANULE/L1C_T34WFU_A011431_20190515T103030/IMG_DATA/T34WFU_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T34WFV_20190515T123204.SAFE/GRANULE/L1C_T34WFV_A011431_20190515T103030/IMG_DATA/T34WFV_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WMR_20190515T123204.SAFE/GRANULE/L1C_T35WMR_A011431_20190515T103030/IMG_DATA/T35WMR_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WMS_20190515T123204.SAFE/GRANULE/L1C_T35WMS_A011431_20190515T103030/IMG_DATA/T35WMS_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WMT_20190515T123204.SAFE/GRANULE/L1C_T35WMT_A011431_20190515T103030/IMG_DATA/T35WMT_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WMU_20190515T123204.SAFE/GRANULE/L1C_T35WMU_A011431_20190515T103030/IMG_DATA/T35WMU_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WNS_20190515T123204.SAFE/GRANULE/L1C_T35WNS_A011431_20190515T103030/IMG_DATA/T35WNS_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WNT_20190515T123204.SAFE/GRANULE/L1C_T35WNT_A011431_20190515T103030/IMG_DATA/T35WNT_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WNU_20190515T123204.SAFE/GRANULE/L1C_T35WNU_A011431_20190515T103030/IMG_DATA/T35WNU_20190515T103029_B02.jp2 S2B_MSIL1C_20190515T103029_N0207_R108_T35WPU_20190515T123204.SAFE/GRANULE/L1C_T35WPU_A011431_20190515T103030/IMG_DATA/T35WPU_20190515T103029_B02.jp2 [smart@mosa.fmi.fi sen2] LD_LIBRARY_PATH=. ~/snap/bin/gpt ‘Multi-size Mosaic’ -q 1 -x -f ‘GeoTIFF-BigTIFF’ -Dsnap.dataio.bigtiff.compression.type=DEFLATE -PsouthBound=58.84 -PnorthBound=70.09 -PwestBound=19.08 -PeastBound=31.59 -Pcrs=EPSG:3067$ifiles
INFO: org.hsqldb.persist.Logger: dataFileCache open start
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at java.util.Collections$SynchronizedList.get(Collections.java:2417) at org.esa.snap.core.datamodel.ProductNodeList.getAt(ProductNodeList.java:57) at org.esa.snap.core.datamodel.ProductNodeGroup.get(ProductNodeGroup.java:77) at org.esa.s2tbx.dataio.mosaic.reproject.S2tbxReprojectionOp$DefaultReprojectionSettingsProvider.(S2tbxReprojectionOp.java:819)
at org.esa.s2tbx.dataio.mosaic.reproject.S2tbxReprojectionOp$ReprojectionSettingsProvider.(S2tbxReprojectionOp.java:800) at org.esa.s2tbx.dataio.mosaic.reproject.S2tbxReprojectionOp.initialize(S2tbxReprojectionOp.java:277) at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486) at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273) at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387) at org.esa.snap.core.gpf.GPF.createProductNS(GPF.java:318) at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:293) at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:272) at org.esa.s2tbx.dataio.mosaic.S2tbxMosaicOp.reproject(S2tbxMosaicOp.java:290) at org.esa.s2tbx.dataio.mosaic.S2tbxMosaicOp.initialize(S2tbxMosaicOp.java:164) at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486) at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273) at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387) at org.esa.snap.core.gpf.main.CommandLineTool.runOperator(CommandLineTool.java:306) at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:284) at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188) at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121) at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54) at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55) at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189) at org.esa.snap.runtime.Launcher.run(Launcher.java:51) at org.esa.snap.runtime.Launcher.main(Launcher.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62) at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57) Error: Index: 0, Size: 0 So running it isn’t working! Cheers Mikko Hello, From the stack trace you provided it seems that the error is caused by S2tbxReprojectionOp … Can you try to set all the parameters? For example I don’t see PelevationModelName, PoverlappingMethod, Presampling. (I managed to run this operator with gpt, inside of a simple graph) Best regards, Oana Hi PelevationModelName is not valid as doing orthorectification is default ‘false’ and I don’t want it. Also PoverlappingMethod is supposed to have a default that is fine with me. I added the Presampling=Nearest, but no change to the error output. I want this running without a graph file and on the command line. Our server has no display driver and the script will everyday change the data files, so it would be best to do all on the commandline. Cheers Mikko Hi Mikko, I will test it in command line like you and investigate the issue. Regards, Oana Hi Mikko, The cause of the error is due to the fact that there is no way to specify linearly in the command line the variables (names and expressions) that are actually the bands extracted from the source product. Therefore no band gets extracted from the given source product, and this is causing the crash after. The only way to specify the collection of variables structure is using the XML graph. You can define external variables and use them inside the graph. See an example below: graphMultiSizeMosaicOp.xml (1.9 KB) In this example, I have set$var1BandName=“B5” and \$var1BandExpression=“B5”.

After, the graph itself can be run in command line, using gpt (“gpt \path\to\graph.xml”).

Best regards,
Oana

Hello Oana,

I have a question about the file you gave :
How do you define the “crs” variable name ? If I look for WGS84(DD), I can’t find it when I’m on the GUI, but I do see the “Geographic Lat/Lon (WGS 84)”. So how do you define the name you just used ?
And this question is up for variable I want to play with in my xml files.

Cheers

You can use the EPSG-Code or a WKT string.
That’s from the help on the command line:

 -Pcrs=<string>                   The CRS of the target product, represented as WKT or authority code.
Default value is 'EPSG:4326'.


For WGS84 use EPSG:4326 and for e.g. UTM zone 48S use EPSG:32748.

After configuring the projection you can display the parameters as xml. Simply select the option from the File menu of the operator. Depending on your configuration it will show you something like ths:

1 Like

Thanks for the answer Marco, easy to access but I didn’t get it in the help section !

Kinda old-topic, but maybe u can help me @marpet

Is there a way to use all .dim-files in a directory as an input without specifying them in a batch-file?