Changeset 1209 for SHX


Ignore:
Timestamp:
20.12.2016 12:01:02 (3 years ago)
Author:
klaus
Message:

filter out outliers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/commands/magnitude.py

    r1208 r1209  
    605605        mindist = 30. 
    606606        maxdist = self.rangestart + (magnstart-1.)*self.rangeinc 
     607        # filter out outliers with magn > 3*stddev 
     608        allmags = np.array( zip(*values)[2] ) 
     609        filmean = allmags.mean() 
     610        filstd = allmags.std() 
     611        filmin = filmean - 3*std 
     612        filmax = filmean + 3*std 
    607613        dv = [] 
    608614        mv = [] 
    609615        for sta,dist,magn in values: 
    610616            if dist < mindist or dist > maxdist: 
     617                continue 
     618            if magn < filmin or magn > filmax: 
    611619                continue 
    612620            dv.append( dist ) 
Note: See TracChangeset for help on using the changeset viewer.