es_sfgtools.workflows.modeling.garpos_handler module
GarposHandler class for processing and preparing shot data for the GARPOS model.
- class es_sfgtools.workflows.modeling.garpos_handler.GarposHandler(directory_handler: DirectoryHandler, station_metadata: Site)
Bases:
WorkflowABCHandles the processing and preparation of shot data for the GARPOS model.
This class provides a high-level interface for running the GARPOS model, including data preparation, setting parameters, and processing results.
- directory_handler
Handles the directory structure.
- Type:
- network
The network name.
- Type:
str
- station
The station name.
- Type:
str
- coord_transformer
Coordinate transformer for the site.
- Type:
- garpos_fixed
Fixed parameters for the GARPOS model.
- Type:
- sound_speed_path
Path to the sound speed profile file.
- Type:
Path
- mid_process_workflow: bool = True
- plot_ts_results(survey_id: str = None, run_id: int | str = 0, res_filter: float = 10, savefig: bool = False, showfig: bool = True) None
Plots the time series results for a given survey.
- Parameters:
survey_id (str, optional) – ID of the survey to plot results for, by default None.
run_id (int or str, optional) – The run ID of the survey results to plot, by default 0.
res_filter (float, optional) – The residual filter value to filter outrageous values (m), by default 10.
savefig (bool, optional) – If True, save the figure, by default False.
showfig (bool, optional) – If True, display the figure, by default True.
- run_garpos(survey_id: str | None = None, run_id: int | str = 0, iterations: int = 1, override: bool = False, custom_settings: dict | InversionParams | None = None) None
Run the GARPOS model for a specific date or for all dates.
- Parameters:
survey_id (str, optional) – The ID of the survey to run, by default None.
run_id (int | str, optional) – The run identifier, by default 0.
iterations (int, optional) – The number of iterations to run, by default 1.
override (bool, optional) – If True, override existing results, by default False.
custom_settings (dict | InversionParams, optional) – Custom GARPOS settings to apply, by default None.
- set_campaign(campaign_id: str)
Sets the current campaign.
- Parameters:
campaign_id (str) – The ID of the campaign to set.
- Raises:
ValueError – If the campaign is not found in the site metadata.
- set_inversion_params(parameters: dict | InversionParams)
Set inversion parameters for the model.
This method updates the inversion parameters of the model using the key-value pairs provided in the args dictionary. Each key in the dictionary corresponds to an attribute of the inversion_params object, and the associated value is assigned to that attribute.
- Parameters:
parameters (dict | InversionParams) – A dictionary containing key-value pairs to update the inversion parameters or an InversionParams object.
- set_network(network_id: str)
Sets the current network.
- Parameters:
network_id (str) – The ID of the network to set.
- Raises:
ValueError – If the network is not found in the site metadata.
- set_station(station_id: str)
Sets the current station.
- Parameters:
station_id (str) – The ID of the station to set.
- Raises:
ValueError – If the station is not found in the site metadata.
- set_survey(survey_id: str)
Sets the current survey.
- Parameters:
survey_id (str) – The ID of the survey to set.
- Raises:
ValueError – If the survey is not found in the current campaign.