our @ISA= ( "Magnitude" ) ; ($obj,$hashref) = new($class,"db" => $dbref, "dbm" => $dbmref[,$name1,$val1[,...]]) ; display($obj[,@keys]) ; put($obj,$name1,$val1[,...]) ; @vals = get($obj,@keys) ; $hashref = process_channel($obj,$trref,$flush) ; $hashref = process_station($obj,$sta,$flush) ; $hashref = process_network($obj,$flush) ;
new is the constructor method and does the basic setup of the internal perl structures for magnitude processing. There must be at least two input hash key-value pairs corresponding to the input temporaray database with the event info, specified by the key "db" with a database array reference $dbref as a value, and the master, or metadatabase, specified by the key "dbm" with a database array reference $dbmref as a value. orb/dbevproc sets up these databases, opens them, and passes in the array reference values when the perl processing object is created. Additional key-value pairs may also be specified which causes these to appear as new variables within the object structure. The Magnitude::new method looks for origin, assoc, site and snetsta non-empty tables in the input info database. It also looks for non-empty sitechan and calibration tables in the metadatabase. If any of these tables are missing, Magnitude::new will set the object output disposition to "skip", which will cause orb/dbevproc to immediately destroy the object and skip the event-process. The returns are the object reference in $obj and a standard hash reference in $hashref as returned by evproc::makereturn (see evproc.3p).
display is a utility method for displaying (printing) the object structure values specified in the @keys list. If @keys is not specified, then all of the object values are shown. Note that the display is recursive so that a all of the elements of a value which is a reference to a hash or array are displayed recursively. This method is normally used only for debugging.
put is a utility method for putting values into the object structure.
get is a utility method for getting values correspinding to the list of @keys from an object;
process_channel is the method that is called by orb/dbevproc whenever there is new trace data to be processed for a particular channel. The object instance is referenced by $obj. The channel data waveform values are referenced by $trref which is a reference to a Traces4.0 schema trace table database pointer array. Trace data is read by orb/dbevproc and is converted into temporary internal trace tables which are then passed to the the process_channel methods in the various perl processing module instances. The current channel to be processed is always in record 0 of this input trace table. In order to facilitate processing by the perl modules, orb/dbevproc only returns a single trace channel in a single trace table row even if the channel has missing sample values. Missing sample values are flagged with special "gap" values (anything bigger than 1.e30 can be considered a gap value). The process_channel methods are called by orb/dbevproc whenever there are new sample values to be processed according to user specified timeouts so that processing occurs on a regular basis even when the data segments have not been completely filled. If $flush is set, then orb/dbevproc has decided that either the trace is complete or that orb/dbevproc will not wait any longer for missing sample values. Either way this indicates that this will be the last call made by orb/dbevproc to this method for this object and that partial results, if any need to be computed now.
Magnitude::process_channel computes a set of waveform statistics according to signal and noise time windows that must be previously cached in the object data structure (this is done in the individual computational method getwftimes methods). These output values are cached for subsequent processing by the computational module sub-classes. Magnitude::process_channel also sets the disposition, using evproc::makereturn, to values that should be read by the sub-class objects and are also read by orb/dbevproc to indicate when particular channel, station and/or network processing has been done by the perl computational module and is ready for output. A disposition of "ok" means that the trace data was processed successfully, but the perl processing pbject expects more input data and should be called again whenever new data is available. A disposition of "channeldone" means that this particualr channel processing is finished, but more data is needed for other channels and stations. A disposition of "stationdone" means that this particualr station processing is finished, but more data is needed for other stations. A disposition of "processdone" means that this perl processing object is completely finished with waveform sample processing.
process_station is the method that is called by orb/dbevproc whenever it appears that the processing for a station is finished (usually due to process_channel returning a disposition of stationdone or processdone). Currently, all Magnitude::process_station does is to cache the lergest channel magnitude as the station magnitude.
process_network is the method that is called by orb/dbevproc whenever it appears that the processing for a network is finished (usually due to process_channel returning a disposition of processdone). Magnitude::process_network first computes the network magnitude mean, standard deviation, median and uncertainty from the individual station magnitdues which must be already domputed and cached within the processing module data structure. Then all of the output values are put into the appropriate temporary info database tables and certain return values are set in the return hash that is read by orb/dbevproc to indicate exactly which database values need to be output.
orbevproc(1), evproc(3p), Mlrichter(3p), Mbusneic(3p)