WaterMask problem

395 views
Skip to first unread message

Lincoln Olayta

unread,
Nov 24, 2020, 6:33:14 PM11/24/20
to MintPy
Good day everyone,

I encountered a problem upon applying the waterMask.rdr on to the smallbaselineApp workflow;

Here's how I apply it: After running the smallbaselineApp until load-data step only. I download separate swbd file, geocode it using geometryRadar.h5 --geo2rdr, then create a mask yung generate_mask.py, then re-run the whole smallbaselineApp workflow again. (I took it from the watermask generation tutorial https://nbviewer.jupyter.org/github/insarlab/MintPy-tutorial/blob/main/applications/water_mask.ipynb)

previously my method worked fine until I've updated ISCE 2.4.2 and the latest version of MintPy. Now, even though I produced a proper mask for the said timeseries, the smallbaselineApp does not apply the mask.

I've attached the waterMask.rdr, and the smallbaseline.cfg files.

Any help would be appreciated. Thank you!

L.P. Olayta
waterBody&smallbaseline.zip

Lincoln Olayta

unread,
Nov 24, 2020, 7:23:51 PM11/24/20
to MintPy
Nevermind, I have already fixed it. The stacked directory must be deleted of smallbaseline outputs and run the smallbaselineApp from the start with waterMask.rdr included in its settings. 

Ozzy Tirmizi

unread,
Dec 13, 2020, 12:05:36 PM12/13/20
to MintPy
Good morning,

I followed the Jupyter notebook provided in the link above and created a water mask and used view.py to double check it (I'm ending up with waterMask.h5, not waterMask.rdr as stated above). However, when I try to use it as an input for the load_data step, I get the following error:

ValueError: input dataset ['waterMask'] not found in file /media/ozzy/ozzy10tb/InSAR/MintPy/6thRun_downsampled/waterMask.h5

So I used info.py and, as stated in the above error, there is no waterMask attribute so I'm not exactly sure how to proceed with resolving this error. Any suggestions would be appreciated.

Thanks!
Ozzy

(info.py output as follows:)

(mintpy) ozzy@otLinux:/media/ozzy/ozzy10tb/InSAR/MintPy/6thRun_downsampled$ info.py waterMask.h5
******************** Basic File Info ************************
file name: /media/ozzy/ozzy10tb/InSAR/MintPy/6thRun_downsampled/waterMask.h5
file type: mask
coordinates : RADAR

******************** HDF5 File Structure ********************
Attributes in / level:
  DATA_TYPE          int8
  FILE_PATH          /media/ozzy/ozzy10tb/InSAR/MintPy/6thRun_downsampled/waterBody.h5
  FILE_TYPE          mask
  LENGTH             3496
  PROCESSOR          isce
  UNIT               1
  WIDTH              7600
  access_mode        read
  byte_order         l
  data_type          BYTE
  extra_file_name    swbdLat_N24_N25_Lon_E066_E068.wbd.vrt
  family             image
  file_name          swbdLat_N24_N25_Lon_E066_E068.wbd
  length             3600
  name               image_name
  number_bands       1
  scheme             BIP
  width              7200
  xmax               68.0
  xmin               66.0

HDF5 dataset "/mask                ": shape (3496, 7600)        , dtype <bool>


Zhang Yunjun

unread,
Dec 13, 2020, 3:53:24 PM12/13/20
to MintPy
Hi Ozzy,

You could run generate_mask.py waterBody.h5 -m -0.5 -o waterMask.rdr to produce waterMask.rdr file also.

A future commit to MintPy will support waterMask.h5 file directly.

Yunjun

Ozzy Tirmizi

unread,
Dec 13, 2020, 6:00:59 PM12/13/20
to MintPy
Hi Yunjun,

Thank you for the suggestion! I noticed that even though it was not working with the load_data step, the mask was successfully being incorporated into later steps. I'll make the waterMask.rdr file and hopefully that will make everything run a little smoother on my end.

Thanks again!
Ozzy
Reply all
Reply to author
Forward
0 new messages