Changeset 1202 for SHX


Ignore:
Timestamp:
15.12.2016 21:58:39 (3 years ago)
Author:
klaus
Message:

magnitude dump files

Location:
SHX/trunk/SeismicHandler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/cmdscripts/LOCAL_MAGNITUDE_PLOT.SHC

    r1200 r1202  
    4141zoom all 3 
    4242mplplot/tracelabelsize=5 |trc_|#7| sw blue,2*lightblue #1 
     43magnitude dumpfile ml |magndump_|#7| 
    4344 
    4445return 
  • SHX/trunk/SeismicHandler/commands/magnitude.py

    r1200 r1202  
    2828     
    2929    magnitude dump 
     30    magnitude dumpfile <magtype> <file> 
    3031    magnitude determine <magtype> <trc> <from> <to> 
    3132    magnitude determine <magtype> <trclist> <phaselist> <span> 
     
    4950    or[[br]] 
    5051    '''command''': MAGNITUDE PLOT <magtype> [<fname>] 
     52    or[[br]] 
     53    '''command''': MAGNITUDE DUMPFILE <magtype> <fname> 
    5154 
    5255    Magnitude management. Magnitudes are stored in a separate container, which is controlled via this command set. 
     
    6265       MEAN: compute mean magnitude[[br]] 
    6366       PLOT: create magnitude vs distance plot[[br]] 
    64        DUMP: dump all phases on screen. 
     67       DUMP: dump all magnitudes on screen. 
     68       DUMPFILE: dump all magnitudes and distances of a magnitude type to file 
    6569 
    6670     * <magtype> ''parameter type: string''[[br]] 
     
    137141    legal_subcmds = { 
    138142        'dump'      : 1, 
     143        'dumpfile'  : 3, 
    139144        'clear_all' : 1, 
    140145        'plot'      : 2, 
     
    239244                    dspprog = 'display' 
    240245                os.system( "%s %s &" % (dspprog,picfile) ) 
     246        elif subcmd == 'dumpfile': 
     247            magtype = self.getMagtype( self.parameters[1] ) 
     248            dumpfile = self.parameters[2].lower() 
     249            fp = open( dumpfile, 'w' ) 
     250            for x,y,lab in zip(*self.getMagnitudePlotData(magtype)): 
     251                fp.write( "%-8s %g %g\n" % (lab,x,y) ) 
     252            fp.close() 
    241253        elif subcmd == 'determine': 
    242254            ap = AnalysisPar() 
Note: See TracChangeset for help on using the changeset viewer.