obsplus.events.validate module

Functions for validating events according to the obsplus flavor.

obsplus.events.validate.attach_all_resource_ids(event)[source]

recurse all objects in a events and set referred objects

obsplus.events.validate.check_amp_filter_ids(event, filter_ids=None)[source]

Check that all amplitudes have codes in filter_ids.

obsplus.events.validate.check_amp_lims(event, amp_lim=None)[source]

Check for amplitudes that aren’t below amp_lim (if provided).

obsplus.events.validate.check_amp_times_contain_pick_time(event)[source]

Check for amplitudes times that don’t match the referenced pick time

obsplus.events.validate.check_amps_on_z_component(event, no_z_amps=False, phase_hints=('AML', 'IAML'))[source]

Check for amplitude picks on Z channels (if no_z_amps is True).

obsplus.events.validate.check_arrivals_pick_id(event)[source]

Check that all arrivals link to a pick object, if they are not attached set the referred object attr.

obsplus.events.validate.check_duplicate_picks(event)[source]

Ensure there are no picks with the same phases on the same channels.

obsplus.events.validate.check_origins(event)[source]

check the origins and types

obsplus.events.validate.check_p_lims(event, p_lim=None)[source]

Check for P picks that aren’t within p_lim of the median pick (if provided)

obsplus.events.validate.check_pick_order(event)[source]
Ensure:
  1. There are no S picks before P picks on any station

  2. There are no amplitude picks before P picks on any station

obsplus.events.validate.set_preferred_values(event)[source]

Validator to set the preferred values to the last in the list if they are not defined.

obsplus.events.validate.validate_catalog(events, **kwargs)[source]

Perform checks on a events or event object.

This function will try to fix any issues but will raise if it cannot. It is a simple wrapper around obsplus.validate.validate for the obsplus namespace.

Parameters:

events (Union[Catalog, Event]) – The events or event to check

Return type:

Union[Catalog, Event]