Hi.
I’m quite new to SNAP and I have an issue regarding gpt.
How to apply user defined operation on multiple cropped sentinel 2 images using gpt script?
Here is the process:
I have ~200 sentinel-2 images (.zip files).
I cropped each one of them using gpt Subset script (=area of interest). And got .dim and .data files for each image.
I want to apply an operation on each of the cropped images (.dim files) that is not included in the gpt operations (=my operation is: Biological Crust Index = 1 - (RED-BLUE)/(RED+BLUE) ).
For this I used band-math and saved the xml file named “CrustIndex.xml”.
I want to apply this new operation=CrustIndex.xml in a gpt script that will go through all ~200 sentinel-2 cropped images (.dim files). How can I do it? What should I change in the “CrustIndex.xml” file?
*** Here is the relevant part in my script which is not working yet (f=the cropped .dim file, target=t=.tif file): ./gpt CrustIndex.xml -Pfile=<dollar_sign>f -t <dollar_sign>{DIR}/${name}.tif
*** What should I write in the CrustIndex.xml file between the of the “read” and “write” part?
How you can do batch processing is explained on this wiki page: Bulk Processing with GPT - SNAP Wiki
You can use the BandMath op to define your operation
when I try your Bandmaths first, it not works. I want calibration first, resample 20m and c2rcc. actually, resample and c2rcc, it works well. but I try put the bandmaths, it not work well. could you give a hand? thanks
Could you tell us what you are trying to obtain? Why do you apply factors to the bands? What is the idea behind this calibration? Have to tried first in the GUI?
the satellite sentinel2 should calibration at first. because the band and response of sensor after the launch, it will be a little bit changed (April 2020 sentinel2 report). so why should calibration. thanks
of course, GUI must be works.
Correct me if I am wrong, but the calibration procedure is done before calculating TOA reflectances. I do not think you need to apply those factors to the L1C product.
the other atmospheric correction like (seaDAS polymer acolite), they could setup the vrcarious calibration. so did SNAP has any setup? or use “BandMath”? thanks
Hello
II’m sorry @marpet - I didn’t see your request.
Vicarious calibration of Sentinel-2 is undertaken as part of the monitoring activities of the Mission. It is carried out by ESL (Expert Support Labs) that report every week to ESA on the status of the instrument. The radiometric calibration of the instruments is undertaken monthly, and lead to the release of updated Absolute Calibration and On Ground Equalisation GIPPs that are assimilated into PDGS processing every month (we will be releasing the April GIPPs shortly, for entry into production on Tuesday morning).
Thus, the instruments are already calibrated prior to production of data.
our cluster changed. so now we use the SLURM workload manager. The code run very well ago. but now it get the error, detail below. Could you give me a hand? thanks
This sounds like the process does not have write privileges to /home/bjiang/.snap/product-library.
But I don’t know your system and can’t tell you what’s wrong.
Maybe @oana_hogoiu has an idea what could be wrong.
when i install “SNAP” software, the error :“an instance of the program cannot access specified user directory. This is a serious problem that prevent the program to function properly. make sure home/bjiang/.snap/system is writable. click ok to continue in spite of previous error”. thanks. it looks like not install successful. Could you help me ?