How can I built a graph (to use later on batch processing) for the following:
I have downloaded tiles from each band for Sentinel 2 (lets say Bands 2, 3,4 and 8). In order to make it easier to analyse the data later (i.e. to create a big mosaic with several of these tiles).
Question 1) The best approach would be to start by putting all these bands in one single product – right?
Question 2) I know how to do it for each tile (i.e. putting bands 3,4 and 8 in the same product of the band 2, through Maths Band operation), but I would like to speed up this process. Lets say I want to create a mosaic of 4 tiles, I would like to first to create a graph so I could apply this to every single tile, before making a mosaic with them (does it make sense for you?
Question 2) How can I create this graph? Has anyone done it? Or you found it simpler to follow another approach?
I had in mind something like this:
Each band will “feed” the BandMaths operations, but when I want to edit expression in BandMaths, I cannot access the bands from both files. In fact in my first case (Read [Band2] and Read3 [Band3] feeding BandMath) I get this:
I also tried out, to connect the Read3 to another Read (wich doesnt’t even make sense I guess:
Still not working…
Question 3) - would you recommend (if it is not possible to do what I had in mind), to simply try to get the whole products instead of downloading the bands separately? And then, from there go for Merging or Mosaicing afterwards?..
First of all, don’t connect the output of something to a reader. It should only be a source and don’t connect the writer as a source to something else. It should only be a sink.
I should add some error checking to prevent this.
I’m not sure what you’re trying to do but, have you tried the Collocate operator or possibly CreateStack?
Dear @lveci thank you very much for your quick response.
That leads me to another question (I have tried to find the answer in tutorials but wasn’t able to find one).
What is the difference, or could you provide a sentence describing each of these things:
(All of course applied to this context). I would be quite grateful!!
(Or if you could suggest where I can read/learn about it).
(P.S.: I will try to collocate & Creatstack, it will also probably give me the answer to the question I made you, once I explore the results)
Collocation is resampling from one coordinate system to another. It depends on the georeferencing of the products.
CreateStack does mostly the same but takes into account special handling for SAR products in particular as the first step in coregistration.
Merging I’m not to sure about myself. BandMerge may be what you’re looking for. It should copy the bands from one product to another without resampling just assuming they are the same dimensions and for the same geocoding.
If I understand you correctly, you intend to layer stack 2,3,4 and 8th band of Sentinel 2A as a standard FCC composite. For that to create you would need to use “Product Set-Reader” instead of “Read” and then you can select multiple bands in it. Then you go on to select band merge and write the file.
I have attached the graph model and you can import it in your SNAP’s graph builder.
Hope it works for you.
AUM!Band_Merge.xml (1.3 KB)
Using the full product is what I would recommend. If you simply use the jpeg files you don’t have access to several ancillary information, like the view angles. Also you have to apply the QUANTIFICATION_VALUES to get reflectance values.
However, the graph @rohit_chhimwal provided will do what you want.
An other option would be this graph
However, @lveci while testing this I noticed that the “Save as”-Checkbox has no effect. If I deselect it the data is stored anyway. Do we know this already?