id_pha
Called by: main
each iteration.
Includes: iscloc.h
External:
Definition of structure phase_map_rec.
Array of phase_map_rec structures, phase_map.
Number of rows in that array, NUM_PHASE_MAP.
Input arguments:
Pointer to
solution
structure.
Array of
phase
structures.
reid_phase
- a flag from the
event
structure.
Calls:
Function to reidentify phases e.g. id_jb
handle_error
from utils.c
Structure members updated:
phase
in
phase
structure.
Return: 0/1 for success/failure.
This function assigns a standard phase code to
phase
for each arrival that will be recognised by all subsequent functions.
This is initially done by looking up the value of
rep_phase
in the array of structures, phase_map, at the top of the file.
struct phase_map_rec phase_map[2] = {
{"p" , "P" },
{"P" , "P" },
}
With the phase_map above, for example, phase
would be set to "P" if rep_phase
for an arrival were either "p" or "P". Arrivals with all other
phase codes would have
phase
set to "". In addition unidentified initial phases (rep_phase
= "", init
= 1) have phase
set to "P" and secondary phases with
rep_phase
= "P" have
phase
set to "". Phases with no arrival time have
phase
set to "" as they are of no use in location.
Unless the no_reid_phase instruction has been given by the operator
the
reid_phase
flag will be set to 1. In this case each arrival that has been assigned
a non null value of
phase
will have that value checked to see if it is consistent with the distance
between the station and the source, and the source depth. This is carried
out by a function specific to the earth model in use, the function given is id_jb.