Dear all,
I am pretty new in the forum and in the SAR topic and need some help here. I am trying to process the following product:
S1A_EW_GRDM_1SDH_20170222T082410_20170222T082510_015394_01942C_945D.SAFE
My Regions Of Interest (ROI) are mainly polar regions where there is no DEM available. Usually those ROIs contain only ocean or is a mixture of ocean and land. I would like to perform the following process:
1 Radiometric correction
2 Speckle filter
3 Terrain correction
4 Mosaicking
(Please let me know at this point if more process needs to be done for the GRD products)
As far as I understand Terrain correction should do also a re-projection to a targeted CRS? My problem is that I am not sure what I miss to perform a correct Terrain correction or/and re-projection. Here is the code:
import snappy
from snappy import ProductIO
from snappy import HashMap
import os
from snappy import GPF
from pyproj import Proj
import osgeo.osr
filename = S1A_EW_GRDM_1SDH_20170222T082410_20170222T082510_015394_01942C_945D.SAFE
sentinel_1 = ProductIO.readProduct(filename + "/manifest.safe")
proj4str = "+proj={0} +lat_0={1} +lon_0={2} " \
"+lat_ts={3} +ellps={4} +datum={5} +units={6} " \
"+lon_wrap={7}".format("stere",85,47,85,"WGS84","WGS84","m",0)
srsproj4 = Proj(proj4str)
srs = osgeo.osr.SpatialReference()
srs.ImportFromProj4(srsproj4.srs)
polarization = 'HH'
def do_calibration(source, polarization):
"""
radiometric calibration
"""
parameters = HashMap()
parameters.put('outputSigmaBand', True)
parameters.put('sourceBands', 'Intensity_' + polarization)
parameters.put('selectedPolarisations', polarization)
parameters.put('outputImageScaleInDb', False)
calib = output + date + "_calibrate_" + polarization
target_0 = GPF.createProduct("Calibration", parameters, source)
return target_0
def do_speckle_filtering(source):
parameters = HashMap()
parameters.put('sourceBandNames', 'Sigma0_HH')
parameters.put('filter', 'Refined Lee')
output = GPF.createProduct('Speckle-Filter', parameters, source)
return output
def do_terrain_correction(source, crs):
parameters = HashMap()
parameters.put('PdemName', 'ASTER 1Sec GDEM')
parameters.put('imgResamplingMethod', 'BILINEAR_INTERPOLATION')
parameters.put('incidenceAngleForSigma0', 'Use incidence angle from Ellipsoid')
parameters.put('PmapProjection', crs)
output = GPF.createProduct('Terrain-Correction', parameters, source)
return output
calibrated = do_calibration(sentinel_1, polarization)
filtered = do_speckle_filtering(calibrated)
tercorrected = do_terrain_correction(filtered, srs.ExportToWkt())
The error i am having is:
RuntimeError: org.esa.snap.core.gpf.OperatorException: Entire image is outside of SRTM valid area.
Please use another DEM.
It seems that I can not change the default SRTM DEM. From what I read the ASTER DEM extends up to polar regions which might can be used for my studies.
Could you please help me either to see what I am doing wrong here or, to provide me with a more appropriate method to deal with that? I aim to perform an image enhancement and then to build a mosaic with SAR images.
Many thanks in advance for your time.