demiangomez / Parallel.GAMIT

Python wrapper to parallelize GAMIT executions
GNU General Public License v3.0
35 stars 16 forks source link

divide by zero in etm #22

Closed smalleyr closed 6 years ago

smalleyr commented 6 years ago

This error does not seem to prevent getting an ETM solution or a plot. It occurs once (there are 506 stations in the database, and 500 stations [not counting duplicate names] in the ppp_soln, I've not yet figured out the postgresql command to do the "distinct" using both StationCode and NetworkCode)

/Volumes/Sierra750GB/usr/local/pyconda/lib/python2.7/site-packages/numpy/linalg/linalg.py:1487: RuntimeWarning: divide by zero encountered in true_divide return s[..., 0]/s[..., -1] Successfully plotted bra.bomj

bra bomj

There are a number of sites similar to bomj (a sirgas campaign measurement followed years later by continuous operations) but the other ones do not report any errors.

There are a number of stations with less than 4 occupations and they are captured by an if statement and not processed. It would be more informative if they produced a message saying this and did not receive further processing. Here is the message all but one of them produce.

Traceback (most recent call last): File "../classes/pyPlotETM.py", line 58, in main json.dump(etm.todictionary(True), f, indent=4, sort_keys=False) File "/Volumes/UsersDrive/Users/smalley/Working.Parallel.GAMIT/classes/pyPPPETM.py", line 752, in todictionary etm['Linear'] = {'tref': self.Linear.tref, 'params': self.Linear.values.tolist()} AttributeError: ETM instance has no attribute 'Linear'

One station with 3 "occupations"/5 days of data: 98[2],03[2],10[1], produces this error message

Error during processing of cer.ccrn Traceback (most recent call last): File "../classes/pyPlotETM.py", line 52, in main etm = pyPPPETM.ETM(cnn, stn['NetworkCode'], stn['StationCode'], False) File "/Volumes/UsersDrive/Users/smalley/Working.Parallel.GAMIT/classes/pyPPPETM.py", line 624, in init self.Jumps = JumpsTable(cnn, NetworkCode, StationCode, ppp.t, add_antenna_jumps=self.Periodic.params) File "/Volumes/UsersDrive/Users/smalley/Working.Parallel.GAMIT/classes/pyPPPETM.py", line 294, in init DOP = np.diag(np.linalg.inv(np.dot(self.A.transpose(), self.A))) File "/Volumes/Sierra750GB/usr/local/pyconda/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 513, in inv ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj) File "/Volumes/Sierra750GB/usr/local/pyconda/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 90, in _raise_linalgerror_singular raise LinAlgError("Singular matrix") LinAlgError: Singular matrix

Campaign data does not have equipment jumps, but may have earthquake jumps with only one occupation/file after the earthquake, and that could make it fail.

But it seems that once the test for the number occupations fails, it should exit cleanly.

demiangomez commented 6 years ago

Problem found and fixed. The issue was related to getting the rcond of the jump design vectors.