Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying mask.py to timeseriesStepModel.h5 results in file that can't be geocoded #272

Closed
EJFielding opened this issue Feb 10, 2020 · 1 comment · Fixed by #273
Closed

Comments

@EJFielding
Copy link

Description of the problem

I used the mask.py script to apply a mask to the timeseriesStepModel.h5 file, but the output does not work for geocoding.

Full script that generated the error

mask.py timeseriesStepModel.h5 -m maskTempCoh.h5
geocode.py timeseriesStepModel_msk.h5 -d timeseries

The original file timeseriesStepModel.h5 has this structure:

HDF5 dataset "/date                ": shape (1,)                , dtype <|S8>
HDF5 dataset "/timeseries          ": shape (1, 830, 1319)      , dtype <float32>

After masking, the timeseriesStepModel_msk.h5 file has this structure:

HDF5 dataset "/date                ": shape (1,)                , dtype <|S8>
HDF5 dataset "/timeseries          ": shape (830, 1319)         , dtype <float32>

Full error message

(mintpy) [fielding@sar MintPy_v1]$ geocode.py timeseriesStepModel_msk.h5 -d timeseries
Using default MintPy Path: /home/fielding/tools/MintPy
geocode.py timeseriesStepModel_msk.h5 -d timeseries
number of processor to be used: 1
output pixel size in (lat, lon) in degree: (-0.001060076300571566, 0.0008407384383298559)
output area extent in (S N W E) in degree: (17.76697540283203, 18.645779, -67.36084, -66.25274658203125)
--------------------------------------------------
resampling file: timeseriesStepModel_msk.h5
reading timeseries from timeseriesStepModel_msk.h5 ...
Traceback (most recent call last):
  File "/home/fielding/tools/MintPy/mintpy/geocode.py", line 341, in <module>
    main(sys.argv[1:])
  File "/home/fielding/tools/MintPy/mintpy/geocode.py", line 335, in main
    run_geocode(inps)
  File "/home/fielding/tools/MintPy/mintpy/geocode.py", line 299, in run_geocode
    data = readfile.read(infile, datasetName=dsName, print_msg=False)[0]
  File "/home/fielding/tools/MintPy/mintpy/utils/readfile.py", line 203, in read
    data = read_hdf5_file(fname, datasetName=datasetName, box=box)
  File "/home/fielding/tools/MintPy/mintpy/utils/readfile.py", line 231, in read_hdf5_file
    slice_list = get_slice_list(fname)
  File "/home/fielding/tools/MintPy/mintpy/utils/readfile.py", line 462, in get_slice_list
    obj.open(print_msg=False)
  File "/home/fielding/tools/MintPy/mintpy/objects/stack.py", line 165, in open
    self.get_size()
  File "/home/fielding/tools/MintPy/mintpy/objects/stack.py", line 204, in get_size
    self.numDate, self.length, self.width = f[self.name].shape
ValueError: not enough values to unpack (expected 3, got 2)

System information

  • Operating system: Linux
  • Version of Python and relevant dependencies if applicable
  • Version of MintPy (output of smallbaselineApp.py -v): MintPy release version v1.2.0-13, release date 2020-02-10
@EJFielding
Copy link
Author

I tried the work-around of geocoding the original timeseriesStepModel.h5 and the maskTempCoh.h5 mask file and then using mask.py to apply the mask. The resulting geo_timeseriesStepModel_msk.h5 has the same problem, though, and I can't display it with view.py because the dimension is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant