Is it possible to use GPT without doing a full installation of SNAP? I.e. would it be possible to save a copy of the SNAP software (including GPT) in a folder and run gpt.exe from the command line, without running a full installation?
We are trying to incorporate Sentinel image processing in a larger monitoring and forecasting system, which runs on many different Windows forecasting shells. We want to avoid having to do separate manual installations on each forecasting shell, and simplify future SNAP version updates. All other software packages we’re working with can simply be saved and executed from a folder (no other installation steps required). Is there a similar option for GPT? We only need the GPT command line functionality, not the full SNAP user interface.
with each installation also the Desktop is installed, but this whould not be a big problem fpr your use case. It costs just a few megabytes of disk space. With the desktop modules comes also the ability to update SNAP via the command line. So there are also benefits.
I guess your use case can be solved by copying two directories to each forecasting shell.
I assume that a forecasting shell is a node in a cluster, right?
Do you use special plugins which you need to install manually and which are not on the SNAP repository?
If not the, following approach is probabyl the easiest. Your forecasting shells need internet access.
The steps you need to do would be:
@marpet, thanks for the quick response! It seems to be working, except for an issue related to the version…
Here’s what I did:
I copied the snap installation folder (in Program Files) to another folder (part of the forecasting framework), and adjusted the path to the newly-located gpt.exe.
I uninstalled SNAP using the Windows uninstaller. I confirmed that the snap installation folder and “C:\Users\USER.snap” folder were removed.
I ran the GPT script from the forecasting framework, and it processed without errors and produced an output NetCDF file, as expected.
However, I am now once again getting an old error when I try to use the NetCDF – the lat/lon variables in the NetCDF have not been subset, while the image data has been subset correctly. I saw this previously and solved it by updated to the latest version of SNAP at the time (7.0.3). (Write to NetCDF4-CF combined with subset produces invalid NetCDF file)
Is it possible that I have somehow reverted to an older version of SNAP when I copied/moved the “snap” folder and ran GPT from there? In the “snap” folder is a file called “VERSION” which states that it is version 7.0. However, before I copied the “snap” folder and uninstalled SNAP, I can confirm that the SNAP Desktop said I was using 7.0.3 (which had solved the NetCDF dimension issues).
Should I have copied something else, in addition to the “Program Files\snap” folder to make sure I’m using version 7.0.3?
I think you missed to copy the <USER_DIR>\AppData\Roaming\SNAP directory which contains the updated modules.
Depending on your environemnt it is now best to Install SNAP again, update it and afterwards take the above mentioned directory.
Alternatively you can follow update SNAP via the command line (the link in the previos post was wrong) and update you copied instance.
This is the command you need to execute:
snap --nosplash --nogui --modules --update-all
The Version.txt files you mentioned, contains only the version of the major release comming with the installer.
Ah, indeed - it seems to be working now. I thought I only needed to copy the Roaming\SNAP folder for special plugins/modules (what we are doing is quite standard, I think). But now I understand that software updates (between major versions) are also saved in that folder.
For anyone else who may need to do this: I also first had to “show hidden files and folders” to find the AppData folder - I initially thought it did not exist.
Is it a requirement to store it at this path: AppData\Roaming\SNAP? Is it possible to save this somewhere else (e.g. next to the main snap installation folder)?