Proposed PSN Type 4 Format

Created: 6/17/00  Last Updated: 6/18/00

General Layout of the Event File:

The event file would be broken up into 4 sections. They are:

Structures Used to Hold Data:

Volume Files:

Volume files contain two or more event files.


Fixed Header:

Structure Length: ????

Field  Name

Type / Length

Explanation

File ID and Version

8 chars

Contain the following characters: "PSNTYPE4"

Variable Header Length

2 bytes (short) 

Length in bytes of the variable length section of the header

 Start Time

DateTime

Start time of the event file. See below for the format of DateTime

Sample Rate 

float

Data sampling rate in samples per second
Data Count long  Number of data points in the data section
Flags 2 bytes (short) General purpose flags; 0x0001 = NO CRC16
Timing Ref. Type 2 chars Timing reference used; GP = GPS, WV=WWV, WB=WWVB
Data Type 1 byte Specifies the data format (0=16 bit integer , 1=32 integer, 2=float)
Data Compression 1 byte 0=None 1=????
Data Minimum  float Minimum value in the data array
Data Maximum  float Maximum value in the data array
Data Mean Value float Mean value of the data array
Component Incident float Sensor's incidence angle in degrees with respect to the vertical
Component Azimuth  float Sensor's azimuth angle in degrees with respect to the north through east
Component Orientation 1 char Origination character: Z, N or E
Sensor Latitude float Sensor's latitude, in decimal degrees
Sensor Longitude float Sensor's longitude, in decimal degrees
Sensor Elevation float Sensor's elevation in meters above or below sea level
Sensor Name 6 chars Sensor's 3 to 6 letter designation
Sensor Network 6 chars Sensor's network affiliation
Sensor Output  1 char 0 or ? = Unknown, A=Acceleration, V=Velocity, D=Displacement
Sensitivity double Sensitivity of the sensor
Magnitude Correction double WinQuake magnitude correction number
Event Information EventInfo Information about the first event in the seismogram; See below for structure format
More fixed fields would go here....

Variable Length Header Section:

This section would contain variable length header fields. It can also be used to add new fields not supported in the fixed section of the header. The last field would have a descriptor and data length of 0 (zero) indicating end of header. The length of this section is located in the fixed section field "Variable Header Length". So that the data start on an even byte boundary each data field should be even in length.

Each field would have the following format:

Name

Length

Explanation

Descriptor ID 1 byte Field descriptor ID number; See table below 
Field Length 1 byte Data length (including descriptor) of the field. Data and strings are limited to 254 bytes. 
Field Data 2 to 254 bytes Data for the field

 

Descriptor ID

Field Type

0 End record. Last variable length header record. Data length must be 0
1 Comment string  (null terminated)
2 Sensor location string (null terminated)
3 Sensor type string; e.g. Lehman, 4.5 hz geophone etc (null terminated)
4 Additional events in the seismogram; stored in a EventInfo structure. The first event would be in the fixed section. 
5 Phase pick stored in a PhasePick structure; See below for the format
.... Other data fields..... 

Data Section:

Data begins after the fixed and variable sections of the header. Data can be 16 bit integer, 32 bit integer or floating point.   


CRC-16:

The last two bytes of the event file would contain the CRC-16 (Cyclic Redundancy Check). This can be used to verify the integrity of the headers and data. If the NO CRC flag is set in the flags section of the fixed header the last two bytes of the file should be set to 0 (zero).


Data Structures

DateTime Structure:

Structure Length: 10 bytes

Field Name Type / Length Explanation
Year 2 bytes (short) Year e.g. 2000
Month byte Month, Jan=1, Dec=12 
Day byte Day of the month, 1 to 31
Hour byte Hour of the day, between 0 and 23
Minute byte Minute of the hour, between 0 and 59
Seconds byte Second of the minute, between 0 and 59
Flags char Status character; For start time field would hold the SDR lock status character (L or ?)
Millisecond short Millisecond of the second, between 0 and 999

 

EventInfo Structure:

Structure Length: 42 bytes

Field Name Type / Length Explanation
Event Time DateTime Absolute time of origin of the event
Event Latitude float Event latitude
Event Longitude float Event longitude
Event Depth  float Event depth in km
Event Magnitude - Ms 2 bytes (short) Event Ms magnitude; magnitude = data field / 100
Event Magnitude - Mb 2 bytes (short) Event Mb magnitude
Event Magnitude - Mw 2 bytes (short) Event Mw magnitude
Event Magnitude - Ml 2 bytes (short) Event Ml magnitude
Event Magnitude - Md 2 bytes (short) Event Md magnitude
Event Magnitude - Other 2 bytes (short) Event magnitude other then above
Event Type Code 1 byte Event Types: 0 = unknown, 1 = earthquake, 2 = nuclear explosion, 3 = quarry blast, 4 = other explosion 
Event Location Quality 1 char Location quality 
Reporting Agency 6 chars Reporting agency code 

PhasePick Structure:

Structure Length: 38 bytes 

Field Name Type / Length Explanation
Start Time DateTime Absolute time of the phase pick
Phase Name 8 chars Phase name e.g. P, S, Pp etc.
Display Y Location 2 bytes (short) Used to position the marker on the screen
Travel Time File Name 16 chars Table used for phase travel time calculation
Table Depth 2 bytes (short) Depth used for phase travel time calculation

Volume File:

A volume file would contain two or more PSN Type 4 event records. 

Field Name Type / Length Explanation
Volume ID and Version 10 chars Contains the following characters: "PSNVOLUME1"
Number Event Records 2 bytes (short) Number of event records in the volume file
Event records....  Variable  Two or more event records follow the 12 byte header

 

-Larry Cochrane