Doesn't take specified source in gpt

i run my gpt file from command line and give the source file using both -Psource= and -Ssource= but it still run the gpt on the file set in the graph
PREPROCESS_beamdimap.xml (3.7 KB)
this is my graph and i run it gpt.exe PREPROCESS_beamdimap.xml -Ssource=“C:\Input_Data\TSX-1.SAR.L1B\TSX1_SAR__EEC_RE___SC_S_SRA_20140910T011220_20140910T011231\TSX1_SAR__EEC_RE___SC_S_SRA_20140910T011220_20140910T011231.xml” but the output file created is on the source file in the graph

Attached is a updated version of your graph file.
Your graph was completely pre-configured. That’ why the settings on the command line had no effect. It was necessary to remove the Read node and update the Calibration node in a way that it now takes the configuration from the command line.
I’ve also removed the Write node, so you can write to different files.

You can now call it like the following:

gpt.exe PREPROCESS_beamdimap.xml -t “C:\Output_Data\bandmath_beam.dim” “C:\Input_Data\TSX-1.SAR.L1B\TSX1_SAR__EEC_RE___SC_S_SRA_20140910T011220_20140910T011231\TSX1_SAR__EEC_RE___SC_S_SRA_20140910T011220_20140910T011231.xml”

PREPROCESS_beamdimap.xml (2.7 KB)


hey thanks a lot for this i had to do a similar process for sentinel data as well with a few additions, so i tried editing the graph comparing it to the one you sent but it gives me the following error
only whitespace content allowed before start tag and not \uef (position: START_DOCUMENT seen \uef… @1:1)
im attaching the graph for xml as well
and the code i run is
gpt.exe C:\Input_Data\sentinalnew.xml -t “C:\Output_Data\bandmath_beam.tif” "C:\Input_Data\"sentinalnew.xml (4.5 KB)

and another thing can you also guide me if instead of giving the whole path and name of the source i have previously stored it in a variable and i have to pass that variable with the command then what changes do i have to make to the calibration node to take source from variable
for example the XML file for TerraSAR-X is stored in a powers shell variable $TSX_DATA
i tried the command gpt.exe C:\Input_Data\PREPROCESS_beamdimap.xml -t “C:\Output_Data\bandmath_beam.tif” “TSX_DATA” and i get the error [NodeId: ReadOp@sourceProduct] No product reader found for file TSX_DATA
and if i run the command gpt.exe C:\Input_Data\PREPROCESS_beamdimap.xml -t “C:\Output_Data\bandmath_beam.tif” “$TSX_DATA” i get the error
Error: [NodeId: ReadOp@sourceProduct]

The sentinalnew.xml looks good. Can’t see an error.
maybe the path to the external DEM doesn’t work.
Try replacing \ by /
But this does not fit to the error message.

And I’m not sure if the Sentinel-1 reader can handle the case if the parent directory does not have the name of the product.
Actually it should be like this:

Regarding the batch processing I suggest you read this wiki page:
It was originally written for BEAM, but in general it is still valid.

1 Like

if i need the output in ENVI format for the first graph PREPROCESS_beamdimap that you edited for me i run the following
gpt.exe Desktop\PREPROCESS_beamdimap.xml -t “C:\Output_Data\TSX_SAR_Cal_Spk_SpkBandMath.hdr” “C:\Input_Data\TSX-1.SAR.L1B\TSX1_SAR__EEC_RE___SC_S_SRA_20140910T011231_20140910T011242\TSX1_SAR__EEC_RE___SC_S_SRA_20140910T011231_20140910T011242.xml”
i get the error Not able to write product file: ‘C:\Output_Data\TSX_SAR_Cal_Spk_SpkBandMath.hdr’
and another graph that only reads a tif file and converts it to envi fromat how do i run that graph this graph is attached geotoENVI.xml (919 Bytes)

I’m not sure about the ‘Not able to write product file’ error. Actually, I would have thought that BEAM-DIMAP is written. Maybe it works if you specify “-f ENVI” in addition. If no format is specified BEAM-DIMAP is used as default.
The graph you have attached can just be run as

gpt geotoEnvi.xml
And if you want to let it run with other products you can provide the paths to source and target as parameters. Please note that I have used -P, and not -S
geotoENVI_modified.xml (1012 Bytes)

1 Like

i run the geotoENVI_modified but with the same source and target file like you have written in the comment it runs the file but doesnt create the output in the folder
any idea why that could be

Then there should be actually an error message. Is the process terminating silently?

yes its terminating silently

I get an error message.

It shows me that I either need to edit the xml file and change targetpath to targetPath or I change the command line and use -Ptargetpath
After the change it works.

Hello, could you please check the attached xml. I try to mask clouds + cloud shadows from every S2 bands and write them to a new product using this xml, but I get the following error:

mask.xml (4.1 KB)

Good that you have been able to fix it.

I am not sure. But same error appears when I try .xml file made in linux environment to process data in windows.