Subsetting with Batch Processing

Hello everyone,

I am using SNAP for batch processing hundreds of ENVISAT ASAR WSM images. Processing goes fine up until I try and subset the images to within the study region of interest (images would be too large otherwise). Here’s where I run into problems. I add subset to my graph, and specify the geo coordinates of my study region. Looks correct in the preview (the little map they provide with a box), but the outputs are skewed and don’t fall entirely within my study region.

I did a bit of searching on this forum and saw that you can mask the processed data with shapefiles using the land sea mask. Individually, this works great. However, I have hundreds more images to go through, and when I add that tool to the graph for batch processing, the option to add the vector glitches out. The drop-down section where you would select the shapefile for the mask is unusable.

Has anyone else had this problem? I’ve been so far exporting the entire images as GeoTiffs and masking them using R, but it’s a nightmare because of how slow R is with large raster files. If anyone has any advice, I would greatly appreciate it!

Thank you for your time

1 Like

Digitizing a Vector and adding it as a WKT in the subset operator of the graph builder worked for me.
You can create WKTs here:
https://arthur-e.github.io/Wicket/sandbox-gmaps3.html

Thank you for the advice, I have tried that and while the box looks correct in preview, the output image is different. It aligns with other data in a GIS perfectly, but the extent of the raster goes outside the boundaries of the shapefile I used to create the WKT. Am I overlooking something with regards to the CRS I’m selecting?

1 Like

Is the subsetting performed on slant range data? Their geolocation is often not very precise. This could explain the observed shift.

Yes it is slant range data. Is there a work around to this, or should I subset it using some other program?

is subsetting after terrain correction an option?

Unfortunately it is not an option because the imagery is not confined to a frame/path and each image contains my study area in different parts of the image. I need to terrain correct it first to subset it by geo coordinates so that each output image is exactly the same in terms of study area.

now I am confused. Did you subset before Terrain correction or afterwards?
Even if the images are of different frames, the lesser should be possible. I just think the subset could be geometrically more correct if you use it on the geocoded and terrain corrected image.

Sorry for the confusion, I subset after terrain correction. The reason I don’t subset before is because I’m working with images that are not exactly the same. The study area in one image could be in the top left, in another image the bottom right. Therefore I can’t identify an area to subset prior to terrain correction. It’s only after I terrain correct all the images that the study area is in the same location for subsetting.

Then I have no explanation for the shifts.
You could coregister the tc outputs and then subset the whole stack

I have searched elsewhere and found that the slant-range quality of data complicates subsetting in snap. I may just stick with exporting the entire terrain corrected images as a geotiff and using R to mask them within the shapefiles, which has been working, albeit sluggishly. I was mainly hoping to find a more efficient way of accomplishing this. All the same, thank you for your time and advice.

Have you found a more efficient way of accomplishing this? I have met the same questions when I am doing the SBAS. There are so many S1A products, it must be very time-consuming. So focusing my study area may be atime-saving. Thanks

subsetting with a graph file is not an option? If the extents are not precise I would just choose an area which is a bit larger so you don’t miss an important part.

Hi Andreas, how did you add WKT in subset operator?

you can create one here https://arthur-e.github.io/Wicket/sandbox-gmaps3.html (or export it from a GIS) and then switch to “Geo Coordinates” in the subset operator. Enter the full string there and use the magnifying glass to check if is correct.

Thanks Andrea… it is working… but must a rectangle or square, not complex polygon…

yes, the subset is always a rectangle, unfortunately.