contents

read_isf_event

Called by:   main for each event that is requested with a filename on the instruction line.

Includes:   iscloc.h, isf_bul.h

External:
MAXSTA, the maximum allowed number of station codes.
Definition of sta_rec structure to hold station location information.
Array of sta_rec structures, stalist.
The number of rows in the stalist array, numsta.

Input arguments:
File pointer to ISF data.
Pointer to event structure.
Pointer to the address of the hypocentre structure array.
Pointer to the address of the phase structure array.

Calls:
Function read_stafile
Functions join_time and print_pha from utils
Functions from isf_read.

Structure members updated:
evid, numhyps and numphas in event structure.
time, lat, lon, depth, depfix, epifix, timfix, nsta, ndefsta, ndef, mindist, maxdist, azimgap, etype, agency, minax, majax, theta, stime, sdepth, sdobs in hypocentre structures.
hypid, phid, rdid, pref_rd, time, init, rep_phase, net, sta, slow, azim, comp, sp_fm, detchar, sta_lat, sta_lon, sta_elev, dircos, and a in phase structures.

Return:   0/1 for success/failure.

This function reads an ISF bulletin format file one line at a time and sends the lines to functions from read_isf, part of a collection of ISF utilities written separately from iscloc.  It stores hypocentre and phase parameters in temporary arrays until it is known how many of each are included in the event.  Memory is then allocated for arrays of the correct number of hypocentre and phase structures and the values copied to the members of these structures.

Note that the phases in the event are taken as being associated with the top hypocentre.  This means that, unless they are given in the origin block, the top hypocentre will be the only one to have values for ndefsta, ndef, mindist, and azimgap and that it will very likely be chosen by rank_hyp as the first seed unless the operator instructs otherwise.

The first time that this function is called (i.e. the first time that an event is read in from file, rather than the database) a function read_stafile is called, which fills an external array of station information structures and allows phase members sta_lat, sta_lon and sta_elev to be assigned by this function without connecting to the database.