Simple conversion from .SAFE to GeoTiff

Hello everyone,

I’m trying to do a quite simple thing with S1 images, I thought it would be rather easy but it seems I can’t manage to succeed. It’s the first time that I’m using SNAP.

I have downloaded S1 images from the Copernicus website. Everything is in .SAFE format. My personal code is using Gdal and perfectly works with GeoTiff images, and so I’m trying to achieve a simple conversion from .SAFE to GeoTiff.

I have tried exporting it in GeoTiff, or to BEAM-DIMAP then GeoTiff, I also tried to apply a range correction then exporting in GeoTiff. I successfully obtain a .tiff image but completely black (even if not empty ~800Mo).

Maybe I didn’t select correctly a specific band.

Also, can this operation be done directly in loop from shell?

Thanks a lot,

if your intention is to use the TIF in a GIS you should include some pre-processing for your data because it is not projected yet. Also, the S1 data contains two rasters which probably work best as GeoTiffs when they are exported separately.

Have a look at the Range Doppler Terrain Correction module. Run it in SNAP to see what it does and then call it from the command line: gpt Terrain-Correction -h

I have already tried the Range Doppler Correction module to export in GeoTiff (the data is too big for this format) and in BigTiff (it runs indefinitely).

I can also write it first in BEAM- DIMAP but I always end up with a black image in GeoTiff or as below in BEAM- DIMAP.

Could you explain a bit more about the gpt command. Neither SNAP or the shell knows it.

To call gpt from your command line you need to add the directory where it is installed to your system’s path variable

You just enter gpt and the module of your choice add “-h” and you get all required parameters listed.

Maybe you should first Terrain Correct to BEAM DIMAP and the use the “Convert datatype” module to write a GeoTIFF as Unsigned Integer 16 to get a proper result. That, however, changes your values to a different colour scale.

Maybe I am stating something obvious, but the Sentinel-1 Level 1 GRD and SLC products in SAFE format do present the image data in Geotiff format. The images are in the measurement folder, and are described in the Sentinel-1 Product Specification document.

The images are in the radar geometry (azimuth by range). With the GCP in the Geotiffs you can reproject the images, but that reprojection may not be as accurate as you need it to be. For a more accurate reprojection (and for other pre-processing steps like calibration) you need to use metadata that is elsewhere in the SAFE directory structure. SNAP can do that, but its output will no longer be in SAFE format. I don’t know how that output can be converted back to Geotiff.

1 Like

Thanks a lot ! It wasn’t obvious at all, but as you said these GeoTiff images are not accurately projected. I can’t use it in my code.

I think the solution is as ABraun said to apply the Terrain correction, which is what I’m trying to do. The issue I’m facing and that explain why it runs indefinitely is that the DEM AutoDownload doesn’t work.

I get this message :

SEVERE: org.esa.snap.core.dataop.dem.ElevationFile: Connection refused
INFO: org.esa.snap.core.dataop.dem.ElevationFile: http retrieving

I did download it myself from the given link to unzip it in its DEM repertory .snap/auxdata/dem/ACE2_5Min. Is still get that message.

SEVERE: org.esa.snap.core.dataop.dem.ElevationFile: Connection refused
INFO: org.esa.snap.core.dataop.dem.ElevationFile: http retrieving

And from the SNAP framework I get a infinite loop.

Do you have any idea what’s the matter I’m facing?

do you have writing permissions for that folder? Maybe the firewall blocks it. You can try another DEM source, SRTM 90m, for example.

1 Like

It was, indeed the FireWall that was blocking the autodownload of the DEM and creating a infinite loop.

I see the benefits of working on SNAP from the shell. You get information on what is happening.

SRTM is not available for the high latitudes I’m working on but i downloaded manually ACE2_5min, it works fine.

Thanks a lot for your help.