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

sVn sVe must not be zero! #65

Closed
demanasta opened this issue Jun 29, 2020 · 2 comments · Fixed by #70
Closed

sVn sVe must not be zero! #65

demanasta opened this issue Jun 29, 2020 · 2 comments · Fixed by #70
Assignees
Labels

Comments

@demanasta
Copy link
Contributor

Describe the bug
If sVn sVe set to zero in the input file then tensor include this station will not estimated. script cannot create covariance matrix (1/sV...)

Desktop (please complete the following information):

  • OS: [Linux]
  • Python: [2.7]
  • GMT: [5.4.3]
  • StrainTool: [v1.0]

Propose

  • Add to README a warning
  • Add check on when script parse input file?
@xanthospap
Copy link
Contributor

Bug is re-producible, but only affects Shen method (aka --method='shen'). Here is how we are going to solve this:

Function parse_ascii_input() in file pystrain/pystrain/iotools/iparser.py now takes one extra (bool) argument zero_std_is_error=False (has a default value of False). If set to True the function will throw (a ValueError) if a standard deviation value for either North or East component is set to zero (in the input file, for any station parsed). Why use this extra argument and not throw anyway? because the std. deviation values are only relevant for the Shen method; if the user has selected the Veis method, then we just ignore them anyway.
The call to parse_ascii_input() in bin/StrainTool.py is now changed to sta_list_ell = parse_ascii_input(args.gps_file, args.method=='shen') so that if a station with zero std. deviation (in north or east) is parsed when method='shen' is triggered, will result in an error and the program will exit!.

Files changed:

  1. pystrain/pystrain/iotools/iparser.py
  2. bin/StrainTool.py

changes committed to branch bug65

xanthos

@xanthospap
Copy link
Contributor

Made a short note in the README.md file about this. See the last paragraph in section Input FIles.
@demanasta

  • we should probably copy the note to the documentation at the StrainTool site
  • validate that the code works properly
  • merge the branch to master

@demanasta demanasta mentioned this issue Jul 5, 2020
1 task
demanasta pushed a commit that referenced this issue Jul 5, 2020
@demanasta demanasta mentioned this issue Sep 11, 2021
4 tasks
demanasta added a commit that referenced this issue Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants