Changes between Version 9 and Version 10 of localmag


Ignore:
Timestamp:
05/13/12 11:05:52 (8 years ago)
Author:
branden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • localmag

    v9 v10  
    1616After localmag prepares (the new data for processing by checking for gaps (if the data was obtained from wave servers) and removes the mean. Then localmag synthesizes these traces into Wood-Anderson traces. This conversion is done by a frequency domain convolution to remove the original instrument response and replace it with the Wood-Anderson response. The frequency response function (generated as an intermediate step in this process) may optionally have a cosine taper applied to either or both the low and high ends of the frequency range. 
    1717 
    18 When the synthetic Wood-Anderson traces have been returned to the time domain, the peak amplitude is located for each trace. The search for peak amplitude is done within a time window related to the estimated Sg phase arrival time. One or two `peak' values may be located. First, the largest (absolute value) zero-to-peak is found. This zero-to-peak value is compared to the largest zero-to-peak found before the estimated P arrival. If the event zero-to-peak does not exceed the pre-event zero-to-peak by the factor z2pThresh, then that trace is not used for local magnitude calculations and no further peak searches are performed for that trace. This threshold should prevent the use of station/channels that are far from a small event or have a lot of background noise. It may also prevent localmag from processing traces where one event is preceeded by the coda of another large event. 
     18When the synthetic Wood-Anderson traces have been returned to the time domain, the peak amplitude is located for each trace. The search for peak amplitude is done within a time window related to the estimated Sg phase arrival time. One or two 'peak' values may be located. First, the largest (absolute value) zero-to-peak is found. This zero-to-peak value is compared to the largest zero-to-peak found before the estimated P arrival. If the event zero-to-peak does not exceed the pre-event zero-to-peak by the factor z2pThresh, then that trace is not used for local magnitude calculations and no further peak searches are performed for that trace. This threshold should prevent the use of station/channels that are far from a small event or have a lot of background noise. It may also prevent localmag from processing traces where one event is preceeded by the coda of another large event. 
    1919 
    2020The second peak value is a "sliding window" search, in which the largest plus-to-minus or minus-to-plus swing is found within a specified interval (normally 0.8 seconds, the free period of the Wood-Anderson instrument.) The motivation for this algorithm is to reduce the chances of picking a noise glitch instead of seismic signal. When computing the local magnitude, localmag uses one half of this peak-to-peak signal. Note that one half of peak-to-peak will usually be a smaller value than the largest zero-to-peak value. 
     
    2424Besides the peak amplitude values from the Wood-Anderson traces, localmag needs the -log(A0) values to correct for attenuation with station-hypocenter distance. The table of these values is read from a file. Thus regional networks can use their own attenuation relations in place of the one Richter (later Richter & Guttenburg) developed of Southern California. This table can be configured to use station to epicenter distance or station to hypocenter distance. For each horizontal component that has a valid trace (no data gaps, not clipped, sufficient event signal) localmag computes a local magnitude value. 
    2525 
    26 The magnitude values from all the traces are combined in the following manner. For stations with traces from both horizontal components (East and North) of a given instrument band (broadband or accelerometer), a station `band' local magnitude is found in one of two ways. Either the mean of the component magnitudes is used, or the mean of the component amplitudes is used to compute a station magnitude. If a station has more than one band of instrument (both broadband and accelerometer), the station magnitude is always the mean of the band magnitudes. 
     26The magnitude values from all the traces are combined in the following manner. For stations with traces from both horizontal components (East and North) of a given instrument band (broadband or accelerometer), a station 'band' local magnitude is found in one of two ways. Either the mean of the component magnitudes is used, or the mean of the component amplitudes is used to compute a station magnitude. If a station has more than one band of instrument (both broadband and accelerometer), the station magnitude is always the mean of the band magnitudes. 
    2727 
    2828Finally, all the station magnitude values are averaged; the standard deviation and the median are computed. These results are logged in all cases. When localmag is connected to an Earthworm transport ring, the results are sent to transport as a LOCALMAG message; other forms of output may be selected as well. 
     
    188188Function: Event and Trace Commands 
    189189 
    190 Add the trace(s) with station name STA, component name COMP and network name NET and location code LOC to the selection list. Any of STA, COMP and NET may be the wildcard character `*'. COMP may be given as the first two letters of the component name, to select all direction desgnators (North and East) are accepted for that component. Vertical `Z' components are never selected by localmag. Zero, one or many Add commands may be listed in the configuration file. If no Add commands are given, all SCNLs from the trace source will be selected. The Del command may be used to narrow the selection implied by wildcard values in an Add command or by the absence of any Add commands. 
     190Add the trace(s) with station name STA, component name COMP and network name NET and location code LOC to the selection list. Any of STA, COMP and NET may be the wildcard character '*'. COMP may be given as the first two letters of the component name, to select all direction desgnators (North and East) are accepted for that component. Vertical 'Z' components are never selected by localmag. Zero, one or many Add commands may be listed in the configuration file. If no Add commands are given, all SCNLs from the trace source will be selected. The Del command may be used to narrow the selection implied by wildcard values in an Add command or by the absence of any Add commands. 
    191191{{{ 
    192192Default: all traces are selected from a trace source 
     
    234234Function: Event and Trace Commands 
    235235 
    236 Delete the trace(s) with station name STA, component name COMP, network name NET, and location code LOC from the selection list. Any of STA, COMP and NET may be the wildcard character `*'. COMP may be given as the first two letters of the component name, to select all direction desgnators (North and East) are accepted for that component. Zero, one or many Del commands may be listed in the configuration file. 
     236Delete the trace(s) with station name STA, component name COMP, network name NET, and location code LOC from the selection list. Any of STA, COMP and NET may be the wildcard character '*'. COMP may be given as the first two letters of the component name, to select all direction desgnators (North and East) are accepted for that component. Zero, one or many Del commands may be listed in the configuration file. 
    237237{{{ 
    238238Default: all traces are selected from a trace source 
     
    3183180: Do not create a log file. Some logging data will be printed to the screen (stdout or stderr.) 
    319319 
    320 1: Create a log file in the directory named by the EW_LOG environment variable. The log file name will based on the config-file name and the current data. A new file will be created for each day (but only if there are logging entries to be made.) Some logging data will be printed to the screen (stdout or stderr,) as with option `0' above. 
    321  
    322 2: Create a log file as for option `1', but do not write anything to the screen (stdout or stderr.) 
     3201: Create a log file in the directory named by the EW_LOG environment variable. The log file name will based on the config-file name and the current data. A new file will be created for each day (but only if there are logging entries to be made.) Some logging data will be printed to the screen (stdout or stderr,) as with option '0' above. 
     321 
     3222: Create a log file as for option '1', but do not write anything to the screen (stdout or stderr.) 
    323323{{{ 
    324324Default: 1 
     
    392392Determines how localmag will report its results. In any event, localmag will log its results as set by the log switch. Choices for FORMAT are: 
    393393 
    394 LM: Write the output to an Earthworm TYPE_MAGNITUDE message which is sent to transport to the transport ring. This option is avaliable only if local mag is running as an Earthworm module (see RingInName), in which case LM is the default FORMAT. 
     394LM: Write the output to an Earthworm TYPE_MAGNITUDE message which is sent to transport to the transport ring. This option is avaliable only if local mag is running as an Earthworm module (see !RingInName), in which case LM is the default FORMAT. 
    395395 
    396396File filename: Write the output in TYPE_MAGNITUDE format to the file specified by filename. This option is avaliable only if localmag is running in stand-alone mode (see !RingInName). 
     
    474474Tells localmag to read SAC files from the DIR directory. These files could be SAC data files used by any of eventSource,traceSource, or staLoc. Or they could be SAC pole-zero-gain files read by respSource. When localmag is going to read SAC data files, it will scan the directory DIR for file names that match the format string FORMAT. 
    475475 
    476 The FORMAT string may include special format characters, which are introduced by `%'. The special characters are any of "sScCnN%". The letters s or S indicate a station name which must start with an alphabetic character, contain alphabetic characters or numbers, be up to 6 characters long; for s has no upper-case letters; for S has no lower-case. Similarly, c or C search for a component name, up to 8 characters, and n or N search for a network name, up to 8 characters long. These odd name lengths are base on Earthworm tracebuf packets. The symbol % must match itself, as do all characters not preceeded by %. The pattern matching of file names againts FORMAT is fairly crude. For example, the FORMAT string %S.%C would match the file name LKWY1.BHE. But the FORMAT string %S1.%C would not match: LKW1 would match the %S, leaving nothing to match the `1' in the format string. If the SAC directory contained a SAC datafile named LKW1.BHE and a response file named LKW1,BHE.resp, the FORMAT string %S.%C would correctly match the datafile name and skip the response file. 
     476The FORMAT string may include special format characters, which are introduced by '%'. The special characters are any of "sScCnN%". The letters s or S indicate a station name which must start with an alphabetic character, contain alphabetic characters or numbers, be up to 6 characters long; for s has no upper-case letters; for S has no lower-case. Similarly, c or C search for a component name, up to 8 characters, and n or N search for a network name, up to 8 characters long. These odd name lengths are base on Earthworm tracebuf packets. The symbol % must match itself, as do all characters not preceeded by %. The pattern matching of file names againts FORMAT is fairly crude. For example, the FORMAT string %S.%C would match the file name LKWY1.BHE. But the FORMAT string %S1.%C would not match: LKW1 would match the %S, leaving nothing to match the '1' in the format string. If the SAC directory contained a SAC datafile named LKW1.BHE and a response file named LKW1,BHE.resp, the FORMAT string %S.%C would correctly match the datafile name and skip the response file. 
    477477{{{ 
    478478Default:  none 
     
    489489baseDir: Specifies a fixed directory name. This can be an absolute directory path or a path relative to the current directory. It can contain one or more parts with pathname separators. This all components of this path (except possibly the last) must exist before localmag is started. 
    490490 
    491 dirFormat: Gives a formattted subdirectory name; the format string is that used for the Unix date command applied to the event origin time, with the addition of `%i' to indicate the event ID and `%v' to indicate the version of the event ID. Be careful with this; some formats produce output not compatible with directory names. The directory name derived from dirFormat must not contain any path separators. Suitable format strings include: 
    492  
     491dirFormat: Gives a formattted subdirectory name; the format string is that used for the Unix date command applied to the event origin time, with the addition of '%i' to indicate the event ID and  '%v' to indicate the version of the event ID. Be careful with this; some formats produce output not compatible with directory names. The directory name derived from dirFormat must not contain any path separators. Suitable format strings include: 
     492{{{ 
    493493%C[[BR]] 
    494494Century number (the year divided by 100 and truncated to an integer as a decimal number [1,99]); single digits are preceded by 0. 
     
    547547%Y[[BR]] 
    548548Year, including the century (for example 1993), 
    549  
    550 filename-format: Gives the formatted file name using % to introduce one of the format specifiers "sScCnN%" `s' is the station name in lower case; `S' is upper case. Likewise for component and network names; `%' stands for itself. All other characters are taken literally. This works in the same way as the format string for SAC response files. 
     549}}} 
     550 
     551filename-format: Gives the formatted file name using % to introduce one of the format specifiers "sScCnN%" 's' is the station name in lower case; 'S' is upper case. Likewise for component and network names; '%' stands for itself. All other characters are taken literally. This works in the same way as the format string for SAC response files. 
    551552 
    552553Localmag adds the following special fields to SAC file headers. If a zero-to-peak amplitude pick was made for the trace, the amplitude value will be placed in USER0, and the time of the pick will be placed in T0. If a pair of peak-to-peak amplitude picks were made for a trace, then the minimum amplitude will be placed in USER1; the maximum amplitude will be placed in USER2; the time of the negative peak will be placed in T1; and the time of the maximum peak will be placed in T2. Comments to this effect will be placed in the respective string fields for each of these data values. See the slideLength command for details about amplitude picking. 
     
    661662END: 
    662663is the number of seconds after the Sg arrival computed from hypocenter to station distance and SgSpeed to end the trace. 
    663 Once localmag computes the start and end times for the trace using the traceTimes values, it adds on additional time to the trace window. This extra time is used to apply a cosine taper to the data in the time domain. The length of each of these tapers will be 5 percent of the total trace length. The tapered portion of the trace is never including in the peak search window nor in the pre-event noise check window. This taper is applied to prevent `wrap-around' spikes from appearing in the pre-event noise check window. 
     664Once localmag computes the start and end times for the trace using the traceTimes values, it adds on additional time to the trace window. This extra time is used to apply a cosine taper to the data in the time domain. The length of each of these tapers will be 5 percent of the total trace length. The tapered portion of the trace is never including in the peak search window nor in the pre-event noise check window. This taper is applied to prevent 'wrap-around' spikes from appearing in the pre-event noise check window. 
    664665Default: traceTimes 5.0 60.0 
    665666Example: traceTimes 10.0 40.0 
     
    697698 
    698699z2pThresh T     Miscellaneous Commands 
    699 In addition to searching the search window for peak amplitudes (the `event' zero-to-peak), localmag checks the part of trace prior to estimated P arrival for peak amplitude (the `pre-event' peak.) If the `event' peak is not greater than T times the `pre-event' peak, there is not sufficient event signal above the pre-event noise, and localmag does not use the event peak amplitude for that trace. Localmag will also skip the expensive sliding window search for peak-to-peak amplitude for small event peak amplitudes. 
     700In addition to searching the search window for peak amplitudes (the  'event' zero-to-peak), localmag checks the part of trace prior to estimated P arrival for peak amplitude (the  'pre-event' peak.) If the  'event' peak is not greater than T times the  'pre-event' peak, there is not sufficient event signal above the pre-event noise, and localmag does not use the event peak amplitude for that trace. Localmag will also skip the expensive sliding window search for peak-to-peak amplitude for small event peak amplitudes. 
    700701The traceTimes command in the config file specifies how many seconds before P and after S is to be analyzed by localmag. Starting from that time duration, additional time is allotted at each end to allow for a 5% time domain taper and still have the above specified ttime duration untouched by the taper. The pre-event noise level is determined from the synthetic Wood-Anderson data from the end of the starting taper to the time that is 10 percent of the start traceTimes value before the estimated P arrival. 
    701702Default: 3.0 
     
    746747# but not station depth.) 
    747748# nDist number: the number of table entries that follow. 
    748 # Following these two commands are `nDist' lines of distance and -logA0  
     749# Following these two commands are  'nDist' lines of distance and -logA0  
    749750# values. The distance numbers must be integer values, in kilometers. 
    750751# The -logA0 values are positive decimal values. 
     
    807808# Del STA COMP NET 
    808809# SCNL selection is done by a selection list and a rejection list. 
    809 # The station selection command `Add' specifies the names of  
     810# The station selection command  'Add' specifies the names of  
    810811# STA (station), COMP (component), and NET (network).  
    811 # The wildcard `*' may be used for any or all of STA, COMP, NET. 
     812# The wildcard  '*' may be used for any or all of STA, COMP, NET. 
    812813# COMP may be given as the first two letters of the component name, 
    813814# to select all direction desgnators are accepted for that component. 
     
    850851 
    851852# readAmpDirect: flag to tell localmag to read Wood-Anderson amplitudes 
    852 # directly from a `trace' source instead of from Wood-Anderson traces.  
     853# directly from a  'trace' source instead of from Wood-Anderson traces.  
    853854# If this flag is used, then traceSource must be one that includes  
    854855# amplitude data, such as SAC files, EW database. 
     
    939940# dirFormat gives a formattted subdirectory name; the 
    940941# format string is that used for the "date" command applied 
    941 # to the event origin time, with the addition of `%i'  
    942 # to indicate the event ID and optionally `%v' for the 
     942# to the event origin time, with the addition of '%i'  
     943# to indicate the event ID and optionally '%v' for the 
    943944# the origin version. Be careful with this; some 
    944945# formats produce output not compatible with file names. 
    945946# filename-format gives the formatted file name using 
    946947# % to introduce one of the format specifiers "sScCnN%" 
    947 # `s' is the station name in lower case; `S' is upper case 
    948 # Likewise for component and network names; `%' stands for 
     948# 's' is the station name in lower case; 'S' is upper case 
     949# Likewise for component and network names; '%' stands for 
    949950# itself. All other characters are taken literally. 
    950951#