Hi completely new to this, was wondering if anyone could point me to any links or documentation for a complete beginner or send me some sample scripts. Trying to use command line to create calibrated, terrain corrected geotiff’s from sentinel 1 a zipped data products.
Note there is a short intro in the SNAP help system.
I agree that we urgently need such a beginners and expert guide: https://senbox.atlassian.net/browse/SNAP-306
Maybe this is of some help: The shortest version is that you create a graph file in SNAP using the Graph Builder and save it as xml-file, some examples of such files are here:
For the way I do it, you have to modify these files saved from the Graph Builder:
- At the moment the nodes need to be in the order of processing in the xml file (even though they reference to each other).
- Remove any write node since the -t option in gpt is used
- in the read node define the input variable like here
https://github.com/npolar/RemoteSensing/blob/master/SNAP/Calib_Spk_TC25m_LinDB_EPSG3031.xml#L6-L8
Now you can call gpt from command line like, this, -Pfile means that “$file” in the xml file is replaced by the inputfilename:
gpt full_path_to_xml_file -Pfile="inputfile" -t "outputfile"
To process large quantities of data, I produce the command above as a string using Python and pass it to command line with os.system. You can also do this with Matlab and others…
Hi Max, I have very similar problem.
Could have a look at my question please ?
I would really appreciate it.
Many Thanks,
Ishack
Hi Ishackm,
I would recommend providing gpt with a parameter file: https://senbox.atlassian.net/wiki/spaces/SNAP/pages/70503475/Bulk+Processing+with+GPT
Effectively, you will open your .xml graph file and replace file paths (or whatever other parameters you wan to provide) with ${variableName} and then within your parameter file, you will do
variableName=/this/is/my/path/to/my/s1product.dim
and then you can call gpt like so:
gpt my_processinggraph.xml -p myparameterfile.txt
Then you can just have a folder of these parameter files and do a loop like this (this is a bash shell loop, but you can do similar things on powershell or cmd on windows) :
for a in *.txt
do
gpt mygraph.xml -p $a
done
Hope that helps!
NASA’s Introduction to gpt has some nice examples using an older version of gpt. Note that NASA has been renaming files, so it may be necessary to adjust some file names.