mt_metadata.transfer_functions.io.zfiles.zmm
Created on Thu Sep 28 12:34:23 2017 @author: jrpeacock
Translated from code by B. Murphy.
Attributes
Exceptions
Common base class for all non-exit exceptions. |
Classes
Container for Header of an Egbert file |
|
Container for Egberts zrr format. |
Module Contents
- mt_metadata.transfer_functions.io.zfiles.zmm.PERIOD_FORMAT = '.10g'
- exception mt_metadata.transfer_functions.io.zfiles.zmm.ZMMError
Bases:
ExceptionCommon base class for all non-exit exceptions.
- class mt_metadata.transfer_functions.io.zfiles.zmm.ZMMHeader(fn=None, **kwargs)
Bases:
objectContainer for Header of an Egbert file
- processing_type = None
- num_channels = None
- num_freq = None
- ex = None
- ey = None
- hx = None
- hy = None
- hz = None
- property fn
- station_metadata
- property latitude
- property longitude
- property elevation
- property declination
- property station
- read_header(fn=None)
Read the header information from a ZMM file.
- Parameters:
fn (str | Path | None, optional) – The file name to read, by default None
- write_header()
write a zmm header
TRANSFER FUNCTIONS IN MEASUREMENT COORDINATES ****** WITH FULL ERROR COVARINCE*********
300 coordinate 34.727 -115.735 declination 13.10 number of channels 5 number of frequencies 38 orientations and tilts of each channel
1 0.00 0.00 300 Hx 2 90.00 0.00 300 Hy 3 0.00 0.00 300 Hz 4 0.00 0.00 300 Ex 5 90.00 0.00 300 Ey
- Returns:
The formatted header lines.
- Return type:
list[str]
- property channel_dict: dict[str, str]
- property channels_recorded: list[str]
- property input_channels: list[str]
- property output_channels: list[str]
- property has_tipper: bool
- property has_impedance: bool
- class mt_metadata.transfer_functions.io.zfiles.zmm.ZMM(fn=None, **kwargs)
Bases:
ZMMHeaderContainer for Egberts zrr format.
- fn = None
- transfer_functions = None
- sigma_e = None
- sigma_s = None
- periods = None
- dataset = None
- decimation_dict
- property channel_nomenclature: dict[str, str]
- property frequencies: numpy.typing.NDArray[numpy.float64] | None
- initialize_arrays()
make initial arrays based on number of frequencies and channels
- read(fn=None, get_elevation=False, rotate_to_measurement_coordinates=True, use_declination=False)
Read in Egbert zrr/zmm file
- Parameters:
fn (str | Path | None, optional) – The file name to read, by default None
get_elevation (bool, optional) – If True, fetch elevation from the National Map, by default False
rotate_to_measurement_coordinates (bool, optional) – If True, rotate impedance to the provided reference frame of the channel metadata, by default True
use_declination (bool, optional) – If True, rotate impedance to true north using declination value in metadata, by default False
- Raises:
ZMMError – If the file cannot be read or is not in the expected format.
- write(fn=None, decimation_levels=None)
write a zmm file
decimation_levels should be a dictionary with keys
decimation_level
values will be a dictionary with keys
frequency_band, value = (min, max)
n_points, value = int
sampling_freq, value = float
- Parameters:
fn (str | Path | None, optional) – The file name to write, by default None
decimation_levels (dict, optional) – A dictionary containing decimation levels and their properties, by default None.
- Raises:
ZMMError – If the file cannot be written or is not in the expected format.
- calculate_impedance(angle=0.0)
calculate the impedances from the transfer functions
- Parameters:
angle (float, optional) – The angle to rotate the impedance tensor.
- Returns:
z (np.ndarray | None) – The impedance tensor.
error (np.ndarray | None) – The impedance tensor error.
- Return type:
tuple[numpy.typing.NDArray[numpy.complex64] | None, numpy.typing.NDArray[numpy.float64] | None]
- calculate_tippers(angle=0.0)
calculate induction vectors
- Parameters:
angle (float, optional) – The angle to rotate the tipper tensor.
- Returns:
tipper – The tipper tensor.
- Return type:
np.ndarray
- property survey_metadata
- property ex_metadata: mt_metadata.timeseries.Electric
- property ey_metadata: mt_metadata.timeseries.Electric
- property hx_metadata: mt_metadata.timeseries.Magnetic
- property hy_metadata: mt_metadata.timeseries.Magnetic
- property hz_metadata: mt_metadata.timeseries.Magnetic