mth5.io.zen.coil_response
Read an amtant.cal file provided by Zonge.
Apparently, the file includes the 6th and 8th harmonic of the given frequency, which is a fancy way of saying f x 6 and f x 8.
Classes
Read ANT4 coil calibration files from Zonge ( |
Module Contents
- class mth5.io.zen.coil_response.CoilResponse(calibration_file: str | pathlib.Path | None = None, angular_frequency: bool = False)[source]
Read ANT4 coil calibration files from Zonge (
amtant.cal).This class parses a Zonge antenna calibration file and exposes a
mt_metadata.timeseries.filters.FrequencyResponseTableFilterfor a specified coil number.- Parameters:
calibration_file (str | Path | None, optional) – Path to the antenna calibration file. If provided the file will be read during initialization, by default None.
angular_frequency (bool, optional) – If True, reported frequencies will be converted to angular frequency (rad/s), by default False.
- coil_calibrations[source]
Mapping of coil serial numbers to a structured numpy array containing frequency, amplitude, and phase columns.
- Type:
dict[str, numpy.ndarray]
Examples
>>> from mth5.mth5.io.zen.coil_response import CoilResponse >>> cr = CoilResponse('amtant.cal') >>> fap = cr.get_coil_response_fap(1234) >>> print(fap.name)
- file_exists()[source]
Check to make sure the file exists
- Returns:
True if it does, False if it does not
- Return type:
boolean
- read_antenna_file(antenna_calibration_file: str | pathlib.Path | None = None) None[source]
Read a Zonge antenna calibration file and parse coil responses.
The expected file format contains blocks starting with an “antenna” header line that provides the base frequency followed by lines with coil serial number and amplitude/phase values for the 6th and 8th harmonics.
- Parameters:
antenna_calibration_file (str | Path | None, optional) – Optional path to the antenna calibration file. If provided, it overrides the instance
calibration_file.
Notes
Phase values in the file are expected in milliradians and are converted to radians.
- get_coil_response_fap(coil_number: int | str, extrapolate: bool = True) mt_metadata.timeseries.filters.FrequencyResponseTableFilter[source]
Read an amtant.cal file provided by Zonge.
Apparently, the file includes the 6th and 8th harmonic of the given frequency, which is a fancy way of saying f * 6 and f * 8.
- Parameters:
coil_number (int or string) – ANT4 4 digit serial number
- Returns:
Frequency look up table
- Return type:
mt_metadata.timeseries.filters.FrequencyResponseTableFilter
- extrapolate(fap: mt_metadata.timeseries.filters.FrequencyResponseTableFilter) mt_metadata.timeseries.filters.FrequencyResponseTableFilter[source]
Extrapolate a frequency/amplitude/phase table using log-linear pads.
- Parameters:
fap (FrequencyResponseTableFilter) – Frequency response object to extrapolate.
- Returns:
A copy of
fapwith low- and high-frequency extrapolated values appended.- Return type:
FrequencyResponseTableFilter