[cig-commits] [commit] master: Calculate event magnitude from sweeps (697a296)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Oct 8 17:05:44 PDT 2014


Repository : https://github.com/geodynamics/vc

On branch  : master
Link       : https://github.com/geodynamics/vc/compare/23464fca3efa2b6ad7ee0ce8f60c225b18b49741...e4325192ad1118379f46ba66899cb98143d09e04

>---------------------------------------------------------------

commit 697a2968fa3d8d7a65cc0ac1464d71bb93b2cc66
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Thu Sep 25 11:23:40 2014 -0700

    Calculate event magnitude from sweeps


>---------------------------------------------------------------

697a2968fa3d8d7a65cc0ac1464d71bb93b2cc66
 quakelib/src/QuakeLibIO.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/quakelib/src/QuakeLibIO.h b/quakelib/src/QuakeLibIO.h
index 7b7f4dc..0603a29 100644
--- a/quakelib/src/QuakeLibIO.h
+++ b/quakelib/src/QuakeLibIO.h
@@ -821,16 +821,24 @@ namespace quakelib {
         //! Set the sweeps for this event to be those specified in the argument.
         //! Also calculate relevant values related to these sweeps.
         void setSweeps(const ModelSweeps &sweeps) {
-            ModelSweeps::const_iterator         it;
+            ModelSweeps::iterator   it;
+            double                  moment = 0
+            ;
             
             _sweeps = sweeps;
             _total_slip.clear();
             
+            // Sum up sweep information for total_slip records
+            // and calculate magnitude at the same time
             for (it=_sweeps.begin(); it!=_sweeps.end(); ++it) {
+                it->_event_number = _data._event_number;
                 _total_slip[it->_element_id]._slip += it->_slip;
                 _total_slip[it->_element_id]._area = it->_area;
                 _total_slip[it->_element_id]._mu = it->_mu;
+                moment += it->_slip*it->_mu*it->_area;
             }
+            
+            _data._event_magnitude = (2.0/3.0)*log10(1e7*moment) - 10.7;
         }
         
         //! Get the total amount a given block slipped during this event



More information about the CIG-COMMITS mailing list