Ian,
Here is the "C" code WinQuake uses to check for a good PSN Type 4 event
file. It looks for a valid header ID, date, sample rate and sample count.
Currently MAX_COUNTS is set to 2097152.
-Larry Cochrane
Redwood City, PSN
/* returns TRUE is good file, FALSE if not */
int isgoodPSNType4(PSNType4 *hdr)
{
DateTime *st = &hdr->startTime;
if(strncmp(hdr->headerID, "PSNTYPE4", 8))
return(FALSE);
if(st->year < 1960 || st->year > 2200)
return(FALSE);
if(st->month < 1 || st->month > 12)
return(FALSE);
if(st->day < 1 || st->day > 31)
return(FALSE);
if(st->hour > 24 || st->minute > 60 || st->second > 60)
return(FALSE);
if(hdr->spsRate <= 0.0 || hdr->spsRate > 1000000.0)
return(FALSE);
if(hdr->sampleCount < 50 || hdr->sampleCount >= MAX_COUNTS)
return(FALSE);
return(TRUE);
}
----- Original Message -----
From: "ian"
To:
Sent: Sunday, May 13, 2001 12:49 AM
Subject: psn4 & winquake2.7
> I've written a utility to convert my raw data files to psn4 format -
> still debugging/testing. I tried to load a file I created with this
> utility, but winquake doesn't show it in the open dialogue box, it shows
> only other psn (non 4) format files I downloaded from the psn site.
>
> Obviously there is a bug(s) in my utility. What does winquake look for
> in a file before deciding to list the file in the dialogue box?
>
> The StaLta utility seems to read my generated files, I used the psn.h
> file that came with this in my own utility.
>
> I have a 0 length (none) variable header and no CRC.
>
> TIA
>
> Ian Smith
>
>
> __________________________________________________________
>
> Public Seismic Network Mailing List (PSN-L)
>
> To leave this list email PSN-L-REQUEST@.............. with
> the body of the message (first line only): unsubscribe
> See http://www.seismicnet.com/maillist.html for more information.
__________________________________________________________
Public Seismic Network Mailing List (PSN-L)
Larry Cochrane <cochrane@..............>