Hi, I am rather new to using snap and I think this is a basic question on using SNAP: How do I apply the same band math expression to certain bands of a product at once? how do I apply the same operation on the same bands of another product. I am looking for a fast way to do easy repetitive tasks. I would rather use the UI (e.g. graphbuilder) but if not possible what python script would work for this?
What you want to do is not possible in the UI. We have it on our todo list, but we did not get so far.
Once we had a scripting console but we removed it because it wasn’t mature enough. We think about to get this back and further improve it.
You can write python scripts. After installing snappy you will find some examples in the snappy folder.
The following post might be of interest for you.
I am using Band math in Sentinel 2B to calculate NDVI. It is a dimensionles quantity. So, should I leave the ‘Unit’ box or enter it with some unit? I am asking this because leaving the unit box empty in case of Sentinel 1 was interfering with the calibration.
The expression is correct, but you need to resample the S2 data first. Use the S2 Resampling (Optical/Geometric/S2 Resampling) operation. But you don’t need to use Band maths for converting reflectances to radiances. You can use the dedicated operator.
It is located in the menu at Optical/Thematic Land Processing/Reflectance to Radiance, but you need to resample first too.
@obarrilero Is it correct that it is located in the Land menu? I would expect it in the Preprocessing section.
To select the resolution is up to you and depends on your application.
In order to investigate the error, can you tell how you have configured the processor? In addition could you attach the log file please? You can find it by selecting from the menu Help / Show Log Directory. Make sure to reproduce the error first and then attach the messages.log file.
Thanks
@obarrilero Can you check what is wrong with the processor or the configuration?
I have just tested with a resolution of 10 m and it has worked properly with version 6. I have resampled by using S2Resampling Processor and then I have used the ReflectanceToRadiance processor for getting the radiance of B3.
@Marco, yes, I agree that we should change the location to the Preprocessing section. @tarun25389 Please, could you tell us exactly what is your processing configuration to try to reproduce the error? On the other hand, the solar irradiance of 1512.9 is for B4. If you have looked in the metadata file to get it, the bandId is not the band name:
Sorry, I meant the processing parameters that you select when running the operators.
It seems that you have not selected any band when converting to radiance or that SNAP is not reading properly your input file. Please, could you tell me which is your input for downloading it and test it?
I have just seen that old products do not contain some tags in the metadata that are used by the Reflectance2Radiance processor. We will try to fix it in the next module update. Meanwhile, you have 2 options:
To use the band operator as you commented before (please, check that you are using the good irradiance value as commented before)
To use the Reflectance2Radiance operator: in this case you have to change the product type just before launching the processor: right-click on the product -> Properties and in “Product type” you have to change the name to something that does not start with “S2_MSI_”. After that, when you open the processor, you can introduce manually the irradiance and U value (you should maintain the incidence angle 0 in order to use the internal angle band)
Thank you @obarrilero, I am trying your suggestions, its taking lot of time to process after changing the parameters as you mentioned. is this how it normally happens?