Giter VIP home page Giter VIP logo

Comments (8)

EJFielding avatar EJFielding commented on June 15, 2024 1

I tried modifying the asc_desc2horz_vert.py script to change the FILE_TYPE attribute to displacement before writing out the results, which worked to change the dataset type.

    # if original data was timeseries, convert it to displacement
    if atr['FILE_TYPE'] == 'timeseries':
         atr['FILE_TYPE'] = 'displacement';

I could view it with no problem, but save_gmt.py still refused to work. I guess other things need to be changed.

save_gmt.py up.h5 displacement -o up_v1.grd
Using default MintPy Path: /home/fielding/tools/MintPy
Traceback (most recent call last):
  File "/u/vento-r0/ericf/packages/Anaconda/anaconda3/envs/mintpy/lib/python3.7/site-packages/numpy/core/function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/fielding/tools/MintPy/mintpy/save_gmt.py", line 179, in <module>
    main(sys.argv[1:])
  File "/home/fielding/tools/MintPy/mintpy/save_gmt.py", line 172, in main
    inps.outfile = write_grd_file(data, atr, inps.outfile)
  File "/home/fielding/tools/MintPy/mintpy/save_gmt.py", line 150, in write_grd_file
    lats, lons = get_geo_lat_lon(atr)
  File "/home/fielding/tools/MintPy/mintpy/save_gmt.py", line 133, in get_geo_lat_lon
    X = np.linspace(X_FIRST, X_END, W)
  File "<__array_function__ internals>", line 6, in linspace
  File "/u/vento-r0/ericf/packages/Anaconda/anaconda3/envs/mintpy/lib/python3.7/site-packages/numpy/core/function_base.py", line 121, in linspace
    .format(type(num)))
TypeError: object of type <class 'float'> cannot be safely interpreted as an integer.

from mintpy.

yunjunz avatar yunjunz commented on June 15, 2024 1

The save_gmt.py bug should be fixed now.

from mintpy.

EJFielding avatar EJFielding commented on June 15, 2024 1

Thanks @yunjunz it works great now!

from mintpy.

EJFielding avatar EJFielding commented on June 15, 2024

It seems that the asc_desc2horz_vert.py script or one of the scripts it calls needs the same fix as in PR #273 . The script now writes the files, but the output files can't be displayed with view.py or other programs because the timeseries dataset lost a dimension.

writing horizontal component to file: hz.h5
create timeseries HDF5 file: hz.h5 with w mode
create dataset /timeseries of float32    in size of (614, 1072) with compression=None
create dataset /dates      of |S8        in size of (1,)
finished writing to hz.h5
writing   vertical component to file: up.h5
create timeseries HDF5 file: up.h5 with w mode
create dataset /timeseries of float32    in size of (614, 1072) with compression=None
create dataset /dates      of |S8        in size of (1,)
finished writing to up.h5

from mintpy.

EJFielding avatar EJFielding commented on June 15, 2024

I tried making the same additions to asc_desc2horz_vert.py that were done in the other files under PR #273 and that made output up.h5 and hz.h5 files that I can display with view.py. I still had trouble with the save_gmt.py command. I wonder if it would be better to change the output FILE_TYPE attribute to another type instead.

from mintpy.

yunjunz avatar yunjunz commented on June 15, 2024

Hi @EJFielding, I agree with you. timeseries file type is not designed to have one acquisition, thus, it would require quite some changes in the code to make it work through all scripts. Simply changing the file type to a different name, i.e. displacement, would much easier. This can be done by changing the dataset name in the root level of HDF5 file from timeseries to displacement.

from mintpy.

EJFielding avatar EJFielding commented on June 15, 2024

Does that mean we need a program to extract a step function "date" and make that a displacement dataset? I understand the timeseriesStepFunction output can have multiple dates, but I have only asked for one date.

from mintpy.

yunjunz avatar yunjunz commented on June 15, 2024

You are right. The existing program can not do it, but this can be easily done in python in a notebook. After all, it's HDF5, manually playing around is straightforward.

The current problem is just because timeseries is a defined keyword in mintpy, and can not be used for something else.

from mintpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.