geodesymiami / insarmaps

3 stars 0 forks source link

Temporary issue for save_hdf5eos fix of MintPy #83

Open falkamelung opened 2 years ago

falkamelung commented 2 years ago

I could not find the MintPy issue so I am writing it here.

  1. The data_footprint is not quite right. It shows a straight raectangle but it should be inclined. The Hawaii example shows it more clearly. The values are in the geometry files. See here
image image

https://insarmaps.miami.edu/start/19.4594/-155.5096/10.6143?flyToDatasetCenter=false&startDataset=S1_IW12_087_0527_0531_20180908_XXXXXXXX_N19390_N19549_W155679_W155507

image image
  1. The --subset option does not work:

    save_hdfeos5.py timeseries_demErr.h5 --tc temporalCoherence.h5 --asc avgSpatialCoh.h5 -m  ../maskPS.h5 -g inputs/geometryRadar.h5 -t smallbaselineApp.cfg --suffix PS --subset
    ERROR: --subset mode is NOT supported for time-series in radar-coordinates!

    (There is something weird: in geo coordinates it always uses --subset, no matter whether it is given. Try the command below without --subset. ??????)

  2. Test datasets to fix the data_footprint right are here:

    
    Radar coordinates (subset)
    cd /data/HDF5EOS/Miami2SenAT48/minopy_Surfside_2019-2022/single_reference_network

save_hdfeos5.py timeseries_demErr.h5 --tc temporalCoherence.h5 --asc avgSpatialCoh.h5 -m ../maskPS.h5 -g inputs/geometryRadar.h5 -t smallbaselineApp.cfg --suffix PS h5file=S1_IW3_048_0081_0082_20191111_20220710_PS.he5 rm -rf JSON ; hdfeos5_2json_mbtiles.py $h5file ./JSON; json_mbtiles2insarmaps.py -u insaradmin -p Insar123 --host insarmaps.miami.edu -P rsmastest -U rsmas\@gmail.com --json_folder JSON --mbtiles_file JSON/${h5file%.*}.mbtiles

Geo coordinates (subset) cd /data/HDF5EOS/MaunaLoaSenDT87/mintpy

h5file=S1_IW12_087_0527_0531_20180908_XXXXXXXX_N19390_N19549_W155679_W155507.he5 rm -rf JSON ; hdfeos5_2json_mbtiles.py $h5file ./JSON; json_mbtiles2insarmaps.py -u insaradmin -p Insar123 --host insarmaps.miami.edu -P rsmastest -U rsmas\@gmail.com --json_folder JSON --mbtiles_file JSON/${h5file%.*}.mbtiles

yunjunz commented 2 years ago

I was aware of this potential issue. After seeing @stackTom's initial implementation using the four corners lat/lon, I realize it won't work for dataset with no-data-value on the corners/edges, which is very common for S1. Thus, I changed it to the min/max lat/lon as a bounding box. If you have a robust way to exact the inclined polygon, please issue another PR.

Screen Shot 2022-08-20 at 10 42 14 AM
stackTom commented 2 years ago

I only know how to get data from the unavco h5 files, don't know enough about geology or rest of the mintpy pipeline to suggest any alternatives.

Do you know how else we could do it @falkamelung?

falkamelung commented 2 years ago

Hi @stackTom , I would think in most cases we can just take the (1,1), (1,N), (N,1), (N,N) of the arrays to get the lat/long coordinates of the edges:

image

To capture Yunjun's case above, if latitude(1,1) is NaN, we should be able to take the first row where it is not NaN. We have to to make sure that it works for both descending and ascending as the location of the NaN areas get flipped.

stackTom commented 2 years ago

Will have to play with it. I initially did it like you suggest (before yunjun put in his fixes), but the resultant polygon also wasn't slanted.

I tested it using an online WKT visualizer. Unless my memory is failing me (which is a full possibility), it wasn't slanted.