contents

calc_netmag

Called by:  main

Includes:   iscloc.h

External:  mag_range_warn_thresh set in read_config.

Input arguments:
Pointer to solution structure.
Pointer to array of phase structures.

Calls:  Functions calc_sta_mb and calc_sta_ms.

Structure members updated:
bodymag, surfmag, nsta_mb, nsta_ms in the solution structure.

Return:   0/1 for success/failure.

This function loops over all associated phases calling calc_sta_mb for each phase and calc_sta_ms for each reading.  Any station magnitudes found are averaged to give two network magnitudes, one for body waves and the other for surface waves.  These two averages are stored, along with the number of stations that contribute to them, in the solution structure for output to file or database.  If the difference between the two magnitudes is greater than the number entered in the configuration file as mag_range_warn_thresh then a warning is written to the logfile output stream.