I want to do terrain correction for both band , but the result : dimap - .data - IMG file were written about 32 M,beside , during the python run, the time of IMG that be modified is keeping change…
filename = “/home/snapws/s1_p/S1_data/S1A_IW_GRDH_1SDV_20160611T222046_20160611T222112_011669_011DDC_7FB0.zip”
sentinel_1 = ProductIO.readProduct(filename)
polarization = “VH,VV”
def do_calibration(source, polarization):
parameters = HashMap()
parameters.put(‘sourceBands’, ‘Intensity_VH,Intensity_VV,’)
parameters.put(‘selectedPolarisations’, polarization)
target_0 = GPF.createProduct(“Calibration”, parameters, source)
return target_0
def do_speckle_filtering(source):
parameters = HashMap()
parameters.put(‘sourceBandNames’, “Sigma0_VH,Sigma0_VV”)
parameters.put('filter', 'Refined Lee')
parameters.put('outputImageInComplex', True)
output = GPF.createProduct('Speckle-Filter', parameters, source)
return output
def do_terrain_correction(source, crs):
parameters = HashMap()
parameters.put(‘demName’, ‘ASTER 1Sec GDEM’)
parameters.put(‘imgResamplingMethod’, ‘BILINEAR_INTERPOLATION’)
parameters.put(‘incidenceAngleForSigma0’, ‘Use incidence angle from Ellipsoid’)
parameters.put(‘mapProjection’, crs)
parameters.put(‘pixelSpacingInMeter’, 150.0)
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())
ProductIO.writeProduct(tercorrected,opath+tercorrected.getName()+‘final.dim’, ‘BEAM-DIMAP’)
sentinel_1.dispose()
sentinel_1.closeIO()
loopendtime=str(datetime.datetime.now())