aurora.test_utils.parkfield package

Submodules

aurora.test_utils.parkfield.calibration_helpers module

This module contains methods that are used in the Parkfield calibration tests.

aurora.test_utils.parkfield.calibration_helpers.load_bf4_fap_for_parkfield_test_using_mt_metadata(frequencies: ndarray)[source]

Loads a csv format response file for a BF4 coil and return the calibration function. Uses an mt_metadata filter object.

  • Anti-alias filter and digitizer responses are not included in the csv – it is coil only.

  • We ignore the AAF, and hard-code a counts-per-volt value for now

Development Notes: TODO: Add doc showing where counts per volt is accessing in FDSN metadata.

Parameters:

frequencies (np.ndarray) – Frequencies at which to evaluate the bf response function

Returns:

bf4_resp – Complex response of the filter at the input frequencies

Return type:

np.ndarray

aurora.test_utils.parkfield.calibration_helpers.parkfield_sanity_check(fft_obj: Dataset, run_obj: RunGroup, show_response_curves: bool | None = False, show_spectra: bool | None = False, figures_path: str | Path | None = PosixPath('.'), include_decimation: bool | None = False)[source]

Loop over channels in fft obj and make calibrated spectral plots

Parameters:

fft_obj (xarray.core.dataset.Dataset) – The FFT of the data. This is actually an STFT but with only one time window.

aurora.test_utils.parkfield.calibration_helpers.plot_responses(key, frequencies, pz_calibration_response, bf4_resp, figures_path, show_response_curves)[source]

Makes a sanity check plot to show the response of the calibration curves

Parameters:
  • key (str) – The channel name, “hx”, “hy”, “ex”, “ey”, “hz”

  • frequencies (numpy array) – The frequencies at which the response will be plotted

  • pz_calibration_response (numpy.ndarray) – The complex-values resposne function from the pole-zero response

  • bf4_resp (None or numpy.ndarray) – The complex-values resposne function from the BF-4 coil only.

  • figures_path (str or pathlib.Path) – Where the figures will be saved

  • show_response_curves (bool) – If True, plots flash to screen - for debugging

aurora.test_utils.parkfield.make_parkfield_mth5 module

This module contains methods for building an MTH5 file from data at Parkfield (PKD) and Hollister (SAO) long term monitoring stations to use as test data.

aurora.test_utils.parkfield.make_parkfield_mth5.ensure_h5_exists(target_folder: str | Path | None = PosixPath('/home/runner/work/aurora/aurora/data/parkfield')) Path[source]

Make sure that the PKD SAO MTH5 file exists. If it does not, build it.

Parameters:

h5_path (Union[pathlib.Path, None]) –

Returns:

h5_path – The path to the PKD SAO mth5 file to be used for testing.

Return type:

pathlib.Path

aurora.test_utils.parkfield.make_parkfield_mth5.main()[source]

allows the make to be run by calling this module from the command line

aurora.test_utils.parkfield.make_parkfield_mth5.make_pkdsao_mth5(fdsn_dataset: <aurora.sandbox.io_helpers.fdsn_dataset.FDSNDataset object at 0x7faadd40b5b0>, target_folder: str | ~pathlib.Path | None = PosixPath('/home/runner/work/aurora/aurora/data/parkfield')) Path[source]

Makes MTH5 file with data from Parkfield and Hollister stations to use for testing.

aurora.test_utils.parkfield.make_parkfield_mth5.select_data_source() None[source]

Identifies appropriate web client to use for NCEDC data requests.

This was used for debugging data access issues in the past – may no longer be needed.

Returns:

data_source – A responsive NCEDC client.

Return type:

str

aurora.test_utils.parkfield.path_helpers module

This module contains helper functions to control where the parkfield test data and test results are stored /accessed.

aurora.test_utils.parkfield.path_helpers.make_parkfield_paths() dict[source]

Makes a dictionary with information about where to store/access PKD test data and results.

Returns:

parkfield_paths – Dict containing paths to “data”, “aurora_results”, “config”, “emtf_results”

Return type:

dict

Module contents