Skip to content

Commit

Permalink
Merge pull request #241 from mhearne-usgs/floatfix
Browse files Browse the repository at this point in the history
Fixing moment tensors which have no content. Why these exist is unknown.
  • Loading branch information
mhearne-usgs authored Apr 14, 2021
2 parents bfbc5bf + 6b3c6af commit d7a6a14
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libcomcat/dataframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,8 @@ def _get_product_rows(event, product_name):
prow = _describe_origin(event, product)
else:
continue
if prow is None:
continue
prows = prows.append(prow, ignore_index=True)

return prows
Expand Down Expand Up @@ -1551,11 +1553,17 @@ def _describe_moment_tensor(event, product):
if np.isnan(double_couple):
double_couple = mt.double_couple

hasnan = (np.isnan(derived_mag) + np.isnan(derived_depth) +
np.isnan(double_couple) + np.isnan(strike) +
np.isnan(dip) + np.isnan(rake))
if hasnan:
return None
desc_fmt = ('Method# %s|Moment Magnitude# %.1f|Depth# %.1d|'
'Double Couple# %.2f|NP1 Strike# %.0f|NP1 Dip# %.0f|'
'NP1 Rake# %.0f')
desc_tpl = (method, derived_mag, derived_depth,
double_couple, strike, dip, rake)

desc = desc_fmt % desc_tpl
pversion = product.version
url = product.getContentURL('quakeml.xml')
Expand Down

0 comments on commit d7a6a14

Please sign in to comment.