Giter Club home page Giter Club logo

Comments (8)

yunjunz avatar yunjunz commented on July 23, 2024 1

The code does keep all the metadata during the loading process, for the sake of completeness, although it uses UPPER_CASE only. "mintpy.*" metadata is saved to check the processing configurations.

from mintpy.

yunjunz avatar yunjunz commented on July 23, 2024 1

Hi @EJFielding, the reference_point.py bug is fixed now.

from mintpy.

yunjunz avatar yunjunz commented on July 23, 2024

Hi @EJFielding, 0.0001 deg ~= 10 m on the equator, so I think relaxing it to 3 decimal digits should still be fine.

You could try reference_point.py --write-data to change the REF_X/Y/LAT/LON metadata and update the matrix value. MintPy uses UPPER_CASE style for all metadata and is case sensitive.

from mintpy.

EJFielding avatar EJFielding commented on July 23, 2024

Three digits sounds good. Thanks for also mentioning that the metadata is case sensitive and key parameters are UPPER_CASE. It is a bit confusing because info.py prints out a bunch of parameters that are lower case also, including mintpy.reference.lalo and ref_lat. I understand now that the one that matters is the REF_LAT.

I see that you already changed the comparison to 3 decimal digits or ~100 m, so that seems reasonable.

from mintpy.

EJFielding avatar EJFielding commented on July 23, 2024

By the way, I tried to run the reference_point.py --write-data command on my time-series step function file and it did not work.

reference_point.py --write-data -l 18.2 -L -67.15 A135_geo_timeseriesStepModel_msk.h5
Using default MintPy Path: /home/fielding/tools/MintPy
--------------------------------------------------
input reference point in lat/lon: (18.2, -67.15)
input reference point in y/x: (330, 179)
--------------------------------------------------
calculating the temporal average of timeseries file: A135_geo_timeseriesStepModel_msk.h5
reading timeseries data from file: A135_geo_timeseriesStepModel_msk.h5 ...
/home/fielding/tools/MintPy/mintpy/objects/stack.py:464: RuntimeWarning: Mean of empty slice
  dmean = np.nanmean(data, axis=0)
Traceback (most recent call last):
  File "/home/fielding/tools/MintPy/mintpy/reference_point.py", line 447, in <module>
    main(sys.argv[1:])
  File "/home/fielding/tools/MintPy/mintpy/reference_point.py", line 440, in main
    reference_file(inps)
  File "/home/fielding/tools/MintPy/mintpy/reference_point.py", line 186, in reference_file
    if mask[inps.ref_y, inps.ref_x] == 0.:
IndexError: too many indices for array

Maybe I should open a new issue?

Updating the REF_LAT and REF_LON with add_attribute.py works. I understand that it won't update the values of the array for the new location, but I am only changing the reference point by less than a pixel in this case.

from mintpy.

rzinke avatar rzinke commented on July 23, 2024

Hello, I am encountering a similar issue.
I am not able assign a single reference point to my data sets in a scripted fashion, as the rounding error is different for the ascending and descending data sets.

When I use refLat=37.07010 and refLon=89.20000 I get the following error message:

Traceback (most recent call last):
  File "/u/sarh0/rzinke/tools/MintPy/mintpy/asc_desc2horz_vert.py", line 278, in <module>
    main(sys.argv[1:])
  File "/u/sarh0/rzinke/tools/MintPy/mintpy/asc_desc2horz_vert.py", line 258, in main
    inps = cmd_line_parse(iargs)
  File "/u/sarh0/rzinke/tools/MintPy/mintpy/asc_desc2horz_vert.py", line 101, in cmd_line_parse
    raise ValueError('input files do not have the same reference point from REF_LAT/LON values!\n{}'.format(msg))
ValueError: input files do not have the same reference point from REF_LAT/LON values!
	file1: 41velocityMaskedRefd.h5, REF_LAT/LON: ['37.071', '89.200'] degrees
	file2: 121velocityMaskedRefd.h5, REF_LAT/LON: ['37.070', '89.200'] degrees

I have tried "jiggling" the numbers in various directions, but always I get a similar same error message, with the ascending reference point different from the descending.

I will try removing this check for now, but might need more attention in the future.

from mintpy.

yunjunz avatar yunjunz commented on July 23, 2024

Thanks for bringing it up @rzinke. The current way of checking is not very friendly to datasets with low resolution, we should change it to check if the two reference points are close in terms of pixels, e.g. <=3 pixels. Let's re-open for a reminder.

from mintpy.

EJFielding avatar EJFielding commented on July 23, 2024

@rzinke It seems that there are often some round-off errors that cause the reference points to be slightly different. Updating the REF_LAT and REF_LON with add_attribute.py works on the files to make them exactly the same. This worked for me.

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.