calc_gap
Called by: rank_hyp once for each event.
Includes: iscloc.h
Input arguments:
Pointer to event structure.
Array of hypocentre structures.
Array of phase structures.
Calls: calc_delta
, calc_esaz, dsort from utils
Structure members updated: nsta, azimgap, and mindist in hypocentre structure.
Return: 0/1 for success/failure.
The 3 parameters nsta, azimgap, and mindist
are used to order hypocentres in the sequence that they will be used as
starting points for the solution process. These parameters may or may
not be provided by the reporting agency, depending on the format that they
use and the completeness of their reports. If any of the parameters
are not provided then they are calculated from the phases that the reporting
agency associated with their hypocentre. (This may not result in the same
values as the agency would have given, as some agencies use more phases in
their solution than they send to the ISC but is the best that can be done.)
This function loops over all the hypocentre structures for an event and checks whether nsta, azimgap, and mindist
are present for each. If any value is missing for a hypocentre then
this function loops over the phases, if any, associated by the agency that
reported this hypocentre. For each phase nsta is incremented and delta and esaz are calculated. When all the phases have been counted the azimuthal gap is calculated from the esaz values.