source: SH_SHM/trunk/util/check_evt.c @ 191

Revision 191, 19.6 KB checked in by marcus, 13 years ago (diff)

r110 | svn | 2010-01-28 22:21:20 +0100 (Do, 28 Jan 2010) | 1 line

added checks for teleseismic depths in check_evt (depth 33 if no depth phases); new stations HAN7-9; added locations for I26H6-8

Line 
1
2/* file check_evt.c
3 *      ===========
4 *
5 * version 10, 16-Jan-2007
6 *
7 * Checks consistency of created output file of SHM
8 * K. Stammler, 21-Jul-94
9 */
10
11
12/*
13 *
14 *  SeismicHandler, seismic analysis software
15 *  Copyright (C) 1996,  Klaus Stammler, Federal Institute for Geosciences
16 *                                       and Natural Resources (BGR), Germany
17 *
18 *  This program is free software; you can redistribute it and/or modify
19 *  it under the terms of the GNU General Public License as published by
20 *  the Free Software Foundation; either version 2 of the License, or
21 *  (at your option) any later version.
22 *
23 *  This program is distributed in the hope that it will be useful,
24 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26 *  GNU General Public License for more details.
27 *
28 *  You should have received a copy of the GNU General Public License
29 *  along with this program; if not, write to the Free Software
30 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
31 *
32 */
33
34
35
36#include <stdio.h>
37#include <string.h>
38#include <stdlib.h>
39#include BASECNST
40#include BC_SYSBASE
41#include "eventdsc.h"
42#include "tcusrdef.h"
43#include "earthloc.h"
44
45
46#define MAX_PKP_SLOWNESS 4.5
47#define MIN_P_SLOWNESS 4.3
48
49#define EVTYPE_UNDEF 0
50#define EVTYPE_LOCAL 1
51#define EVTYPE_P     2
52#define EVTYPE_PKP   3
53
54/* next error number currently 031 */
55
56
57
58/* global variables */
59static float   efv_reflat=49.0;           /* reference latitude */
60static float   efv_reflon=11.0;           /* reference longitude */
61static char    efv_infile[BC_FILELTH+1];  /* name of input file */
62static char    efv_uncorrphase[EvPHASELTH+1]; /* name of phase on uncorr beam */
63static BOOLEAN efv_first_arrival=FALSE;   /* first arrival phase selected */
64static BOOLEAN efv_only_grf=TRUE;         /* only GRF stations used */
65static BOOLEAN efv_gra1_picked=FALSE;     /* pick on GRA1 found */
66static BOOLEAN efv_uncorr_loc=FALSE;      /* uncorrected beam for location */
67static BOOLEAN efv_telex_phase=FALSE;     /* telex phase found */
68static BOOLEAN efv_mb_found=FALSE;        /* mb determination done */
69static BOOLEAN efv_ms_found=FALSE;        /* ms determination done */
70static BOOLEAN efv_mbb_found=FALSE;       /* mbb determination done */
71static BOOLEAN efv_depth_phase_found=FALSE;/* depth phase found? */
72static int     efv_subtype=EVTYPE_UNDEF;  /* event type */
73static EvEventTypeT efv_evtype=EvcEventTypeUndefined; /* event type */
74static float   efv_depth=(-100.0);        /* depth of event */
75static float   efv_magn=0.0;              /* max. magnitude found */
76static int     efv_pkp_count=0;           /* number of PKP phases */
77static BOOLEAN efv_illegal_origin;        /* illegal origin time */
78static BOOLEAN efv_foundPg=FALSE;         /* Pg phase found */
79static BOOLEAN efv_foundPnSn=FALSE;       /* Pn/Sn found */
80static BOOLEAN efv_foundTele=FALSE;       /* teleseismic phase found */
81static float   efv_latitude=0.0;          /* epicentre latitude */
82static float   efv_longitude=0.0;         /* epicentre longitude */
83static char    efv_analyst[EvANALYSTLTH+1]=""; /* analysts initials */
84static BOOLEAN efv_showinitials=FALSE;    /* show initials */
85
86
87/* prototypes of local routines */
88void EfPutCheck( FILE *out, EvEventT *event, EvStatusT *status );
89static BOOLEAN EfPhaseIsFirstArrival( char name[] );
90static void EfFinalCheck( FILE *out );
91static BOOLEAN EfIsLocalPhase( char phase[] );
92
93
94
95int main( int argc, char *argv[] )
96{
97        /* local variables */
98        char      infile[BC_FILELTH+1];    /* input file */
99        char      outfile[BC_FILELTH+1];   /* output file */
100        EvStatusT status;                  /* return status */
101        int       i;                       /* counter */
102    char      tmpstr[cBcLongStrLth+1]; /* scratch string */
103
104        /* executable code */
105
106        if  (argc < 2)  {
107                fprintf( stderr, "Usage: %s <input> [<output>] [<showinitials>]\n",
108                        argv[0] );
109                return 1;
110        } /*endif*/
111
112        strcpy( infile, argv[1] );
113        if  (argc > 2)  {
114                strcpy( outfile, argv[2] );
115                if  (*outfile == '\0')
116                        strcpy( outfile, "TT" );
117        } else {
118                strcpy( outfile, "TT" );
119        } /*endif*/
120        efv_showinitials = FALSE;
121        if  (argc > 3)
122                efv_showinitials = (strcmp(argv[3],"showinitials") == 0);
123
124#ifdef XXX
125        /* efv_infile is used for messages, directory will be removed */
126        i = strlen( infile ) - 1;
127        while  (infile[i] != '/' && i > 0)
128                i--;
129        strcpy( efv_infile, infile+i );
130#endif
131    strcpy( efv_infile, infile );
132
133        status = EveNOERROR;
134        EvReformatEventfile( infile, outfile, EvGetEvent,
135                EfPutCheck, &status );
136
137    /* now call the Python script for additional checks */
138    if  (strcmp(outfile,"TT") == 0)  {
139        sprintf( tmpstr, "%s/CheckEvt.py %s", (char *)getenv("SH_UTIL"),
140            efv_infile );
141        system( tmpstr );
142    } else {
143        sprintf( tmpstr, "%s/CheckEvt.py %s %s", (char *)getenv("SH_UTIL"),
144            efv_infile, outfile );
145        system( tmpstr );
146    } /*endif*/
147
148        return 0;
149
150} /* end of main */
151
152
153
154/*---------------------------------------------------------------------------*/
155
156
157
158void EfPutCheck( FILE *out, EvEventT *event, EvStatusT *status )
159
160/* Prints error messages of event to file 'out'.
161 *
162 * parameters of routine
163 * FILE       *out;          input; output file
164 * EvEventT   *event;        input; event information
165 * EvStatusT  *status;       output; return status
166 */
167{
168        /* local variables */
169        static BOOLEAN locqual_checked=FALSE; /* location quality checked ? */
170        BOOLEAN  amplitude_measured;      /* amplitude measured */
171        BOOLEAN  is_l_phase;              /* phase is L (or (L)) */
172        BOOLEAN  is_pkp_phase;            /* phase is PKP */
173        BOOLEAN  is_p_phase;              /* phase is P or (P) */
174        BOOLEAN  loc_given;               /* location given in this record */
175        NTIME    ntime;                   /* numeric origin time */
176
177        /* executable code */
178
179        /* final check if event is NULL */
180        if  (event == NULL)  {
181                EfFinalCheck( out );
182                locqual_checked = FALSE;
183                return;
184        } /*endif*/
185
186        /* fprintf( out, "--> check phase %s\n", event->phase ); */
187
188        /* is a location given here ? */
189        loc_given = (event->latitude > 0.0 && event->longitude > 0.0);
190        if  (loc_given)  {
191                efv_latitude = event->latitude;
192                efv_longitude = event->longitude;
193        } /*endif*/
194
195        /* is this an L phase ? */
196        is_l_phase = (strcmp(event->phase,"L") == 0
197                || strcmp(event->phase,"(L)") == 0);
198
199        /* is this a P phase ? */
200        is_p_phase = (strcmp(event->phase,"P") == 0
201                || strcmp(event->phase,"(P)") == 0);
202
203        /* is this a PKP phase ? */
204        is_pkp_phase = (strstr(event->phase,"PKP") != NULL);
205        if  (is_pkp_phase)
206                efv_foundTele = TRUE;
207
208        /* is it a depth phase ? */
209        if (event->phase[0] == 'p' || event->phase[0] == 's')
210                efv_depth_phase_found = TRUE;
211        /* or from foreign source */
212        if (event->source[0] != '\0' && (strcmp(event->source,"BGR") != 0)
213                && (strcmp(event->source,"SZGRF") != 0))
214                efv_depth_phase_found = TRUE;  /* assume that the other source has one*/
215
216    /* is this a leftover from an amplitude measurement? */
217    if  (strncmp(event->phase,"w-",2) == 0)
218                fprintf( out, "F012 %s: illegal phase %s found on %s\n",
219                        efv_infile, event->phase, event->station );
220       
221
222        /* a depth phase can found only in teleseismic events */
223        if  (event->phase[0] == 'p' || event->phase[0] == 's')
224                efv_foundTele = TRUE;
225
226        /* check for local and regional phases */
227        if  (strcmp(event->phase,"Pg") == 0)
228                efv_foundPg = TRUE;
229        if  (strcmp(event->phase,"Pn") == 0)
230                efv_foundPnSn = TRUE;
231        if  (strcmp(event->phase,"Sn") == 0)
232                efv_foundPnSn = TRUE;
233
234        if  (event->event_type != EvcEventTypeUndefined)
235                efv_evtype = event->event_type;
236
237        /* setup global variables used in final check */
238        /* ------------------------------------------ */
239
240        /* is it a GRF station ? */
241        if  (strncmp(event->station,"GR",2) != 0
242                || event->station[2] < 'A' || event->station[2] > 'C')
243                efv_only_grf = FALSE;
244        if  (strcmp(event->station,"GRA1") == 0)
245                efv_gra1_picked = TRUE;
246
247        /* is a first arrival phase there ? */
248        if  (EfPhaseIsFirstArrival(event->phase))
249                efv_first_arrival = TRUE;
250
251        /* is there a location done with uncorrected beam ? */
252        if  ((loc_given && event->b_slowness != EvEMPTY_SLOWNESS &&
253                event->l_slowness == EvEMPTY_SLOWNESS
254                && event->loc_quality == EvcLocQualReliable
255                && strcmp(event->source,"SZGRF") == 0)
256                || (event->loc_method == EvcLocMethUncorrBeam))  {
257                efv_uncorr_loc = TRUE;
258                strcpy( efv_uncorrphase, event->phase );
259        } /*endif*/
260
261        /* is there an origin time from 1970? */
262        if  (loc_given)  {
263                tc_t2n( event->origin_time, &ntime, status );
264                if  (SySevere(status))  {
265                        efv_illegal_origin = TRUE;
266                } else if  (ntime.year == 1970)  {
267                        efv_illegal_origin = TRUE;
268                } /*endif*/
269        } /*endif*/
270
271        /* look for telex phase */
272        if  (strchr(event->phase_flags,EvFLAG_TELEX) != NULL)
273                efv_telex_phase = TRUE;
274
275        /* look for depth */
276        if  (efv_depth < -99.0 && event->depth_type != EvcDepthUndefined)
277                efv_depth = event->depth;
278
279        /* find plain mistakes */
280        /* ------------------- */
281
282        /* special for L phases */
283        if  (is_l_phase)  {
284                /* is there an impulsive L phase ? */
285                if  (event->onset_type == EvcOnsetImpulsive)
286                        fprintf( out, "F001 %s: phase L with impulsive onset\n", efv_infile );
287                /* is a legal filter used ? */
288                if  (strcmp(event->filter,"G_WWSSN_SP") == 0
289                        || strcmp(event->filter,"STANDARD_BP") == 0
290                        || event->filter[0] == '\0')
291                        fprintf( out, "F002 %s: L phase reading with illegal filter %s\n",
292                                efv_infile, event->filter );
293                /* is there slowness and azimuth ? if yes that's real nonsense */
294                if  (event->b_slowness != EvEMPTY_SLOWNESS
295                        || event->b_azimuth != EvEMPTY_AZIMUTH
296                        || event->l_slowness != EvEMPTY_SLOWNESS
297                        || event->l_azimuth != EvEMPTY_AZIMUTH)
298                        fprintf( out, "F003 %s: slowness and/or azimuth for phase %s\n",
299                                efv_infile, event->phase );
300                /* is amplitude & period determined ? */
301                if  (event->amplitude == EvEMPTY_AMPLITUDE
302                        || event->period == EvEMPTY_PERIOD)
303                        fprintf( out, "F004 %s: no amplitude / period for phase %s\n",
304                                efv_infile, event->phase );
305        } /*endif*/
306
307        if  (is_pkp_phase)  {
308                /* check slowness range */
309                if  (event->b_slowness != EvEMPTY_SLOWNESS
310                        && event->b_slowness > MAX_PKP_SLOWNESS)
311                        fprintf( out, "F005 %s: illegal beam slowness %3.1f for phase %s\n",
312                                efv_infile, event->b_slowness, event->phase );
313                if  (event->l_slowness != EvEMPTY_SLOWNESS
314                        && event->l_slowness > MAX_PKP_SLOWNESS)
315                        fprintf( out, "F006 %s: illegal corr. slowness %3.1f for phase %s\n",
316                                efv_infile, event->l_slowness, event->phase );
317                efv_subtype = EVTYPE_PKP;
318                efv_pkp_count++;
319        } /*endif*/
320
321        if  (is_p_phase)  {
322                /* check slowness range */
323                if  (event->b_slowness != EvEMPTY_SLOWNESS
324                        && event->b_slowness < MIN_P_SLOWNESS)
325                        if  (event->l_slowness == EvEMPTY_SLOWNESS)
326                                fprintf( out, "F007 %s: illegal beam slowness %3.1f for phase %s\n",
327                                        efv_infile, event->b_slowness, event->phase );
328                if  (event->l_slowness != EvEMPTY_SLOWNESS
329                        && event->l_slowness < MIN_P_SLOWNESS)
330                        fprintf( out, "F008 %s: illegal corr. slowness %3.1f for phase %s\n",
331                                efv_infile, event->l_slowness, event->phase );
332                efv_subtype = EVTYPE_P;
333        } /*endif*/
334
335        if  (EfIsLocalPhase(event->phase))  efv_subtype = EVTYPE_LOCAL;
336
337        /* amplitude measurement must be complete */
338        amplitude_measured = (event->period != EvEMPTY_PERIOD
339                || event->amplitude != EvEMPTY_AMPLITUDE
340                || event->amplitude_time != EvEMPTY_AMPLITUDE_TIME
341                || event->amplitude_vel != EvEMPTY_AMPLITUDE);
342        if  (amplitude_measured)
343                if  (event->period == EvEMPTY_PERIOD
344                        || event->amplitude == EvEMPTY_AMPLITUDE
345                        || (event->amplitude_time == EvEMPTY_AMPLITUDE_TIME && !is_l_phase)
346                        || event->amplitude_vel == EvEMPTY_AMPLITUDE
347                        || event->ap_source == EvcApSourceUndefined)
348                        fprintf( out,
349                                "F009 %s: incomplete amplitude determination at phase %s, station %s\n",
350                                efv_infile, event->phase, event->station );
351
352        /* check for magnitudes determined */
353        if  (event->mag[EvcMagMb] != EvEMPTY_MAGNITUDE)  {
354                efv_mb_found = TRUE;
355                if  (event->mag[EvcMagMb] > efv_magn)  efv_magn = event->mag[EvcMagMb];
356        } /*endif*/
357        if  (event->mag[EvcMagMs] != EvEMPTY_MAGNITUDE)  {
358                efv_ms_found = TRUE;
359                if  (event->mag[EvcMagMs] > efv_magn)  efv_magn = event->mag[EvcMagMs];
360        } /*endif*/
361        if  (event->mag[EvcMagMbb] != EvEMPTY_MAGNITUDE) efv_mbb_found = TRUE;
362
363        /* magnitudes mb,MS are valid only with amplitude */
364        if  (event->mag[EvcMagMs] != EvEMPTY_MAGNITUDE
365                || event->mag[EvcMagMb] != EvEMPTY_MAGNITUDE)
366                if  (!amplitude_measured)
367                        fprintf( out, "F010 %s: magnitude without amplitude on phase %s\n",
368                                efv_infile, event->phase );
369
370        /* a reliable location with PKP is not possible */
371        if  (event->loc_quality == EvcLocQualReliable && is_pkp_phase
372                && strcmp(event->source,"SZGRF") == 0 && loc_given)
373                fprintf( out, "F011 %s: reliable location with phase %s not possible\n",
374                        efv_infile, event->phase );
375
376        /* event type tele and local phases Pn, Pg, Sn, Sg */
377        if  (event->event_type == EvcEventTypeTeleQuake
378                && EfIsLocalPhase(event->phase))
379                fprintf( out, "F012 %s: incompatible event type TELE with phase %s\n",
380                        efv_infile, event->phase );
381
382        /* is there a location quality specified in the first phase ? */
383        if  (loc_given && !locqual_checked && event->phase[0] != '\0')  {
384                if  (event->loc_quality == EvcLocQualUndefined)
385                        fprintf( out, "F013 %s: no location quality specified\n", efv_infile );
386                locqual_checked = TRUE;
387        } /*endif*/
388
389        if  (event->analyst[0] != '\0')
390                strcpy( efv_analyst, event->analyst );
391
392} /* end of EfPutCheck */
393
394
395
396/*---------------------------------------------------------------------------*/
397
398
399
400static BOOLEAN EfPhaseIsFirstArrival( char name[] )
401
402/* Checks whether phase is first arrival
403 *
404 * parameters of routine
405 * char       name[];        input; name of phase
406 *                           returns TRUE if phase is possible first arrival
407 */
408{
409        /* executable code */
410
411        if  (strcmp(name,"P") == 0)  return TRUE;
412        if  (strcmp(name,"(P)") == 0)  return TRUE;
413        if  (strncmp(name,"PKP",3) == 0)  return TRUE;
414        if  (strncmp(name,"(PKP",4) == 0)  return TRUE;
415        if  (strncmp(name,"Pn",2) == 0)  return TRUE;
416        if  (strncmp(name,"Pg",2) == 0)  return TRUE;
417        if  (strcmp(name,"(Pn)") == 0)  return TRUE;
418        if  (strcmp(name,"(Pg)") == 0)  return TRUE;
419        if  (strcmp(name,"Pdiff") == 0)  return TRUE;
420        if  (strcmp(name,"(Pdiff)") == 0)  return TRUE;
421        if  (strcmp(name,"Pdif") == 0)  return TRUE;
422        if  (strcmp(name,"(Pdif)") == 0)  return TRUE;
423
424        return FALSE;
425
426} /* end of EfPhaseIsFirstArrival */
427
428
429
430/*---------------------------------------------------------------------------*/
431
432
433
434static void EfFinalCheck( FILE *out )
435
436/* Prints result of final check to output file 'out'
437 *
438 * parameters of routine
439 * FILE       *out;         input; pointer to output file
440 */
441{
442        /* local variables */
443        char     expl[cBcLongStrLth+1];   /* explanation string */
444
445        /* executable code */
446
447        /* fprintf( out, "--> final check\n" ); */
448        if  (efv_showinitials)
449                sprintf( expl, "%s (%s)", efv_infile, efv_analyst );
450        else
451                strcpy( expl, efv_infile );
452
453        /* a first arrival must be specified */
454        if  (!efv_first_arrival)
455                fprintf( out, "F014 %s: no first arrival phase selected\n", expl );
456
457        /* beam with uncorrected slowness at GRF is at least suspicious */
458        if  (efv_only_grf && efv_uncorr_loc)
459                fprintf( out, "F015 %s: GRF location with uncorrected beam at phase %s\n",
460                        expl, efv_uncorrphase );
461
462        /* only GRF picked but no GRA1? */
463        if  (efv_only_grf && !efv_gra1_picked)
464                fprintf( out, "F035 %s: only GRF picks but none at GRA1\n", expl );
465
466        /* no telex phase */
467        /* disabled 12-Nov-2008 K.S.
468        if  (!efv_telex_phase)
469                fprintf( out, "F016 %s: no telex phase found\n", expl );
470        */
471
472        /* mb determined? */
473        if  (efv_subtype == EVTYPE_P && !efv_mb_found)
474                fprintf( out, "F017 %s: no Magnitude mb determined for P phase\n", expl );
475
476        /* Ms determined? */
477        if  (efv_subtype >= EVTYPE_P && efv_depth <= 50.0 && efv_magn > 5.6 &&
478                !efv_ms_found)
479                fprintf( out, "F018 %s: no Magnitude Ms determined for magn %3.1f event\n",
480                        expl, efv_magn );
481        if  (efv_subtype == EVTYPE_PKP && efv_depth <= 50.0 && efv_pkp_count > 3 &&
482                !efv_ms_found)
483                fprintf( out, "F019 %s: no Magnitude Ms determined for PKP event\n",
484                        expl );
485        if  (efv_ms_found && efv_depth > 50.0)
486                fprintf( out, "F020 %s: Magnitude Ms determined for depth %5.1f event\n",
487                        expl, efv_depth );
488
489        /* Mbb determined? */
490        if  (efv_mb_found && efv_magn > 6.2 && !efv_mbb_found)
491                fprintf( out, "F021 %s: no Broadband Magnitude determined for magn %3.1f event\n",
492                        expl, efv_magn );
493
494        /* depth ok? */
495        if  (efv_evtype == EvcEventTypeMining && Abs(efv_depth-1.0) > 0.1)
496                fprintf( out, "F022 %s: depth %5.1f given for mining event\n",
497                        expl, efv_depth );
498        if  (efv_evtype == EvcEventTypeBlast && Abs(efv_depth) > 0.1)
499                fprintf( out, "F023 %s: depth %5.1f given for blast\n",
500                        expl, efv_depth );
501        if  (efv_evtype == EvcEventTypeTeleQuake && (efv_depth < 10.0))
502                fprintf( out, "F026 %s: depth %5.1f for teleseismic event\n",
503                        expl, efv_depth );
504        if  (efv_evtype == EvcEventTypeTeleQuake && !efv_depth_phase_found
505                && ((efv_depth-33.0) > 0.01))
506                fprintf( out, "F037 %s: depth %5.1f for teleseismic event without depth phases\n",
507                        expl, efv_depth );
508        if  ((efv_evtype == EvcEventTypeLocalQuake
509                || efv_evtype == EvcEventTypeRegioQuake) && (efv_depth < 2.0))
510                fprintf( out, "F027 %s: depth %5.1f for local/regional event\n",
511                        expl, efv_depth );
512        if  (efv_evtype == EvcEventTypeLocalQuake && efv_depth > 50.0)
513                fprintf( out, "F036 %s: depth %5.1f given for local event\n",
514                        expl, efv_depth );
515        if  (efv_evtype == EvcEventTypeUndefined)
516                fprintf( out, "F024 %s: no event type specified\n", expl );
517        if  (efv_depth < -99.0)
518                fprintf( out, "F025 %s: no depth specified\n", expl );
519
520        /* proper event type? */
521        if  (efv_foundPg && efv_evtype == EvcEventTypeTeleQuake)
522                fprintf( out, "F028 %s: improper teleseismic event type: found Pg\n",
523                        expl );
524        if  (efv_foundPnSn && efv_evtype == EvcEventTypeTeleQuake)
525                fprintf( out, "F029 %s: improper teleseismic event type: found Pn/Sn\n",
526                        expl );
527        if  (efv_foundTele && efv_evtype == EvcEventTypeLocalQuake)
528                fprintf( out, "F030 %s: improper local event type: found tele phase\n",
529                        expl );
530        if  (efv_foundTele && efv_evtype == EvcEventTypeRegioQuake)
531                fprintf( out, "F031 %s: improper regional event type: found tele phase\n",
532                        expl );
533
534        /* check distance and event type */
535        if  (efv_latitude != 0.0 || efv_longitude != 0.0)  {
536                double dist, azim, bazim;   /* result of distance computation */
537                float fdist;    /* single precision distance */
538                mb_locdiff( (double)efv_reflat, (double)efv_reflon, (double)efv_latitude,
539                        (double)efv_longitude, &dist, &azim, &bazim );
540                fdist = dist;
541                if  (dist > 15.0 && efv_evtype == EvcEventTypeLocalQuake)
542                        fprintf( out, "F032 %s: improper local event type (distance %f deg)\n",
543                                expl, dist );
544                if  (dist > 30.0 && efv_evtype == EvcEventTypeRegioQuake)
545                        fprintf( out, "F033 %s: improper regional event type (distance %f deg)\n",
546                                expl, dist );
547                if  (dist < 25.0 && efv_evtype == EvcEventTypeTeleQuake)
548                        fprintf( out, "F034 %s: improper teleseismic event type (distance %f deg)\n",
549                                expl, dist );
550        } /*endif*/
551
552} /* end of EfFInalCheck */
553
554
555
556/*---------------------------------------------------------------------------*/
557
558
559
560static BOOLEAN EfIsLocalPhase( char phase[] )
561
562/* checks whether 'phase' is a local phase
563 *
564 * parameters of routine
565 * char       phase[];         input; phase name
566 */
567{
568        /* local variables */
569
570        /* executable code */
571
572        if  (strcmp(phase,"Pg") == 0)  return TRUE;
573        if  (strcmp(phase,"Pn") == 0)  return TRUE;
574        if  (strcmp(phase,"Sg") == 0)  return TRUE;
575        if  (strcmp(phase,"Sn") == 0)  return TRUE;
576        if  (strcmp(phase,"(Pg)") == 0)  return TRUE;
577        if  (strcmp(phase,"(Pn)") == 0)  return TRUE;
578        if  (strcmp(phase,"(Sg)") == 0)  return TRUE;
579        if  (strcmp(phase,"(Sn)") == 0)  return TRUE;
580
581        return FALSE;
582
583} /* end of EfIsLocalPhase */
584
585
586
587/*---------------------------------------------------------------------------*/
588
Note: See TracBrowser for help on using the repository browser.