Skip to content

Commit d7a6a14

Browse files
author
Mike Hearne
authored
Merge pull request #241 from mhearne-usgs/floatfix
Fixing moment tensors which have no content. Why these exist is unknown.
2 parents bfbc5bf + 6b3c6af commit d7a6a14

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

libcomcat/dataframes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,8 @@ def _get_product_rows(event, product_name):
10031003
prow = _describe_origin(event, product)
10041004
else:
10051005
continue
1006+
if prow is None:
1007+
continue
10061008
prows = prows.append(prow, ignore_index=True)
10071009

10081010
return prows
@@ -1551,11 +1553,17 @@ def _describe_moment_tensor(event, product):
15511553
if np.isnan(double_couple):
15521554
double_couple = mt.double_couple
15531555

1556+
hasnan = (np.isnan(derived_mag) + np.isnan(derived_depth) +
1557+
np.isnan(double_couple) + np.isnan(strike) +
1558+
np.isnan(dip) + np.isnan(rake))
1559+
if hasnan:
1560+
return None
15541561
desc_fmt = ('Method# %s|Moment Magnitude# %.1f|Depth# %.1d|'
15551562
'Double Couple# %.2f|NP1 Strike# %.0f|NP1 Dip# %.0f|'
15561563
'NP1 Rake# %.0f')
15571564
desc_tpl = (method, derived_mag, derived_depth,
15581565
double_couple, strike, dip, rake)
1566+
15591567
desc = desc_fmt % desc_tpl
15601568
pversion = product.version
15611569
url = product.getContentURL('quakeml.xml')

0 commit comments

Comments
 (0)