Subset several images on a same area

Hello,

I would like to subset several radar images on a same area while making sure they will all have the same size (same number of rows and columns).
The problem is that the images are obtained from different passes thus not covering exactly the same percentage of the area of interest. Usually, it is possible to add NoData on the subsetted raster then obtain the exact footprint of each radar image.

Do you know if this functionality is existing on SNAP ?

Many thanks for your answer,

Kind regards,

Caroline

I would create a subset of you area first and then coregister all the other products to this subset using the master (subset) extents.

Dear Iveci,

Thank you very much for your answer.
I have tried this technique using “Automatic coregistration” from Coregistration tol in the Radar menu. Unfortunately, it doesn’t seem to work. I did some ellipsoid correction (GG) prior to this, then subsetted one image and put it as the master for all the stack.
I obtain a stack without error but when I try opening the products, there are no data encripted (even though you can see the coordinated when moving the cursor over the supposed area filled with data). Do you know what happens ? Could you detail the operation more precisely ?

Many thanks,

Kind regards,

Caroline

I am also having this question…

I have several S2 images, that I would like to subset all to the same area, and after processing and do everthing I want with them, I would like also to subset S1 data, for the same location/area.

But to beggin with , I don’t know how to do it with the S2:

  1. I tried with graph builder in order to apply always the same ‘cut’, but it did not work
  2. I can do, all one by one, but isn’t there a simples way of doing it?

Thanks!

1 Like

I think first of all if you are not interested in the whole image then before starts to think in subset, why you don’t try out sub swath in case of IW, S1 A\B, and then apply orbit file and then corregistration and then subset, to reach your study area precisely .

But I’m now just focusing on S 2 images for now…

I have no clue about S2 because I didn’t use before, but let tell you personal opinion might be helpful

Try out to find out your study area and then determine the upper left (X, Y ) What ever they are pixels or … and the lower right (X, Y) and apply for all your image and create your new subset.

1 Like

Ok thanks @falahfakhri

For S2 it should be possible to simply use the Subset operator, but you have Resample the S2 data to a common resolution before. To do this, you can use Resample operator. So a graph would have just two nodes node.
See GeoSubsetOfS2.xml
I did not let the graph run. But, in general, it should work. After specifying the geoRegion Parameter.

1 Like

That what I meant exactly as marpet says

1 Like

Thanks for the reply @marpet.
I will give my feedback when possible.

Hi marpet,
how to fill the lat long values for my study area, as it not a rectangle.
POLYGON(( , , …, )

To correct my self.
The graph must be called like

gpt GeoSubsetOfS2.xml -t "G:\EOData\temp\S2Subset.dim" -PsourceFile="G:\S2\S2A_MSIL1C_20160914T074612_N0204_R135_T36JTT_20160914T081456.SAFE\MTD_MSIL1C.xml"

I don’t understand what you want to do.
You product has already geo-coordinates. No need to fill the shape.
You want to extract the coordinates as raster?

Hi marpet,
In georegion we need to specify the bounds of the shapefile. So we need to convert the shape file to WKT format and the provide the values in POLYGON(( , , …, ). The question I was asking you is how to created the bounding values.
Anyways I have solved it by using the qgis plugin which convert the shape file to WKT format.

Subset POLYGON(( , , ..., )

OK, now I got it.
If you have imported the shapefile in the GUI. You can open a image view, display the shapefile and select the geometry. Then do a right-click on the image view and select from the context menu WKT from Geometry

Thanks marpet. wkt from geometry is not highlighting. But when I double click the shape file its details are displayed.

Probably you need to select the selection tool first and then select the geometry. Afterwards the entry in the context menu should be enabled.

Hi,

I would also like to subset several S3 OLCI images to exactly the same area. Some of the images are obtained from different passes and so I haven’t been able to subset the area using the same geo coordinates.
Is there a way to subset S3 OLCI images obtained from different passes to exactly the same area in SNAP?

Many thanks,

Emma

You mean that the result has always the same size regardless how much you area overlaps with the source product?
This is possible but not with the subset operator. This cuts only the overlapping region.

You can create one template product which covers the full area.
This does not need to contain all the data. Just one band is sufficient.
Then you can use the reprojection operator and the option “Use CRS of”
image
Select the reprojected template product here as reference.
This has the downside that the data is reprojected afterwards. Maybe this is what you want at the end anyway?

Another option is to use the collocation operator with the template product.
Here no reprojection is necessary but both, the template and the actual product are merged into one product. If you use a graph, then you can add a subset operation afterwards to remove the band from template product.