Can I operate on Sentinel 1 data using python?

I am working with SNAP and trying to read Sentinel 1 images to SNAP from python and not getting it done. If anyone could help.

If for some reasons, you cannot use the snappy interface ( https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface), you can use the spectral library to read ENVI files contained in the BEAM-DIMAP folders (where you have your img/hdr files) : http://www.spectralpython.net/fileio.html#envi-headers

import spectral.io.envi as envi
lib = envi.open('yourImage.hdr')

Careful that this last command gives you an array of images (a tensor). If you want just one the image as a matrix, use

lib = envi.open('yourImage.hdr')[:,:,0]
1 Like