West Coast/Alaska Tsunami Warning
Center
Operations Manual
NOAA/NWS/WCATWC
910 South Felton Street
Palmer, Alaska 99645
http://wcatwc.arh.noaa.gov
Section
4.1.3 – disk_wcatwc
Date Written: 1/2001
Development Language: MicroSoft C/C++ v7.0
Necessary Rings:
Input Ring - WAVE_RING;
reads TYPE_TRACEBUF format messages
Necessary Data Files:
StaFile - picker
configuration file
StaDataFile - seismometer
location, elevation, etc.
Disk file path and suffix must also be
provided for output files.
Initialization File:
disk_wcatwc.d
- read on module start-up
Module Description:
This module writes raw trace data to disk files. All data (from the
stations listed in StaFile) will be written to disk. The data is written in a
format used by the West Coast/Alaska Tsunami Warning Center's seismic analysis
software called ANALYZE, the event simulator atplayer, and by earthworm module
hypo_display. The format can be summarized as:
structure DISKHEADER;
structure CHNLHEADER * iNumStations;
chn 0 samp0, chn 0 samp1, ... chn 0 lNumSamps-1;
chn 1 samp0, chn 1 samp1, ... chn 1 lNumSamps-1;
.
.
.
chn NSta-1 samp0, chn NSta-1 samp1, ... chn NSta-1 lNumSamps-1
The DISKHEADER and CHNLHEADER structures are described in Section 4.1.3.1.
Data from all stations are written to the same file. The file length (in
minutes) is specifiable in the .d file. File lengths must be an integer value
of minutes. The first sample from the file (Samp0) is the first sample at or
after the start time of the file for each channel. This time is encoded in the
file name (that is, the nominal start time of the file). The exact start time
of each channel is saved in the header.
Data is written in binary, 4-byte integer format.
Data is saved at whatever sample rate it is taken off the ring with. So, any
decimation must be performed prior to placement on this module's input ring. In
practice, more than one instance of this module may be needed. For example,
data saved at the full rate may be necessary for P-picking and short period
magnitudes. But, this rate may cause disk reads to be too slow for long period
data processing where over an hour of data may be needed at once. So, the .d
file allows input of the data file name's suffix. This way long period data is
discernible by file name from short period data.
Data files are created and initialized with headers and zeroes when the first
packet of data arrives that should be placed in the file. Headers are updated
as more data arrives and the data is patched in the correct section of file. File names are based on the start time of the
data within that file. A new subdirectory
is created for each day. The
subdirectory form is x:\path\d980522 where 98 is the last two digits of the
year, 05 is the month (1=January), and 22 is the day. All files with data for this day are located
in this subdirectory. The file names are
given in the form x:\path\d980522\s5n2328.s98 where s=seismic, 5=month (a=10,
etc.), n=day (a=10, b=11, etc.), 23=hour, 29=minute, s=high frequency data, and
98=the last two digits of the year.
A thread called CircDeleteThread deletes files older than a set number of
hours. This prevents disk overload.
NOTE: This module will only work under Windows. The functions necessary in
CircDeleteThread are Windows specific.
Graphical Interface:
This module has no graphical interface. Some errors are logged to the
Windows console, if created.