mt_metadata.transfer_functions.io.emtfxml.metadata

Submodules

Classes

ExternalUrl

Base class for all metadata objects with Pydantic validation.

PrimaryData

Base class for all metadata objects with Pydantic validation.

Attachment

Base class for all metadata objects with Pydantic validation.

Citation

Base class for all metadata objects with Pydantic validation.

Provenance

Base class for all metadata objects with Pydantic validation.

Copyright

Base class for all metadata objects with Pydantic validation.

DataQualityNotes

Base class for all metadata objects with Pydantic validation.

DataQualityWarnings

Base class for all metadata objects with Pydantic validation.

Orientation

Base class for all metadata objects with Pydantic validation.

Location

A partial location class that only includes the latitude, longitude, and elevation.

Site

Base class for all metadata objects with Pydantic validation.

Instrument

Base class for all metadata objects with Pydantic validation.

Electrode

Base class for all metadata objects with Pydantic validation.

Dipole

Base class for all metadata objects with Pydantic validation.

Run

Base class for all metadata objects with Pydantic validation.

FieldNotes

Base class for all metadata objects with Pydantic validation.

ProcessingSoftware

Base class for all metadata objects with Pydantic validation.

RemoteRef

Base class for all metadata objects with Pydantic validation.

RemoteInfo

Base class for all metadata objects with Pydantic validation.

ProcessingInfo

Base class for all metadata objects with Pydantic validation.

Estimate

Base class for all metadata objects with Pydantic validation.

StatisticalEstimates

Base class for all metadata objects with Pydantic validation.

DataType

Base class for all metadata objects with Pydantic validation.

DataTypes

Base class for all metadata objects with Pydantic validation.

Magnetic

Base class for all metadata objects with Pydantic validation.

Electric

Base class for all metadata objects with Pydantic validation.

Channels

Base class for all metadata objects with Pydantic validation.

SiteLayout

Base class for all metadata objects with Pydantic validation.

PeriodRange

Base class for all metadata objects with Pydantic validation.

TransferFunction

Deal with the complex XML format

EMTF

Base class for all metadata objects with Pydantic validation.

Package Contents

class mt_metadata.transfer_functions.io.emtfxml.metadata.ExternalUrl(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

description: Annotated[str, Field(default='', description='description of where the external URL points towards', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['IRIS DMC Metadata']})]
url: Annotated[pydantic.HttpUrl | str, Field(default='', description='full URL of where the data is stored', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['http://www.iris.edu/mda/EM/NVS11']})]
classmethod validate_url(value, info=None)
read_dict(input_dict)
Parameters:

input_dict (dict) – input dictionary containing external URL data

Returns:

None

Return type:

None

class mt_metadata.transfer_functions.io.emtfxml.metadata.PrimaryData(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

filename: Annotated[str, Field(default='', description='file name of the figure file that displays the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['example.png']})]
read_dict(input_dict)

Read the primary_data element from the input dictionary.

Parameters:

input_dict (dict) – The input dictionary containing the primary_data element.

class mt_metadata.transfer_functions.io.emtfxml.metadata.Attachment(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

filename: Annotated[str, Field(default='', description='file name of the attached file data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['example.zmm']})]
description: Annotated[str, Field(default='', description='description of the attached file', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['The original used to produce the XML']})]
read_dict(input_dict)

Read the input dictionary and populate the model fields.

to_xml(string=False, required=True)
Parameters:
  • string (bool, optional) – return as an XML string, defaults to False

  • required (bool, optional) – whether the field is required, defaults to True

Returns:

the XML representation of the object

Return type:

str | list[str]

class mt_metadata.transfer_functions.io.emtfxml.metadata.Citation(**data)

Bases: mt_metadata.common.Citation

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

survey_d_o_i: Annotated[pydantic.HttpUrl | str | None, Field(default=None, description='doi number of the survey', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['###/###']})]
classmethod validate_survey_d_o_i(value)

Validate the survey DOI.

Parameters:
  • value (str | None) – The DOI value to validate.

  • info (ValidationInfo) – Additional validation information.

Returns:

The validated DOI or None if not provided.

Return type:

str | None

to_xml(string=False, required=True)
Parameters:
  • string (TYPE, optional) – DESCRIPTION, defaults to False

  • required (TYPE, optional) – DESCRIPTION, defaults to True

Returns:

DESCRIPTION

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.Provenance(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

create_time: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default_factory=lambda: MTime(time_stamp=None), description='date and time the file was created', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2020-02-08T12:23:40.324600+00:00']})]
creating_application: Annotated[str, Field(default='mt_metadata', description='name of the application that created the XML file', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['EMTF File Conversion Utilities 4.0']})]
creator: Annotated[mt_metadata.common.Person, Field(default_factory=Person, description='Person or group responsible for creating the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Person(name='John Doe', email='john.doe@example.com')"]})]
submitter: Annotated[mt_metadata.common.Person, Field(default_factory=Person, description='Person or group responsible for submitting the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Person(name='Jane Smith', email='jane.smith@example.com')"]})]
classmethod validate_create_time(field_value)
read_dict(input_dict)

Read the Provenance object from a dictionary.

Parameters:

input_dict (dict) – The input dictionary containing the Provenance data.

to_xml(string=False, required=True)

Convert the Provenance object to XML format.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string, by default False

  • required (bool, optional) – Whether all required fields must be present, by default True

Returns:

The XML representation of the Provenance object

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.Copyright(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

citation: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.Citation, Field(default_factory=Citation, description='The citation information for the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Citation(authors='Doe, J.', year='2023', title='Title of the paper', journal='Journal Name', volume='45', pages='123-145')"]})]
selected_publications: Annotated[str | None, Field(default=None, description='Any publications that use this data', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['my paper']})]
release_status: Annotated[mt_metadata.common.enumerations.ReleaseStatusEnum, Field(default='Unrestricted Release', description='the release status of the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Unrestricted release']})]
conditions_of_use: Annotated[str, Field(default='All data and metadata for this survey are available free of charge and may be copied freely, duplicated and further distributed provided this data set is cited as the reference. While the author(s) strive to provide data and metadata of best possible quality, neither the author(s) of this data set, not IRIS make any claims, promises, or guarantees about the accuracy, completeness, or adequacy of this information, and expressly disclaim liability for errors and omissions in the contents of this file. Guidelines about the quality or limitations of the data and metadata, as obtained from the author(s), are included for informational purposes only.', description='Any notes on conditions of use', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Cite data upon usage.']})]
acknowledgement: Annotated[str | None, Field(default=None, description='any acknowledgments the transfer function should have.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['This project was funded by x.']})]
additional_info: Annotated[str | None, Field(default=None, description='any additional information about the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['This purpose of this project is ...']})]
read_dict(input_dict)
Parameters:

input_dict (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

to_xml(string=False, required=True)

Convert metadata to an XML representation.

Creates an XML element with type and unit information for each attribute.

Parameters:
  • string (bool, optional) – If True, return XML as a string. If False, return an XML Element. Default is False.

  • required (bool, optional) – If True, include only required elements and elements with non-None values. If False, include all elements. Default is True.

Returns:

XML Element object if string=False, otherwise XML string

Return type:

str | et.Element

Examples

>>> xml_elem = metadata.to_xml()
>>> xml_str = metadata.to_xml(string=True)
class mt_metadata.transfer_functions.io.emtfxml.metadata.DataQualityNotes(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

good_from_period: Annotated[float | None, Field(default=None, description='Data are good for periods larger than this number', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['0.01']})]
good_to_period: Annotated[float | None, Field(default=None, description='Data are good for periods smaller than this number', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['1000']})]
rating: Annotated[int | None, Field(default=None, description='Rating of the data from 0 to 5 where 5 is the best and 0 is unrated', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['4']})]
comments: Annotated[mt_metadata.common.Comment | str | None, Field(default_factory=Comment, description='Comments about the data quality', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Data quality is good', 'Some issues found']})]
classmethod validate_comments(value)

Validate that the value is a valid string.

read_dict(input_dict)
Parameters:

input_dict (dict) – input dictionary to read and populate the model fields.

Returns:

None

Return type:

None

to_xml(string=False, required=True)

Convert the DataQualityNotes instance to XML format.

Parameters:
  • string (bool, optional) – If True, return the XML as a string. If False, return an ElementTree Element.

  • required (bool, optional) – If True, include all required fields in the XML.

Returns:

The XML representation of the DataQualityNotes instance.

Return type:

str | et.Element

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.DataQualityWarnings(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

flag: Annotated[int | None, Field(default=None, description='Flag for data quality', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['0']})]
comments: Annotated[mt_metadata.common.Comment | None, Field(default_factory=Comment, description='Comments about the data quality warnings', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Data quality is good', 'Some issues found']})]
classmethod validate_comments(v)

Ensure comments is an instance of Comment.

read_dict(input_dict)
Parameters:

input_dict (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

to_xml(string=False, required=True)
Parameters:
  • string (TYPE, optional) – DESCRIPTION, defaults to False

  • required (TYPE, optional) – DESCRIPTION, defaults to True

Returns:

DESCRIPTION

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.Orientation(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

angle_to_geographic_north: Annotated[float, Field(default=0.0, description='Angle to geographic north of the station orientation', alias=None, json_schema_extra={'units': 'degrees', 'required': True, 'examples': [0]})]
layout: Annotated[mt_metadata.common.enumerations.ChannelOrientationEnum, Field(default=ChannelOrientationEnum.orthogonal, description='Orientation of channels relative to each other', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['orthogonal']})]
read_dict(input_dict)
Parameters:

input_dict (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

to_xml(string=False, required=True)

Overwrite to XML to follow EMTF XML format

Parameters:
  • string (TYPE, optional) – DESCRIPTION, defaults to False

  • required (TYPE, optional) – DESCRIPTION, defaults to True

Returns:

DESCRIPTION

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.Location(**data)

Bases: mt_metadata.common.BasicLocation

A partial location class that only includes the latitude, longitude, and elevation. This is used to avoid circular imports.

declination: Annotated[mt_metadata.common.Declination, Field(default_factory=Declination, description='Declination at the location in degrees', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['10.0']})]
to_xml(string=False, required=True)

Overwrite to XML to follow EMTF XML format

Parameters:
  • string (bool) – If True, return the XML as a string. If False, return an ElementTree Element. Defaults to False.

  • required (bool) – If True, include all required fields in the XML. Defaults to True.

Return type:

XML representation of the BasicLocationDeclination object as a string or ElementTree Element.

class mt_metadata.transfer_functions.io.emtfxml.metadata.Site(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

project: Annotated[str, Field(default='', description='Name of the project', alias=None, pattern='^[a-zA-Z0-9-_]*$', json_schema_extra={'units': None, 'required': True, 'examples': ['USMTArray']})]
survey: Annotated[str, Field(default='', description='Name of the survey', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['MT 2020']})]
year_collected: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default=None, description='Year data collected', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2020']})]
country: Annotated[str, Field(default='', description='Country where data was collected', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['USA']})]
id: Annotated[str, Field(default='', description='Station ID name.  This should be an alpha numeric name that is typically 5-6 characters long.  Commonly the project name in 2 or 3 letters and the station number.', alias=None, pattern='^[a-zA-Z0-9]*$', json_schema_extra={'units': None, 'required': True, 'examples': ['MT001']})]
name: Annotated[str, Field(default='', description='closest geographic name to the station', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['"Whitehorse, YK"']})]
acquired_by: Annotated[str, Field(default='', description='Person or group who collected the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['MT Group']})]
start: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default_factory=lambda: MTime(time_stamp=None), description='Date time when the data collection started', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2020-01-01T12:00:00']})]
end: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default_factory=lambda: MTime(time_stamp=None), description='Date time when the data collection ended', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2020-05-01T12:00:00']})]
run_list: Annotated[list[str] | None, Field(default_factory=list, description='list of runs recorded by the station. Should be a summary of all runs recorded', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['"[ mt001a, mt001b, mt001c ]"']})]
data_quality_notes: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.DataQualityNotes, Field(default_factory=DataQualityNotes, description='Notes on the data quality', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Data quality is good']})]
data_quality_warnings: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.DataQualityWarnings, Field(default_factory=DataQualityWarnings, description='Warnings about the data quality', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Data quality is questionable']})]
orientation: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.Orientation, Field(default_factory=Orientation, description='Orientation of the site', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Orientation('layout=orthogonal, angle_to_geographic_north=0.0')"]})]
location: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.Location, Field(default_factory=Location, description='Location of the site', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Location('latitude=60.0, longitude=-135.0, declination=10.0')"]})]
comments: Annotated[mt_metadata.common.Comment | str | None, Field(default_factory=Comment, description='Comments about the site', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Comment('This is a comment about the site')"]})]
classmethod validate_start(field_value)
classmethod validate_year_collected(field_value)
classmethod validate_string_fields(field_value)

Validate string fields, converting None to empty string.

classmethod validate_comments(value)

Validate that the value is a valid string.

classmethod validate_run_list(value)

Validate that the value is a list of strings.

read_dict(input_dict)

Read the input dictionary and update the object’s attributes.

Parameters:

input_dict (dict) – The input dictionary containing the data to read.

to_xml(string=False, required=True)

Convert the object to XML format.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string, by default False

  • required (bool, optional) – Whether the XML is required, by default True

Returns:

The XML representation of the object.

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.Instrument(**data)

Bases: mt_metadata.common.Instrument

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

settings: Annotated[str | None, Field(default=None, description='Settings for the instrument, such as configuration or calibration details.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['calibration settings', 'configuration details']})] = None
to_xml(string=False, required=False)

Convert the Instrument object to an XML element or string. :param string: If True, return as a string; otherwise, return as an XML element. :type string: bool, optional :param required: If True, include only required fields; otherwise, include all fields. :type required: bool, optional :return: XML representation of the Instrument object. :rtype: str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.Electrode(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

location: Annotated[mt_metadata.common.enumerations.ElectrodeLocationEnum, Field(default='', description='Direction of electrode', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['N', 'S', 'E', 'W']})]
number: Annotated[str, Field(default='0', description='Electrode ID number', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['1a']})]
value: Annotated[str, Field(default='', description='Electrode value', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Ag-AgCl']})]
comments: Annotated[mt_metadata.common.Comment, Field(default_factory=lambda: Comment(), description='comments on the electrode', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Ag-AgCl porous pot']})]
classmethod validate_comments(value, info)
to_xml(string=False, required=False)

Convert metadata to an XML representation.

Creates an XML element with type and unit information for each attribute.

Parameters:
  • string (bool, optional) – If True, return XML as a string. If False, return an XML Element. Default is False.

  • required (bool, optional) – If True, include only required elements and elements with non-None values. If False, include all elements. Default is True.

Returns:

XML Element object if string=False, otherwise XML string

Return type:

str | et.Element

Examples

>>> xml_elem = metadata.to_xml()
>>> xml_str = metadata.to_xml(string=True)
class mt_metadata.transfer_functions.io.emtfxml.metadata.Dipole(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

manufacturer: Annotated[str | None, Field(default=None, description='Name of the manufacturer of the instrument', json_schema_extra={'units': None, 'required': False, 'examples': ['MT Gurus']})]
length: Annotated[float | None, Field(default=None, description='Dipole length', json_schema_extra={'units': 'meters', 'required': False, 'examples': ['100.0']})]
azimuth: Annotated[float | None, Field(default=None, description='Azimuth of the dipole relative to coordinate system', json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['90']})]
name: Annotated[str | None, Field(default=None, description='Name of the dipole', json_schema_extra={'units': None, 'required': False, 'examples': ['dipole1']})]
type: Annotated[str | None, Field(default=None, description='type of dipole', json_schema_extra={'units': None, 'required': False, 'examples': ['wire']})]
electrode: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Electrode], Field(default_factory=list, description='List of electrodes that make up the dipole', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': [{'name': 'ex', 'type': 'wire'}]})]
validate_electrode(value)

Validate that the value is a list of Electrode objects.

to_xml(string=False, required=True)
Parameters:
  • string (TYPE, optional) – DESCRIPTION, defaults to False

  • required (TYPE, optional) – DESCRIPTION, defaults to True

Returns:

DESCRIPTION

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.Run(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

errors: Annotated[str | None, Field(default=None, description='Any field errors', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['moose ate cables']})]
run: Annotated[str, Field(default='', description='Run name', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['mt001a']})]
sampling_rate: Annotated[float | None, Field(default=None, description='Sample rate of the run', alias=None, json_schema_extra={'units': 'samples per second', 'required': False, 'examples': ['1']})]
start: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default_factory=lambda: MTime(time_stamp=None), description='Date time when the data collection started', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2020-01-01T12:00:00']})]
end: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp, Field(default_factory=lambda: MTime(time_stamp=None), description='Date time when the data collection ended', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['2020-05-01T12:00:00']})]
comments: Annotated[mt_metadata.common.Comment | str | None, Field(default_factory=Comment, description='Comments about the run', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Comment(text='This is a comment')"]})]
instrument: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.Instrument, Field(default_factory=Instrument, description='Instrument used for the run', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Instrument(name='MT Sensor', type='magnetometer')"]})]
magnetometer: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Magnetometer], Field(default_factory=list, description='List of magnetometers used in the run', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Magnetometer(name='Magnetometer 1', type='fluxgate')"]})]
dipole: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Dipole], Field(default_factory=list, description='List of dipoles used in the run', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["Dipole(name='Dipole 1', type='fluxgate')"]})]
classmethod validate_start(field_value)
classmethod validate_comments(field_value)
read_dict(input_dict)

Field notes are odd so have a special reader to do it piece by painstaking piece.

Parameters:

input_dict (dict) – input dictionary containing run data

Returns:

None

Return type:

None

to_xml(string=False, required=True)
Parameters:
  • string (TYPE, optional) – DESCRIPTION, defaults to True

  • required (TYPE, optional) – DESCRIPTION, defaults to False

Returns:

DESCRIPTION

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.FieldNotes(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

read_dict(input_dict)
to_xml(string=False, required=True)

Convert the FieldNotes instance to XML format.

Parameters:
  • string (bool, optional) – If True, return XML as a string, by default False

  • required (bool, optional) – If True, include all required fields, by default True

Returns:

The XML representation of the FieldNotes instance

Return type:

list[str | et.Element]

class mt_metadata.transfer_functions.io.emtfxml.metadata.ProcessingSoftware(**data)

Bases: mt_metadata.common.Software

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

last_mod: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp | None, Field(default_factory=lambda: MTime(time_stamp=None), description='Date the software was last modified', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['2020-01-01']})]
classmethod validate_last_mod(field_value)
read_dict(input_dict)

Read processing software information from a dictionary.

Parameters:

input_dict (dict) – A dictionary containing processing software information.

to_xml(string=False, required=True)

Convert the processing software information to XML format.

Parameters:
  • string (bool, optional) – If True, return the XML as a string. If False, return an ElementTree element.

  • required (bool, optional) – If True, include all required fields in the XML.

Returns:

The XML representation of the processing software information.

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.RemoteRef(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

type: Annotated[str, Field(default='', description='type of remote referencing', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['robust multi-station remote referencing']})]
read_dict(input_dict)
Parameters:

input_dict (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

to_xml(string=False, required=True)

Convert the RemoteRef object to XML format.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string (default is False).

  • required (bool, optional) – Whether to include required fields (default is True).

Returns:

The XML representation of the RemoteRef object.

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.RemoteInfo(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

site: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.Site, Field(default_factory=Site, description='Site information', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ["Site(name='Test Site', location='Test Location')"]})]
field_notes: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.FieldNotes, Field(default_factory=FieldNotes, description='Field notes information', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['FieldNotes(...)']})]
read_dict(input_dict)

Read metadata from a dictionary.

Parameters:

input_dict (dict) – A dictionary containing metadata information.

to_xml(string=False, required=True)

Convert the RemoteInfo object to XML format.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string (default is False).

  • required (bool, optional) – Whether to include required fields (default is True).

Returns:

The XML representation of the RemoteInfo object.

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.ProcessingInfo(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

sign_convention: Annotated[mt_metadata.common.enumerations.SignConventionEnum, Field(default='exp(+ i\\omega t)', description='Sign convention of the processing software output', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['exp(+ i\\omega t)']})]
processed_by: Annotated[str | None, Field(default=None, description='Names of people who processed the data', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['MT Guru']})]
process_date: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp | None, Field(default_factory=lambda: MTime(time_stamp=None), description='Date the data were processed', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['2020-01-01']})]
processing_tag: Annotated[str | None, Field(default=None, description='List of remote references', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['mt001-mt002']})]
processing_software: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.ProcessingSoftware, Field(default_factory=lambda: ProcessingSoftware(), description='Information about the processing software used', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["ProcessingSoftware(name='MT Processing Software', version='1.0')"]})]
remote_info: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.RemoteInfo, Field(default_factory=RemoteInfo, description='Information about remote data sources', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ["RemoteInfo(name='MT Remote')"]})]
remote_ref: Annotated[mt_metadata.transfer_functions.io.emtfxml.metadata.RemoteRef, Field(default_factory=RemoteRef, description='List of remote references', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': [['MT001a', 'MT001b']]})]
classmethod validate_process_date(field_value)
read_dict(input_dict)

Read processing information from a dictionary.

Parameters:

input_dict (dict) – A dictionary containing processing information.

to_xml(string=False, required=True)

Convert the processing information to XML format.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string, by default False

  • required (bool, optional) – Whether the XML is required, by default True

Returns:

The XML representation of the processing information

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.Estimate(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

name: Annotated[str, Field(default='', description='Name of the statistical estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['var']})]
type: Annotated[mt_metadata.common.enumerations.ArrayDTypeEnum, Field(default='', description='Type of number contained in the estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['real']})]
description: Annotated[str, Field(default='', description='Description of the statistical estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['this is an estimate']})]
external_url: Annotated[pydantic.HttpUrl, Field(default='', description='Full path to external link that has additional information', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['http://www.iris.edu/dms/products/emtf/variance.html']})]
intention: Annotated[mt_metadata.common.enumerations.EstimateIntentionEnum, Field(default='', description='The intension of the statistical estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['error estimate']})]
tag: Annotated[str, Field(default='', description='A useful tag for the estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['tipper']})]
read_dict(input_dict)
Parameters:

input_dict (dict) – input dictionary containing estimate data

Returns:

None

Return type:

None

to_xml(string=False, required=True)
Parameters:
  • string (bool, optional) – return string representation, defaults to False

  • required (bool, optional) – include only required fields, defaults to True

Returns:

XML representation of the estimate

Return type:

str | Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.StatisticalEstimates(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

estimates_list: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Estimate | dict] | dict, Field(default_factory=list, description='list of statistical estimates', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[var cov]']})]
classmethod validate_estimates_list(value)
read_dict(input_dict)

Read in statistical estimate descriptions

Parameters:

input_dict (dict) – input dictionary containing statistical estimates

Returns:

None

Return type:

None

to_xml(string=False, required=True)

Convert the StatisticalEstimates instance to XML format.

Parameters:
  • string (bool, optional) – If True, return the XML as a string, by default False

  • required (bool, optional) – If True, include required fields in the XML, by default True

Returns:

The XML representation of the instance

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.DataType(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

name: Annotated[str, Field(default='', description='Name of the statistical estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['var']})]
type: Annotated[mt_metadata.common.enumerations.ArrayDTypeEnum, Field(default='real', description='Type of number contained in the estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['real']})]
description: Annotated[str, Field(default='', description='Description of the statistical estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['this is an estimate']})]
external_url: Annotated[pydantic.HttpUrl, Field(default='', description='Full path to external link that has additional information', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['http://www.iris.edu/dms/products/emtf/variance.html']})]
intention: Annotated[mt_metadata.common.enumerations.EstimateIntentionEnum, Field(default='', description='The intension of the statistical estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['error estimate']})]
tag: Annotated[str, Field(default='', description='A useful tag for the estimate', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['tipper']})]
output: Annotated[OutputEnum, Field(default='', description='Type of output channels in data type', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['E']})]
input: Annotated[InputEnum, Field(default='', description='Type of input channels in data type', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['E']})]
units: Annotated[str, Field(default='milliVolt per kilometer per nanoTesla', description='Units for the data type', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[mV/km]/[nT]']})]
classmethod validate_units(value)
read_dict(input_dict)
Parameters:

input_dict (dict) – input dictionary to read and populate the model fields.

Returns:

None

Return type:

None

to_xml(string=False, required=True)
Parameters:
  • string (bool, optional) – return value as a string, defaults to False

  • required (bool, optional) – include required values only, defaults to True

Returns:

XML representation of the model

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.DataTypes(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

data_types_list: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.DataType | dict], Field(default_factory=list, description='list of data types', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[Z T]']})]
classmethod validate_data_types_list(value, info)
read_dict(input_dict)

Read in statistical estimate descriptions

Parameters:

input_dict (dict) – input dictionary containing data types

Returns:

None

Return type:

None

to_xml(string=False, required=True)
Parameters:
  • string (bool, optional) – return XML string, defaults to False

  • required (bool, optional) – include required fields, defaults to True

Returns:

XML representation of the object

Return type:

str | et.Element

Raises:
  • TypeError – if data_types_list is not a list of DataType instances or dictionaries

  • ValueError – if data_types_list is empty

class mt_metadata.transfer_functions.io.emtfxml.metadata.Magnetic(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

name: Annotated[str, Field(default='', description='Name of the channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['hx']})]
orientation: Annotated[float, Field(default=0.0, description='orientation angle relative to geographic north', alias=None, json_schema_extra={'units': 'degrees', 'required': True, 'examples': ['11.9']})]
x: Annotated[float, Field(default=0.0, description='location of sensor relative center point in north direction', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
y: Annotated[float, Field(default=0.0, description='location of sensor relative center point in east direction', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
z: Annotated[float, Field(default=0.0, description='location of sensor relative center point in depth', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
to_xml(string=False, required=True)
Parameters:
  • string (bool, optional) – Whether to return the XML as a string, defaults to False

  • required (bool, optional) – Whether to include required fields, defaults to True

Returns:

The XML representation of the object

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.Electric(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

name: Annotated[str, Field(default='', description='Name of the channel', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['ex']})]
orientation: Annotated[float, Field(default=0.0, description='orientation angle relative to geographic north', alias=None, json_schema_extra={'units': 'degrees', 'required': True, 'examples': ['11.9']})]
x: Annotated[float, Field(default=0.0, description='location of negative sensor relative center point in north direction', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
x2: Annotated[float, Field(default=0.0, description='location of positive sensor relative center point in north direction', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
y: Annotated[float, Field(default=0.0, description='location of negative sensor relative center point in east direction', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
y2: Annotated[float, Field(default=0.0, description='location of positive sensor relative center point in east direction', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
z: Annotated[float, Field(default=0.0, description='location of negative sensor relative center point in depth', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
z2: Annotated[float, Field(default=0.0, description='location of positive sensor relative center point in depth', alias=None, json_schema_extra={'units': 'meters', 'required': True, 'examples': ['100.0']})]
to_xml(string=False, required=True)
Parameters:
  • string (bool, optional) – return a string representation of the xml, defaults to False

  • required (bool, optional) – return a string representation of the xml, defaults to True

Returns:

string or xml element representation of the Electric object

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.Channels(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

ref: Annotated[str, Field(default='', description='reference to the site name', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['site']})]
units: Annotated[str, Field(default='', description='units of the distance coordinates', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['site']})]
inputs: Annotated[list[str], Field(default_factory=list, description='list of input channel names (sources)', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': [['Hx', 'Hy']]})]
outputs: Annotated[list[str], Field(default_factory=list, description='list of output channel names (responses)', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': [['Ex', 'Ey', 'Hz']]})]
classmethod validate_units(value)
class mt_metadata.transfer_functions.io.emtfxml.metadata.SiteLayout(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

input_channels: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Electric | mt_metadata.transfer_functions.io.emtfxml.metadata.Magnetic | str], Field(default_factory=list, description='list of input channels for transfer function estimation', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[Magnetic(hx), Magnetic(hy)]']})]
output_channels: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Electric | mt_metadata.transfer_functions.io.emtfxml.metadata.Magnetic | str], Field(default_factory=list, description='list of output channels for transfer function estimation', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[Electric(ex), Electric(ey), Magnetic(hz)]']})]
property input_channel_names: list[str]

Returns a list of input channel names.

property output_channel_names: list[str]

Returns a list of output channel names.

classmethod validate_channels(value)
read_dict(input_dict)

read site layout into the proper input/output channels

Parameters:

input_dict (dict) – input dictionary containing site layout data

Returns:

None

Return type:

None

to_xml(string=False, required=True)

Convert the SiteLayout instance to an XML representation.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string, by default False

  • required (bool, optional) – Whether the XML elements are required, by default True

Returns:

The XML representation of the SiteLayout instance

Return type:

str | et.Element

class mt_metadata.transfer_functions.io.emtfxml.metadata.PeriodRange(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

min: Annotated[float, Field(default=0.0, description='minimum period', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': ['"4.5E-5"']})]
max: Annotated[float, Field(default=0.0, description='maxmimu period', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': ['"4.5E5"']})]
read_dict(input_dict)

Read the period_range element from the input dictionary.

Parameters:

input_dict (dict) – The input dictionary containing the period_range element.

to_xml(string=False, required=True)

Convert the period_range element to XML.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string, by default False

  • required (bool, optional) – Whether the element is required, by default True

Returns:

The XML representation of the period_range element.

Return type:

et.Element | str

class mt_metadata.transfer_functions.io.emtfxml.metadata.TransferFunction(**data)

Bases: mt_metadata.base.MetadataBase

Deal with the complex XML format

period: Annotated[numpy.typing.NDArray[numpy.float64] | None, Field(default_factory=lambda: np.empty((0, ), dtype=np.float64), description='periods for estimates', alias=None, json_schema_extra={'units': 'second', 'required': True, 'examples': ['0.01', '0.1', '1.0']})]
z: Annotated[numpy.typing.NDArray[numpy.complex128] | None, Field(default_factory=lambda: np.empty((0, 2, 2), dtype=np.complex128), description='Estimates of the impedance tensor.', json_schema_extra={'units': '[mV/km]/[nT]', 'required': False, 'examples': ['1.0+0.0j', '0.5+0.5j']})]
z_var: Annotated[numpy.typing.NDArray[numpy.float64] | None, Field(default_factory=lambda: np.empty((0, 2, 2), dtype=np.float64), description='Variance estimates for the impedance tensor.', json_schema_extra={'units': None, 'required': False, 'examples': ['0.01', '0.1', '1.0']})]
z_invsigcov: Annotated[numpy.typing.NDArray[numpy.complex128] | None, Field(default_factory=lambda: np.empty((0, 2, 2), dtype=np.complex128), description='Inverse of the covariance matrix for the impedance tensor.', json_schema_extra={'units': None, 'required': False, 'examples': ['1.0+0.0j', '0.5+0.5j']})]
z_residcov: Annotated[numpy.typing.NDArray[numpy.complex128] | None, Field(default_factory=lambda: np.empty((0, 2, 2), dtype=np.complex128), description='Residual covariance matrix for the impedance tensor.', json_schema_extra={'units': None, 'required': False, 'examples': ['1.0+0.0j', '0.5+0.5j']})]
t: Annotated[numpy.typing.NDArray[numpy.complex128] | None, Field(default_factory=lambda: np.empty((0, 1, 2), dtype=np.complex128), description='Estimates of the tipper tensor.', json_schema_extra={'units': '[]', 'required': False, 'examples': ['1.0+0.0j', '0.5+0.5j']})]
t_var: Annotated[numpy.typing.NDArray[numpy.float64] | None, Field(default_factory=lambda: np.empty((0, 1, 2), dtype=np.float64), description='Variance estimates for the tipper tensor.', json_schema_extra={'units': None, 'required': False, 'examples': ['0.01', '0.1', '1.0']})]
t_invsigcov: Annotated[numpy.typing.NDArray[numpy.complex128] | None, Field(default_factory=lambda: np.empty((0, 2, 2), dtype=np.complex128), description='Inverse of the covariance matrix for the tipper tensor.', json_schema_extra={'units': None, 'required': False, 'examples': ['1.0+0.0j', '0.5+0.5j']})]
t_residcov: Annotated[numpy.typing.NDArray[numpy.complex128] | None, Field(default_factory=lambda: np.empty((0, 1, 1), dtype=np.complex128), description='Residual covariance matrix for the tipper tensor.', json_schema_extra={'units': None, 'required': False, 'examples': ['1.0+0.0j', '0.5+0.5j']})]
classmethod validate_array(value, info)

Validate that the value is a numpy array or None.

initialize_arrays(n_periods)

Initialize arrays for the transfer function data.

Parameters:

n_periods (int) – number of periods

Returns:

None

Return type:

None

property array_dict: dict
property n_periods: int
read_block(block, period_index)

Read a period block which is root_dict[“data”][“period”][ii]

Parameters:
  • block (dict) – read a period block

  • period_index (int) – index of the period in the data

Returns:

None

Return type:

None

read_dict(root_dict)

read root_dict[“data”] This is the main data block for the transfer function data. :param root_dict: dictionary containing the transfer function data :type root_dict: dict :return: None :rtype: None

write_block(parent, index)

Write a data block

Parameters:

parent (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

to_xml(string=False, required=True)

Write data blocks

Parameters:

parent (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

class mt_metadata.transfer_functions.io.emtfxml.metadata.EMTF(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

description: Annotated[str | None, Field(default='', description='description of what is in the file; default is magnetotelluric transfer functions', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Magnetotelluric Transfer Functions']})]
product_id: Annotated[str | None, Field(default='', description='ID given as the archive ID of the station', alias=None, pattern='^[a-zA-Z0-9._-]*$', json_schema_extra={'units': None, 'required': True, 'examples': ['USMTArray.NVS11.2020']})]
tags: Annotated[str | None, Field(default='', description='tags that help describe the data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['impedance, induction vectors']})]
sub_type: Annotated[mt_metadata.common.enumerations.DataTypeEnum, Field(default=DataTypeEnum.MT_TF, description='subject data type', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['MT_TF']})]
notes: Annotated[str | None, Field(default=None, description='any notes applicable to the user on data present in the file', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['these are notes']})]