CUSPSAC(1) CUSP COMMANDS CUSPSAC(1) NAME cuspsac - converts CUSP event .mem and waveform files to a SAC format file. SYNOPSIS cuspsac [ control_file [filename] ] DESCRIPTION cuspsac converts event data from the CUSP format to the SAC format as defined by the SAC program from Lawrence Livermore National Labs. The resulting file is readable on SUN works- tations and can be transferred as a binary file using the network utility ftp. OPTIONS The program cuspsac obtains the list of id numbers of the events to process from an input file. The name of this input file can be specified as _f_i_l_e_n_a_m_e on the command line. If the input filename is not specified, the input filename defaults to sac.input. Each line in the input file must be a CUSP filename, a filename of the form: x_i_d.mem . An input file can be produced by issuing the command of the type: ls -1 $CUSP_IN /*.mem >_f_i_l_e_n_a_m_e By default all trace data is converted to the specified for- mat. Optional data for controlling the selection of time- series data can be specified in either the default control_file named _s_a_c._k_o_m or in a user specified control_file on the command line. If the input filename is specified on the command line, a control_file must also be specified, even if the control_file does not exist. The .mem and waveform files of the events to be processed must reside in the respective directory paths assigned to the environmental variables CUSP_IN and GRAM_IN ; usually both are defined to be `.' , the current working directory. At the data centers an event waveform filename is simply: _i_d (cf. the CUSP naming convention of: x_i_d.grm ). CONTROL_FILE Data records in the .kom control files are of the form: _k_e_y_- _w_o_r_d _v_a_l_u_e * or ! _t_e_x_t a comment; blank lines are also ignored. select _f_i_l_e_n_a_m_e specifies pathname of file containing selected station names. File contains one name per line in the format: STN_NAME STN_OPER STN_COMP (A6,A6,A6) DEFAULT = all sites found in .mem file. USGS Menlo Last change: 29 APRIL 1993 1 CUSPSAC(1) CUSP COMMANDS CUSPSAC(1) secs _s_e_c_o_n_d_s length of output time series in seconds (real*4). DEFAULT = length of time series declared in .mem file GRM tuple; however, internal program arrays are dimen- sioned for a maximum of 360448 bytes/trace. vr _r_e_d_u_c_t_i_o_n__v_e_l_o_c_i_t_y Start of time series is delayed by _e_v_e_n_t__s_t_a_t_i_o_n__d_i_s_t_a_n_c_e/_r_e_d_u_c_t_i_o_n__v_e_l_o_c_i_t_y seconds (real*4). If specified traces are processed in dis- tance sorted order as determined by event-station azimuth. DEFAULT = 0. ; no reduced traveltime adjust- ment to time series start time. start _s_e_c_o_n_d_s number of seconds to offset start of time series rela- tive to reduced starting time (real*4). DEFAULT = 0. known _c_o_m_p_o_n_e_n_t components to output. You must specify complete com- ponent. (VHZ, VHL, etc) (A3). comp _c_o_m_p_o_n_e_n_t Select only specified component type for each site (e.g. V, Z, N, E, T ). DEFAULT = every component. azim _s_t_r_i_k_e strike (degrees) of the positive distance axis (real*4). DEFAULT = all event-station azimuths define positive distances. deci _f_a_c_t_o_r decimation factor (resampling interval) of trace data (integer*4). Possible values are 1-7. DEFAULT = 1 ; no decimation. notime do not transfer time codes (identified by component type: T ). DEFAULT = all time codes are transferred. verbose give detailed data message log for each station pro- cessed. DEFAULT = no summary messages. swap if waveform files have data in VAX format (little- endian), use this keyword to swap the data sample bytes to xdr order. DEFAULT = time series samples assumed to be in xdr-format (big-endian) end required, if you want program to process specified optional input data and create an output file. USGS Menlo Last change: 29 APRIL 1993 2 CUSPSAC(1) CUSP COMMANDS CUSPSAC(1) EXAMPLES Below is a listing of a sample .kom command file: cat sac.kom ! list example input file * Event 123587 NWSE ! a comment, not processed. select 123587.SEC1 ! optional record, more follow secs 60.0 ! data seconds to retrieve vr 6.0 ! reduction velocity start -2.0 ! trace start time relative to reduced traveltime known V Z ! select both vertical components azim 320.0 ! postive distance +-90 degrees deci 2 ! decimate the data by 2 verbose ! write details on processed traces end ! required ENVIRONMENT The following variables must be defined in the shell in which the cuspsac command is invoked: CUSP_IN Pathname of directory containing .mem files and auxil- lary input .kom files; usually equvalent to ".". GRAM_IN Pathname of directory containing waveform files; usu- ally equvalent to ".". GRAM_OUT Pathname of directory to which the .xdr files are out- put. DDL_EVENT Pathname of the file containing the data definition language used to initialize a database memory buffer for .mem file i/o (e.g. cusp/Base/event.ddl). DDL_SETUP Pathname of the file containing the data definition language used to initialize a database memory buffer for station data (e.g. cusp/Base/setup.ddl). MEM_SETUP Pathname of the station database file (e.g. cusp/Base/setup.mem). DIAGNOSTICS Errors are flagged with either a self explantory text mes- sage or a text message naming the program module in which the error occurred along with two integer number status codes: ier and ires; ier flags where in a program module an error occurred (a positional tag) and ires is the value of an integer variable (usually a return status ) which failed USGS Menlo Last change: 29 APRIL 1993 3 CUSPSAC(1) CUSP COMMANDS CUSPSAC(1) a logical test. Error reporting cascades upwards, providing a trace through nested subroutine calls. Interpretion of these status codes requires access to the source code and is best left to programmers familiar with the subroutine libraries in CUSP. AUTHOR Please report bugs and address questions to: awwalter@gsvax0.wr.usgs.gov (130.118.4.51) USGS Menlo Last change: 29 APRIL 1993 4