sVn sVe must not be zero!
demanasta opened this issue · 2 comments
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?
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:
pystrain/pystrain/iotools/iparser.py
bin/StrainTool.py
changes committed to branch bug65
xanthos
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