insarlab / MiaplPy

MIAmi Phase Linking in PYthon
Other
92 stars 23 forks source link

miaplpyApp.py continues after fatal error #37

Open falkamelung opened 1 year ago

falkamelung commented 1 year ago

Hi @mirzaees When miaplpyApp.py encounters an error it does not always exist. For example, I got the error below but it continued, producing garbage. I have seen this also for other run_steps. It would be much preferred to alway exit so that you know where the problem is.

<><><><><><><><><> step 4 - generate_ifgram (MiaplPy) <><><><><><><><><><>
Generate /scratch2/05861/tg851601/MiamitestTsxSMD14/miaplpy/network_single_reference/run_files/run_04_miaplpy_generate_ifgram
20221207:185450 * generate_unwrap_mask.py --geometry /scratch2/05861/tg851601/MiamitestTsxSMD14/miaplpy/inputs/geometryRadar.h5
There is no shadow mask in geometryRadar.h5, all values set to 1
Traceback (most recent call last):
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MiaplPy/miaplpy/generate_unwrap_mask.py", line 110, in <module>
    main()
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MiaplPy/miaplpy/generate_unwrap_mask.py", line 47, in main
    mintpy.generate_mask.main(args_shm.split())
AttributeError: module 'mintpy' has no attribute 'generate_mask'
20221207:185450 * generate_ifgram.py --reference 20200313 --secondary 20200324 --output_dir /scratch2/05861/tg851601/MiamitestTsxSMD14/miaplpy/inverted/interferograms_single_reference/20200313_20200324 --azimuth_looks 1 --range_looks 1 --filter_strength 0 -
falkamelung commented 1 year ago

Hi @mirzaees generate_unwrap_mask.py is confusing. It is related to unwrapping but in the generate_interferograms step ????

Also, if you run generate_unwrap_mask.py --geometry inputs/geometryRadar.h5 there is no indication where the file will be written. Should it not have the output file on the command line?

falkamelung commented 1 year ago

Here another example. You get an error, and then the message "Normal end of regular processing" although it failed.

--------------------------------------------------------------------------------
Calculate tropospheric delay and write to HDF5 file...
update mode: ON
output file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/ERA5.h5
1) output file either do NOT exist or is NOT newer than all GRIB files.
run or skip: run
open geometry file: geometryRadar.h5
reading incidenceAngle  data from file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/geometryRadar.h5 ...
reading height          data from file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/geometryRadar.h5 ...
reading latitude        data from file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/geometryRadar.h5 ...
reading longitude       data from file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/geometryRadar.h5 ...
--------------------------------------------------
create HDF5 file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/ERA5.h5 with w mode
create dataset  : date       of |S8                       in size of (147,)               with compression = None
create dataset  : timeseries of <class 'numpy.float32'>   in size of (147, 653, 1830)     with compression = None
close  HDF5 file: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk/network_single_reference/inputs/ERA5.h5
--------------------------------------------------
calculating absolute delay for each date using PyAPS (Jolivet et al., 2011; 2014) ...
number of grib files used: 147
Traceback (most recent call last):
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/cli/smallbaselineApp.py", line 213, in <module>
    main(sys.argv[1:])
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/smallbaselineApp.py", line 1117, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/smallbaselineApp.py", line 898, in run
    self.run_tropospheric_delay_correction(sname)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/smallbaselineApp.py", line 648, in run_tropospheric_delay_correction
    mintpy.cli.tropo_pyaps3.main(iargs)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/cli/tropo_pyaps3.py", line 166, in main
    run_tropo_pyaps3(inps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/tropo_pyaps3.py", line 715, in run_tropo_pyaps3
    calc_delay_timeseries(inps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/tropo_pyaps3.py", line 609, in calc_delay_timeseries
    tropo_data = get_delay(
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/MintPy/src/mintpy/tropo_pyaps3.py", line 487, in get_delay
    aps_obj.getdelay(pha)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/miniconda3/lib/python3.10/site-packages/pyaps3/objects.py", line 310, in getdelay
    val = linearint(np.vstack((lati, loni, D)).T)*np.pi*4.0/(cinc*wvl)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/miniconda3/lib/python3.10/site-packages/scipy/interpolate/_rgi.py", line 331, in __call__
    indices, norm_distances = self._find_indices(xi.T)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/tools/miniconda3/lib/python3.10/site-packages/scipy/interpolate/_rgi.py", line 499, in _find_indices
    return find_indices(self.grid, xi)
  File "_rgi_cython.pyx", line 95, in scipy.interpolate._rgi_cython.find_indices
  File "stringsource", line 660, in View.MemoryView.memoryview_cwrapper
  File "stringsource", line 350, in View.MemoryView.memoryview.__cinit__
ValueError: ndarray is not C-contiguous
Go back to directory: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk

###############################################################
Normal end of Non-Linear time series processing workflow!
##############################################################
Go back to directory: /scratch/05861/tg851601/Miami_Sentinel1_data/miaplpy_falk

################################################
   Normal end of miaplpyApp processing!
################################################
Time used: 08 mins 35.6 secs