In an inverse problem like full-waveform inversion, there is a problem of uneven distribution and quality of data. The weights component takes care of weighing your data up or down according to what is needed.
WeightsComponent(weights_folder, communicator, component_name)[source]¶
Component dealing with station and event weights.
weights_folder (pathlib.Path) – The folder with the weight toml files.
communicator – The communicator instance.
component_name – The name of this component for the communicator.
calculate_station_weight(lat_1: float, lon_1: float, locations: numpy.ndarray)[source]¶
Calculates the weight set for a set of stations for one event
lat_1 (float) – latitude of station
lon_1 (float) – longitude of station
locations (numpy.ndarray) – array of latitudes and longitudes of other stations
weight. weight for this specific station
- Return type
change_weight_set(weight_set_name: str, weight_set: dict, events_dict: dict)[source]¶
Changes an existing weight set. Writes into a tempfile and if successful it will replace the old file with the tempfile.
Create the folder needed for weight set
weight_set_name (str) – name of weight set
create_new_weight_set(weight_set_name: str, events_dict: dict)[source]¶
Creates a new weight set.
Returns a weight_set object.
iteration_name (str) – The name of the iteration to retrieve.
Helper function returning the filename of a weight set.
weight_set (str) – Name of weight set
Returns the long form of a weight set from its short name.
weight_set_name (str) – Name of weight set
Returns a dictionary with the keys being the weight_set names and the values the weight_set filenames.
Test for existence of a weight_set.
weight_set_name (str) – The name of the weight_set.