contents

get_weighting_factor

Called by:   main each iteration.

Includes:   iscloc.h

External:
Definition of structure phase_weight_rec.
Array of phase_weight_rec structures, phase_weight.
Number of rows in that array, NUM_PHASE_WEIGHTS.

Input arguments:
Array of phase structures.
Number of phases in that array.

Calls:   print_pha from utils.c if diagnostic is on.

Structure members updated:   weight_factor in phase structure.

Return:   0/1 for success/failure.

Assigns a value of weight_factor to each arrival based on the phase code, phase,  and the distance between the station where the arrival was recorded and the source, delta.  Phases with null time or phase = "" will have weight_factor set to 0, as will any phase with purged = 1.  Otherwise the value of weight_factor assigned will depend on whether phase is present in the phase_weight array and if it is on the corrsponding values of delta1, delta2  and weight_factor.

struct phase_weight_rec phase_weight[2] = {
    { "P",  0, 20, 1 },
    { "P",  20, 100, 0.5 },
}


Would weight local P arrivals fully while weighting down teleseismic P.  A P arrival from a source more than 100 degrees away would not get a weight and neither would any other type of arrival.