SNAP command line

I am trying to install snap with command line. Already installed esa-snap_sentinel_unix_8_0.sh, but got error as below. Please, help me I am stuck! Should I Delete only SNAP-internal configuration data? Thanks in advance.

./esa-snap_sentinel_unix_8_0.sh
Unpacking JRE …
tar: jre/lib/amd64/libfreetype.so: Cannot utime: No such file or directory
tar: man/ja: Cannot utime: No such file or directory
tar: Exiting with failure status due to previous errors
Starting Installer …
This will install ESA SNAP on your computer.
OK [o, Enter], Cancel [c]
o
Click Next to continue, or Cancel to exit Setup.
Delete SNAP’s configuration data and user settings?
The installer detected SNAP user data directories from a previous
installation. These directories contain system file used by the application
and also stored graphs, RGB profiles or other auxiliary data. The data
stored in these directories might not be compatible with this new SNAP
version anymore.

Shall the installer try to remove these directories?
Yes, try deleting all SNAP user data [1], Delete only SNAP-internal configuration data (recommended). [2, Enter]

If you haven’t stored important personal data in the user directory (/home/username/.snap) then you can chose option [1] and delete all SNAP user data. In this directory are RGB profiles, colour palettes and graphs stored by default. otherwise it is more safe to go with option [2]

1 Like

thanks, I could solve the problem. But I have another question, in gui snap it is easy to open the file calibrate it and do other process, now I can not understand how to process my files with the command line and why we need xml file for? Please, can you explain it and share some examples (ex, I need to calibrate S1 file called S1A_IW_GRDH_1SDV_20180220T165225_20180220T165250_020693_023723_FB7D.SAFE.zip).

You need the XML files because you need a place for all the configuration parameters.
A general introduction to processing with gpt on the command line, is given by this wiki page:
Bulk Processing with GPT - SNAP Wiki

You can also create graphs and process data within the GUI. The Graph Builder respectively the Batch Processing tool can be used for this.

Within the Graph Builder you find example graphs. For Calibrating it is simple (Graphs / Radar / Standard Graphs / Calibrate). It is just the Calibrate operator.
This single operator can also be used without an XML file.

Example call:
gpt Calibration -PauxFile="Product Auxiliary File" -PselectedPolarisations=VH,VV -PcreateBetaBand=true -PoutputSigmaBand=true -t <output_path> <source_path>
But if you use multiple operators you need to connect them. For defining this graph of operators the XML file is needed too.

For some further hints have also a look at our tutorial page. The general SNAP section might be of interest for you and also the S1TBX section.

2 Likes

thanks a lot, your answer helped me. I am trying to try with xml file now for calibration, but struggling what to write to ${source} in node id = cal. Below is shown. Can you please check it?

<graph id="calibration">
    <version>1.0</version>
    <node id="cal">
        <operator>Calibration</operator>
        <sources>
            <source>${source}</source>
        </sources>
        <parameters>
            <auxFile>Product Auxiliary File</auxFile>
            <externalAuxFile>file</externalAuxFile>
            <outputImageInComplex>boolean</outputImageInComplex>
            <outputImageScaleInDb>boolean</outputImageScaleInDb>
            <createGammaBand>boolean</createGammaBand>
            <createBetaBand>true</createBetaBand>
            <selectedPolarisations>VH,VV</selectedPolarisations>
            <outputSigmaBand>true</outputSigmaBand>
            <outputGammaBand>boolean</outputGammaBand>
            <outputBetaBand>boolean</outputBetaBand>
            <outputDNBand>boolean</outputDNBand>
        </parameters>
    </node>
</graph>

This should work if you specify the path to your source product like:
-Ssource=<source_path>