Sentinel-1 GRD image processing with snappy

I am trying to process sentinel-1 GRD image using snappy.
order of steps:
1. orbit file
2. calibrate
3. speckle
4. terrain-correction
First three processes are working well. But after terrain correction, i am getting NaN values in each pixel using the following code:

calibration = ProductIO.readProduct(calib + “.dim”)
parameters = HashMap()
parameters.put(‘filter’, ‘Lee’)
parameters.put(‘filterSizeX’, 5)
parameters.put(‘filterSizeY’, 5)
parameters.put(‘sourceBands’, ‘Sigma0_’ + polarization)
spk_img=output + date + polarization + “SPK
target_1=GPF.createProduct(‘Speckle-Filter’, parameters, calibration)
ProductIO.writeProduct(target_1, spk_img, ‘BEAM-DIMAP’)

spk_img_1 = ProductIO.readProduct(spk_img + ".dim") 
parameters = HashMap()
parameters.put('mapProjection', proj)
parameters.put('demResamplingMethod', 'NEAREST_NEIGHBOUR') 
parameters.put('imgResamplingMethod', 'NEAREST_NEIGHBOUR') 
parameters.put('demName', 'SRTM 3Sec') 
parameters.put('pixelSpacingInMeter', 20.0) 
parameters.put('sourceBands', 'Sigma0_' + polarization)

terrain = output + date + "_corrected_" + polarization 
target_2 = GPF.createProduct("Terrain-Correction", parameters,spk_img_1 ) 
ProductIO.writeProduct(target_2, terrain, 'BEAM-DIMAP')

Please suggest the solution.