mt_metadata.transfer_functions.io.zfiles.zmm ============================================ .. py:module:: mt_metadata.transfer_functions.io.zfiles.zmm .. autoapi-nested-parse:: Created on Thu Sep 28 12:34:23 2017 @author: jrpeacock Translated from code by B. Murphy. Attributes ---------- .. autoapisummary:: mt_metadata.transfer_functions.io.zfiles.zmm.PERIOD_FORMAT Exceptions ---------- .. autoapisummary:: mt_metadata.transfer_functions.io.zfiles.zmm.ZMMError Classes ------- .. autoapisummary:: mt_metadata.transfer_functions.io.zfiles.zmm.ZMMHeader mt_metadata.transfer_functions.io.zfiles.zmm.ZMM Module Contents --------------- .. py:data:: PERIOD_FORMAT :value: '.10g' .. py:exception:: ZMMError Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:class:: ZMMHeader(fn=None, **kwargs) Bases: :py:obj:`object` Container for Header of an Egbert file .. py:attribute:: processing_type :value: None .. py:attribute:: num_channels :value: None .. py:attribute:: num_freq :value: None .. py:attribute:: ex :value: None .. py:attribute:: ey :value: None .. py:attribute:: hx :value: None .. py:attribute:: hy :value: None .. py:attribute:: hz :value: None .. py:property:: fn .. py:attribute:: station_metadata .. py:property:: latitude .. py:property:: longitude .. py:property:: elevation .. py:property:: declination .. py:property:: station .. py:method:: read_header(fn = None) Read the header information from a ZMM file. :param fn: The file name to read, by default None :type fn: str | Path | None, optional .. py:method:: 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. :rtype: list[str] .. py:property:: channel_dict :type: dict[str, str] .. py:property:: channels_recorded :type: list[str] .. py:property:: input_channels :type: list[str] .. py:property:: output_channels :type: list[str] .. py:property:: has_tipper :type: bool .. py:property:: has_impedance :type: bool .. py:class:: ZMM(fn = None, **kwargs) Bases: :py:obj:`ZMMHeader` Container for Egberts zrr format. .. py:attribute:: fn :value: None .. py:attribute:: transfer_functions :value: None .. py:attribute:: sigma_e :value: None .. py:attribute:: sigma_s :value: None .. py:attribute:: periods :value: None .. py:attribute:: dataset :value: None .. py:attribute:: decimation_dict .. py:property:: channel_nomenclature :type: dict[str, str] .. py:property:: frequencies :type: numpy.typing.NDArray[numpy.float64] | None .. py:method:: initialize_arrays() make initial arrays based on number of frequencies and channels .. py:method:: read(fn = None, get_elevation = False, rotate_to_measurement_coordinates = True, use_declination = False) Read in Egbert zrr/zmm file :param fn: The file name to read, by default None :type fn: str | Path | None, optional :param get_elevation: If True, fetch elevation from the National Map, by default False :type get_elevation: bool, optional :param rotate_to_measurement_coordinates: If True, rotate impedance to the provided reference frame of the channel metadata, by default True :type rotate_to_measurement_coordinates: bool, optional :param use_declination: If True, rotate impedance to true north using declination value in metadata, by default False :type use_declination: bool, optional :raises ZMMError: If the file cannot be read or is not in the expected format. .. py:method:: 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 :param fn: The file name to write, by default None :type fn: str | Path | None, optional :param decimation_levels: A dictionary containing decimation levels and their properties, by default None. :type decimation_levels: dict, optional :raises ZMMError: If the file cannot be written or is not in the expected format. .. py:method:: calculate_impedance(angle = 0.0) calculate the impedances from the transfer functions :param angle: The angle to rotate the impedance tensor. :type angle: float, optional :returns: * **z** (*np.ndarray | None*) -- The impedance tensor. * **error** (*np.ndarray | None*) -- The impedance tensor error. .. py:method:: calculate_tippers(angle = 0.0) calculate induction vectors :param angle: The angle to rotate the tipper tensor. :type angle: float, optional :returns: **tipper** -- The tipper tensor. :rtype: np.ndarray .. py:property:: survey_metadata .. py:property:: ex_metadata :type: mt_metadata.timeseries.Electric .. py:property:: ey_metadata :type: mt_metadata.timeseries.Electric .. py:property:: hx_metadata :type: mt_metadata.timeseries.Magnetic .. py:property:: hy_metadata :type: mt_metadata.timeseries.Magnetic .. py:property:: hz_metadata :type: mt_metadata.timeseries.Magnetic