mtpy.processing.aurora package
Submodules
mtpy.processing.aurora.process_aurora module
Created on Tue Jul 30 17:11:42 2024
@author: jpeacock
- class mtpy.processing.aurora.process_aurora.AuroraProcessing(**kwargs)[source]
Bases:
BaseProcessingConvenience class to process with Aurora
from mtpy.processing.aurora.process_aurora import AuroraProcessing ap = AuroraProcessing() # set local station and path to MTH5 ap.local_station_id = "mt01" ap.local_mth5_path = "/path/to/local_mth5.h5" # set remote station and path to MTH5 ap.remote_station_id = "rr01" ap.remote_mth5_path = "/path/to/remote_mth5.h5" # process single sample rate tf_obj = ap.process_single_sample_rate(sample_rate=1) # process multiple sample rates, merge them all together and # save transfer functions to the local MTH5 tf_processed_dict = ap.process( sample_rates=[4096, 1], merge=True, save_to_mth5=True ).
- add_simple_coherence_weights(channel_list=[('ex', ['ex', 'hy']), ('ey', ['ey', 'hx']), ('hz', ['hx', 'hx'])], **kwargs) list[ChannelWeightSpec][source]
Add coherence weights using the channel weight spec.
- Parameters:
**kwargs (dict) – Additional keyword arguments (currently unused).
- Returns:
List of channel weight specifications with coherence features.
- Return type:
list[ChannelWeightSpec]
- create_config(kernel_dataset: KernelDataset | None = None, decimation_kwargs: dict = {}, add_coherence_weights: bool = False, **kwargs) Processing[source]
Create Aurora processing configuration.
- Parameters:
kernel_dataset (KernelDataset or None, optional) – Kernel dataset defining processing runs, by default None.
decimation_kwargs (dict, optional) – Decimation parameters including window settings, by default {}.
add_coherence_weights (bool, optional) – Whether to add coherence-based weights, by default True.
**kwargs (dict) – Additional configuration parameters.
- Returns:
Aurora configuration object.
- Return type:
Processing
- Raises:
ValueError – If kernel_dataset is None and no kernel dataset exists.
- create_kernel_dataset(run_summary: RunSummary | None = None, local_station_id: str | None = None, remote_station_id: str | None = None, sample_rate: float | None = None) KernelDataset[source]
Build and return a KernelDataset.
- Parameters:
run_summary (RunSummary or None, optional) – Run summary to use, by default None (creates from MTH5).
local_station_id (str or None, optional) – Local station identifier, by default None.
remote_station_id (str or None, optional) – Remote reference station identifier, by default None.
sample_rate (float or None, optional) – Sample rate to filter runs, by default None.
- Returns:
Kernel dataset defining processing configuration.
- Return type:
KernelDataset
- merge_transfer_functions(tf_dict: dict[float, dict[str, bool | MT]]) MT[source]
Merge multiple transfer functions according to merge_dict.
- Parameters:
tf_dict (dict) – Dictionary of transfer functions to merge.
- Returns:
Merged transfer function combining all sample rates.
- Return type:
- process(sample_rates: float | list[float] | None = None, processing_dict: dict[float, dict[str, Processing | KernelDataset]] | None = None, merge: bool = True, save_to_mth5: bool = True, plot: bool = False) dict[float | str, dict[str, bool | MT]][source]
Process magnetotelluric data at multiple sample rates.
- Parameters:
sample_rates (float, list of float, or None, optional) – Sample rate(s) to process, by default None.
processing_dict (dict or None, optional) – Dictionary mapping sample rates to config and kernel_dataset. Format: {sample_rate: {‘config’: Processing, ‘kernel_dataset’: KernelDataset}} By default None.
merge (bool, optional) – Whether to merge all sample rates into a single transfer function according to merge_dict, by default True.
save_to_mth5 (bool, optional) – Whether to save transfer functions to local MTH5 file, by default True.
- Returns:
Dictionary with sample rates and ‘combined’ as keys, each containing {‘processed’: bool, ‘tf’: MT or None}.
- Return type:
dict[float or str, dict[str, bool or MT]]
- Raises:
ValueError – If neither sample_rates nor processing_dict is provided.
TypeError – If sample_rates or processing_dict is not the correct format.
Notes
If merge is True and multiple sample rates are processed, a ‘combined’ key is added with the merged transfer function.
Examples
>>> ap = AuroraProcessing() >>> ap.local_station_id = "mt01" >>> ap.local_mth5_path = "data.h5" >>> results = ap.process(sample_rates=[1, 4], merge=True)
- process_single_sample_rate(sample_rate: float, config: Processing | None = None, kernel_dataset: KernelDataset | None = None, plot: bool = False) MT | None[source]
Process a single sample rate to generate transfer functions.
- Parameters:
sample_rate (float) – Sample rate of time series data to process.
config (Processing or None, optional) – Aurora configuration object, by default None (creates from kernel_dataset).
kernel_dataset (KernelDataset or None, optional) – Kernel dataset defining processing runs, by default None (creates from run summary).
- Returns:
Transfer function object, or None if processing fails.
- Return type:
MT or None