mt_metadata.transfer_functions.io.edi ===================================== .. py:module:: mt_metadata.transfer_functions.io.edi Submodules ---------- .. toctree:: :maxdepth: 1 /source/api/mt_metadata/transfer_functions/io/edi/edi/index /source/api/mt_metadata/transfer_functions/io/edi/metadata/index Classes ------- .. autoapisummary:: mt_metadata.transfer_functions.io.edi.EDI Package Contents ---------------- .. py:class:: EDI(fn=None, **kwargs) This class is for .edi files, mainly reading and writing. Has been tested on Winglink and Phoenix output .edi's, which are meant to follow the archaic EDI format put forward by SEG. Can read impedance, Tipper and/or spectra data. The Edi class contains a class for each major section of the .edi file. Frequency and components are ordered from highest to lowest frequency. :param fn: full path to .edi file to be read in. *default* is None. If an .edi file is input, it is automatically read in and attributes of Edi are filled :type fn: string or :class:`pathlib.Path` :Change Latitude: :: >>> from mt_metadata.transfer_functions.io.edi import EDI >>> edi_obj = EDI(fn=r"/home/mt/mt01.edi") >>> # change the latitude >>> edi_obj.lat = 45.7869 >>> new_edi_fn = edi_obj.write() .. py:attribute:: logger .. py:attribute:: Header .. py:attribute:: Info .. py:attribute:: Measurement .. py:attribute:: Data .. py:attribute:: z :value: None .. py:attribute:: z_err :value: None .. py:attribute:: t :value: None .. py:attribute:: t_err :value: None .. py:attribute:: frequency :value: None .. py:attribute:: rotation_angle :value: None .. py:attribute:: residual_covariance :value: None .. py:attribute:: signal_inverse_power :value: None .. py:attribute:: tf :value: None .. py:attribute:: tf_err :value: None .. py:property:: fn .. py:property:: period :type: numpy.typing.NDArray | None .. py:method:: read(fn = None, get_elevation = False) Read in an edi file and fill attributes of each section's classes. Including: * Header * Info * Measurement * Data * z, z_err * t, t_err .. note:: Automatically detects if data is in spectra format. All data read in is converted to impedance and Tipper. :param fn: full path to .edi file to be read in *default* is None :type fn: string :Example: :: >>> from mt_metadata.transfer_functions.io.edi import EDI >>> edi_obj = EDI >>> edi_obj.read(fn=r"/home/mt/mt01.edi") .. py:method:: write(new_edi_fn = None, longitude_format = 'LON', latlon_format = 'dms') Write a new edi file from either an existing .edi file or from data input by the user into the attributes of Edi. :param new_edi_fn: full path to new edi file. *default* is None, which will write to the same file as the input .edi with as: r"/home/mt/mt01_1.edi" :type new_edi_fn: string :param longitude_format: whether to write longitude as LON or LONG. options are 'LON' or 'LONG', default 'LON' :type longitude_format: string :param latlon_format: format of latitude and longitude in output edi, degrees minutes seconds ('dms') or decimal degrees ('dd') :type latlon_format: string :returns: full path to new edi file :rtype: string :Example: :: >>> import mtpy.core.edi as mtedi >>> edi_obj = mtedi.Edi(fn=r"/home/mt/mt01/edi") >>> edi_obj.Header.dataid = 'mt01_rr' >>> n_edi_fn = edi_obj.write_edi_file() .. py:property:: lat :type: float | None latitude in decimal degrees .. py:property:: lon :type: float | None longitude in decimal degrees .. py:property:: elev :type: float Elevation in elevation units .. py:property:: station :type: str | None station name .. py:property:: survey_metadata :type: mt_metadata.timeseries.Survey .. py:property:: station_metadata :type: mt_metadata.transfer_functions.tf.Station .. py:property:: ex_metadata .. py:property:: ey_metadata .. py:property:: hx_metadata .. py:property:: hy_metadata .. py:property:: hz_metadata .. py:property:: rrhx_metadata .. py:property:: rrhy_metadata