Issue Extracting Numpy Array from Sentinel-1 GRD Image


I am stuck on what feels like should be simple task. I am following the documentation here:

and trying to follow the first contact step to get a numpy array from a S1 grd image.

p = ProductIO.readProduct(‘C:/Users/f72w381/Downloads/S1B_IW_GRDH_1SDV_20201012T012004_20201012T012029_023773_02D2C9_779C.SAFE/’)

rad13 = p.getBand(‘Intensity_VV’)
w = rad13.getRasterWidth()
h = rad13.getRasterHeight()
rad13_data = np.zeros(w * h, np.float32)
rad13.readPixels(0, 0, w, h, rad13_data)
rad13_data.shape = h, w
imgplot = plt.imshow(rad13_data)

This returns a numpy array still filled with zeros.

Things I have tried:

  1. trying with the zipped and unzipped files.

  2. exporting p as a GeoTiffs and BEAM-DIM fomats and trying with those formats.

  3. Performing the extraction for just a single line of pixels

  4. Checking the grd image in snap desktop to be sure it actually has values in it

  5. Trying with the other bands

What am I missing?

First, does the “First Contact” script work using MER_FRS_L1B_SUBSET.dim? Then, have a look at Preprocessing Sentinel 1 SAR Data using snappy, which mentions converting DN to Sigma Nought or Decibels.

It did work with the test visual image. I will check out that link and see if I need to convert first. Thanks!

I followed that documentation and converted to Sigma Nought and subset the image to a smaller portion in case it was a memory issue. No luck. All the images appear fine in the SNAP desktop, but still just getting an array of zeros.

Had to covert to dBs first to get the plot to appear.