get_event
Called by: get_data
Includes: iscloc.h
Input arguments: Pointer to event structure.
Calls: sql_error in oracle_funcs
Structure members updated:
numhyps, numphas, prime, and isc_hypid in event structure.
Return: 0/1 for success/failure.
Written in ORACLE Pro*C this function needs to be precompiled to get C code.
This function uses the value of evid stored in the event structure by read_instruction to select data from the ISC database. It loops over all rows in the HYPOCENTER table with this evid to get the hypid of the ISC hypocentre for this event, if there is one. If there is then this hypid is stored both as isc_hypid and prime. Otherwise prime is selected from the appropriate row of the EVENT table, prime is not taken from the EVENT table if there is an ISC hypocentre because there are rare cases where the ISC hypocentre will not be prime but will still have all the ISC associations made with it.
This function then counts the number of rows in the HYPOCENTER table that have the required evid to set numhyps and the number of phases in the ASSOCIATION table that have hypid = prime to set numphas