Skip to content

Allow User to toggle off rejection criteria #17

@bch0w

Description

@bch0w

Currently all window rejection criteria are evaluated in WindowSelector.select_windows(). This is good for a default cause but some criteria may be unwanted in specific research cases.

For example: rejecting on travel times may not be desired if the event and station metadata or the 1D model used to predict travel times are not accurate enough, leading to erroneous rejections.

Config file or select_windows() function should have a toggle for each rejection criteria incase advanced users want to turn things on or off.

def select_windows(self):
"""
Launch the window selection.
"""
# Fill self.ttimes.
if self.event and self.station:
self.calculate_ttimes()
self.calculate_preliminiaries()
# Perform all window selection steps.
self.initial_window_selection()
# Reject windows based on traveltime if event and station
# information is given. This will also fill self.ttimes.
if self.event and self.station:
self.reject_on_traveltimes()
else:
msg = "No rejection based on traveltime possible. Event and/or " \
"station information is not available."
logger.warning(msg)
warnings.warn(msg, PyflexWarning)
self.determine_signal_and_noise_indices()
if self.config.check_global_data_quality:
# Global data quality may preclude window selection
if not self.check_data_quality():
return []
self.reject_windows_based_on_minimum_length()
self.reject_on_minima_water_level()
self.reject_on_prominence_of_central_peak()
self.reject_on_phase_separation()
self.curtail_length_of_windows()
self.remove_duplicates()
# Call once again as curtailing might change the length of some
# windows. Very cheap so can easily be called more than once.
self.reject_windows_based_on_minimum_length()
self.reject_based_on_signal_to_noise_ratio()
self.reject_based_on_data_fit_criteria()
if self.config.resolution_strategy == "interval_scheduling":
self.schedule_weighted_intervals()
elif self.config.resolution_strategy == "merge":
self.merge_windows()
else:
raise NotImplementedError
if self.ttimes:
self.attach_phase_arrivals_to_windows()
return self.windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions