mt_metadata.common
There are multiple containers for each type of metadata, named appropriately. These are common metadata containers. They all inherit from MetadataBase.
MetadataBase Objects
MTime - Time representation with validation
Comment - Structured comment metadata
ListDict - Dictionary of lists for multi-valued attributes
MinMaxRange - Numeric range with min/max values
StartEndRange - Time or value range with start/end
Declination - Magnetic declination information
GeographicLocation - Geographic coordinates and location data
Orientation - Sensor orientation parameters
Instrument - Instrument specifications and metadata
Fdsn - FDSN (International Federation of Digital Seismograph Networks) metadata
Rating - Data quality rating information
DataQuality - Comprehensive data quality metrics
Citation - Publication and citation information
Copyright - Copyright and licensing details
Person - Person contact information
AuthorPerson - Author-specific metadata
FundingSource - Funding agency and grant information
Software - Software and processing tool metadata
TimePeriod - Time period with start/end times
TimePeriodDate - Time period using dates
Provenance - Data provenance and processing history
BasicLocation - Basic location without datum
BasicLocationNoDatum - Minimal location information
Location - Full location with datum and projection
StationLocation - Station-specific location metadata
Band - Frequency band definition
Created on Sun Apr 24 20:50:41 2020
- copyright:
Jared Peacock (jpeacock@usgs.gov)
- license:
MIT
Submodules
- mt_metadata.common.band
- mt_metadata.common.citation
- mt_metadata.common.comment
- mt_metadata.common.copyright
- mt_metadata.common.data_quality
- mt_metadata.common.declination
- mt_metadata.common.enumerations
- mt_metadata.common.fdsn
- mt_metadata.common.funding_source
- mt_metadata.common.geographic_location
- mt_metadata.common.instrument
- mt_metadata.common.list_dict
- mt_metadata.common.location
- mt_metadata.common.mttime
- mt_metadata.common.orientation
- mt_metadata.common.person
- mt_metadata.common.provenance
- mt_metadata.common.range
- mt_metadata.common.rating
- mt_metadata.common.software
- mt_metadata.common.time_period
- mt_metadata.common.units
Classes
str(object='') -> str |
|
str(object='') -> str |
|
str(object='') -> str |
|
str(object='') -> str |
|
str(object='') -> str |
|
str(object='') -> str |
|
split by - if needed |
|
str(object='') -> str |
|
Enumeration of software licenses. |
|
str(object='') -> str |
|
str(object='') -> str |
|
str(object='') -> str |
|
Date and time container based on pandas.Timestamp with UTC enforcement. |
|
Base class for all metadata objects with Pydantic validation. |
|
Hack together an object that acts like a dictionary and list such that a |
|
Range of values. |
|
Range of values. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Base class for all metadata objects with Pydantic validation. |
|
Time span of a period of time. |
|
Time span of a period of time. |
|
Base class for all metadata objects with Pydantic validation. |
|
A partial location class that only includes the latitude, longitude, and elevation. |
|
A partial location class that only includes the latitude, longitude, and elevation. |
|
Positional location of a geographic point |
|
A class that represents the location of a station. It includes latitude, longitude, elevation, |
|
Base class for all metadata objects with Pydantic validation. |
|
str(object='') -> str |
|
str(object='') -> str |
Package Contents
- class mt_metadata.common.ChannelLayoutEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- L = 'L'
- X = 'X'
- plus = '+'
- class mt_metadata.common.ChannelOrientationEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- orthogonal = 'orthogonal'
- station = 'station'
- site_layout = 'sitelayout'
- class mt_metadata.common.DataTypeEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- RMT = 'RMT'
- AMT = 'AMT'
- BBMT = 'BBMT'
- LPMT = 'LPMT'
- ULPMT = 'ULPMT'
- MT = 'MT'
- LP = 'LP'
- BB = 'BB'
- WB = 'WB'
- MT_TF = 'MT_TF'
- BBMT_TF = 'BBMT_TF'
- WBMT_TF = 'WBMT_TF'
- LPMT_TF = 'LPMT_TF'
- CSAMT = 'CSAMT'
- NSAMT = 'NSAMT'
- class mt_metadata.common.ArrayDTypeEnum
Bases:
str,enum.Enumstr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- real_type = 'real'
- complex_type = 'complex'
- float_type = 'float'
- int_type = 'int'
- complex_128_type = 'complex128'
- complex_64_type = 'complex64'
- float_64_type = 'float64'
- float_32_type = 'float32'
- float_16_type = 'float16'
- int_64_type = 'int64'
- int_32_type = 'int32'
- int_16_type = 'int16'
- int_8_type = 'int8'
- class mt_metadata.common.FilterTypeEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- fap_table = 'fap'
- zpk = 'zpk'
- time_delay = 'time_delay'
- coefficient = 'coefficient'
- fir = 'fir'
- class mt_metadata.common.GeographicReferenceFrameEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- geographic = 'geographic'
- geomagnetic = 'geomagnetic'
- station = 'station'
- site_layout = 'sitelayout'
- class mt_metadata.common.GeomagneticModelEnum
Bases:
str,enum.Enumsplit by - if needed
- EMAG2 = 'EMAG2'
- EMM = 'EMM'
- HDGM = 'HDGM'
- IGRF = 'IGRF'
- WMM = 'WMM'
- unknown = 'unknown'
- class mt_metadata.common.StdEDIversionsEnum
Bases:
str,enum.Enumstr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- SEG_1 = 'SEG 1.0'
- one = '1.0'
- SEG_10 = 'SEG_1.0'
- SEG_101 = 'SEG 1.01'
- SEG_1011 = 'SEG_1.01'
- class mt_metadata.common.LicenseEnum
Bases:
str,enum.EnumEnumeration of software licenses. Dynamically loaded from JSON data.
- class mt_metadata.common.OrientationMethodEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- compass = 'compass'
- GPS = 'GPS'
- theodolite = 'theodolite'
- class mt_metadata.common.SignConventionEnum
Bases:
str,enum.Enumstr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- plus = '+'
- minus = '-'
- exp_plus = 'exp(+iwt)'
- exp_minus = 'exp(-iwt)'
- exp_plus_iwt = 'exp(+ i\\omega t)'
- exp_minus_iwt = 'exp(- i\\omega t)'
- class mt_metadata.common.SymmetryEnum
Bases:
StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- NONE = 'NONE'
- ODD = 'ODD'
- EVEN = 'EVEN'
- class mt_metadata.common.MTime(/, **data)
Bases:
pydantic.BaseModelDate and time container based on pandas.Timestamp with UTC enforcement.
A flexible datetime container that accepts various input formats and converts them to a UTC-localized pandas.Timestamp object. Provides convenient access to date/time components and handles nanosecond precision.
- Parameters:
time_stamp (float, int, np.number, np.datetime64, pd.Timestamp, str, or None, optional) – Input timestamp in various formats: - float/int: epoch seconds - np.number: numpy numeric types (converted to Python types) - np.datetime64: numpy datetime - pd.Timestamp: pandas timestamp (will be UTC-localized) - str: ISO format or parseable date string - None: defaults to 1980-01-01T00:00:00+00:00 Default is None.
gps_time (bool, optional) – If True, interprets time_stamp as GPS time and converts to UTC. Default is False.
- time_stamp
The stored timestamp, always UTC-localized.
- Type:
pd.Timestamp
- gps_time
Whether GPS time conversion was applied.
- Type:
bool
Notes
The pandas.Timestamp backend allows nanosecond precision timing.
Input values outside pandas timestamp bounds are automatically clamped: - Values > 2200: set to pandas.Timestamp.max (2262-04-11 23:47:16.854775807) - Values < 1900: set to pandas.Timestamp.min (1677-09-21 00:12:43.145224193)
All timestamps are forced to UTC timezone regardless of input timezone.
Examples
Create from various input types:
>>> t = MTime() # Default time >>> t.isoformat() '1980-01-01T00:00:00+00:00'
>>> t = MTime(time_stamp="2020-01-15T12:30:45") >>> t.year 2020
>>> t = MTime(time_stamp=1579095045.0) # Epoch seconds >>> t.isoformat() '2020-01-15T12:30:45+00:00'
Access and modify components:
>>> t.year = 2025 >>> t.month = 12 >>> t.day = 31 >>> t.epoch_seconds 1767225045.0
- model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- gps_time: Annotated[bool, Field(description='Defines if the time give in GPS time [True] or UTC [False]', default=False, json_schema_extra={'units': None, 'required': False, 'examples': [True, False]})] = False
- time_stamp: Annotated[float | int | numpy.number | numpy.datetime64 | pandas.Timestamp | str | None, Field(default_factory=lambda: pd.Timestamp(MTime._default_time.default), description='Time in UTC format', examples=['1980-01-01T00:00:00+00:00'])]
- classmethod validate_time_stamp(field_value, validation_info)
Validate and convert input timestamp to pandas Timestamp.
Pydantic field validator that processes various timestamp input formats and converts them to a standardized UTC pandas Timestamp object.
- Parameters:
field_value (float, int, np.datetime64, pd.Timestamp, str, or UTCDateTime) – Input timestamp value in any supported format.
validation_info (ValidationInfo) – Pydantic validation context containing model data including gps_time setting.
- Returns:
UTC-localized timestamp object, clamped to pandas bounds if necessary.
- Return type:
pd.Timestamp
Notes
This method is automatically called during model instantiation. GPS time conversion is applied if gps_time=True in the model data. Out-of-bounds timestamps are automatically clamped to valid ranges.
- is_default()
Test if the time_stamp value is the default value
- to_dict(nested=False, single=False, required=True)
Convert the time stamp to a dictionary with the ISO format string.
- Returns:
The ISO format string.
- Return type:
str
- from_dict(value, skip_none=False)
This will have to accept just a single value, not a dict. This is to keep original functionality.
- Parameters:
value (str | int | float | np.datetime64 | pd.Timestamp) – time stamp value
- property iso_str: str
returns: ISO formatted string of the time stamp. :rtype: str
- property iso_no_tz: str
ISO formatted string of the time stamp without the timezone. This is useful for storing the time stamp in a database or other format where the timezone is not needed.
- Returns:
ISO formatted string of the time stamp without the timezone.
- Return type:
str
- property epoch_seconds: float
Epoch seconds of the time stamp. This is the number of seconds since the epoch (1970-01-01 00:00:00 UTC).
- Returns:
epoch seconds of the time stamp.
- Return type:
float
- property date: str
Date in ISO format. This is the date part of the time stamp without the time part. This is useful for storing the date in a database or other format where the time is not needed. The date is in the format YYYY-MM-DD.
- Returns:
ISO formatted date string of the time stamp.
- Return type:
str
- property year: int
Year of the time stamp
- Returns:
year of the time stamp
- Return type:
int
- property month: int
Month of the time stamp. This is the month part of the time stamp without the time part. This is useful for storing the month in a database or other format where the time is not needed.
- Returns:
month of time stamp
- Return type:
int
- property day: int
Day of the time stamp. This is the day part of the time stamp without the time part.
- Returns:
Day of the time stamp
- Return type:
int
- property hour: int
Hour of the time stamp.
- Returns:
hour of the time stamp
- Return type:
int
- property minutes: int
- property seconds: int
- property microseconds: int
- property nanoseconds: int
- now()
The current time in UTC format.
- Returns:
The current time as an MTime object.
- Return type:
- copy()
make a copy of the time
- isoformat()
ISO formatted string of the time stamp. This is the ISO format string of the time stamp.
formatted as: YYYY-MM-DDThh:mm:ss.ssssss+00:00
- Returns:
ISO formatted date time string
- Return type:
str
- isodate()
ISO formatted date string of the time stamp. This is the ISO format string of the date part of the time stamp.
formatted as: YYYY-MM-DD
- Returns:
_description_
- Return type:
str
- isocalendar()
ISO formatted calendar string of the time stamp. This is the ISO format string of the calendar part of the time stamp.
Formatted as: YYYY-WW-D where YYYY is the year, WW is the week number, and D is the day of the week.
- Returns:
ISO formatted calendar string of the time stamp.
- Return type:
str
- class mt_metadata.common.Comment(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- author: Annotated[str | None, Field(default=None, description='person who authored the comment', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['J. Pedantic']})]
- time_stamp: Annotated[float | int | numpy.datetime64 | pandas.Timestamp | str | mt_metadata.common.mttime.MTime | None, Field(default_factory=lambda: MTime(time_stamp='1980-01-01T00:00:00+00:00'), description='Date and time of in UTC of when comment was made.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['2020-02-01T09:23:45.453670+00:00']})]
- value: Annotated[str | list | None, Field(default=None, description='comment string', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['failure at midnight.']})] = None
- classmethod validate_time(value, info)
Validate that the value is a valid time.
- classmethod validate_value(value, info)
Validate that the value is a valid string or list.
- set_variables()
Validate that the value is a valid string.
- as_string()
Returns the comment as “{time_stamp} | {author} | {comment}”
- Returns:
formatted comment
- Return type:
str
- from_dict(value, skip_none=False)
Parse input comment assuming “{time_stamp} | {author} | {comment}”
- Parameters:
value (str) – _description_
skip_none (bool, optional) – _description_, by default False
- read_dict(input_dict)
can probably use from_dict method instead, but to keep consistency in EMTF XML metadata, this method is used to read the comment from a dictionary.
- Parameters:
input_dict (dict) – input dictionary containing comment data
- Returns:
None
- Return type:
None
- to_xml(string=False, required=True)
Convert the Comment 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.
- Returns:
XML representation of the Comment.
- Return type:
str | et.Element
- class mt_metadata.common.ListDict(values={})
Hack together an object that acts like a dictionary and list such that a user can get an item by index or key.
This is the first attempt, seems to work, might think about inheriting an OrderedDict and overloading.
- copy()
Copy object
- keys()
- values()
- items()
- append(obj)
Append an object
- Parameters:
obj (TYPE) – DESCRIPTION
- Returns:
DESCRIPTION
- Return type:
TYPE
- remove(key)
remove an item based on key or index
- Parameters:
key (TYPE) – DESCRIPTION
- Returns:
DESCRIPTION
- Return type:
TYPE
- extend(other, skip_keys=[])
extend the dictionary from another ListDict object
- Parameters:
other (TYPE) – DESCRIPTION
- Returns:
DESCRIPTION
- Return type:
TYPE
- sort(inplace=True)
sort the dictionary keys into alphabetical order
- update(other)
Update from another ListDict
- pop(key)
pop item off of dictionary. The key must be verbatim
- Parameters:
key (string) – key of item to be popped off of dictionary
- Returns:
item popped
- update_keys()
Update all keys in the ListDict based on the current state of the objects.
This is useful when object IDs have been changed after being added to the ListDict. The method will re-key all objects using their current ID values.
- Returns:
A dictionary mapping old keys to new keys for objects that were re-keyed.
- Return type:
dict
- to_dict(single=False, nested=False, required=False)
need to implement this method
- clear()
Clear all items from the ListDict.
- class mt_metadata.common.MinMaxRange(**data)
Bases:
mt_metadata.base.MetadataBaseRange of values.
- minimum
Minimum value of the range.
- Type:
float
- maximum
Maximum value of the range.
- Type:
float
- minimum: Annotated[float, Field(default=0.0, description='Minimum value of the range.', validation_alias=AliasChoices('minimum', 'min'), json_schema_extra={'examples': '1.0', 'type': 'number', 'units': None, 'required': True})]
- maximum: Annotated[float, Field(default=0.0, description='Maximum value of the range.', validation_alias=AliasChoices('maximum', 'max'), json_schema_extra={'examples': '1.0', 'type': 'number', 'units': None, 'required': True})]
- class mt_metadata.common.StartEndRange(**data)
Bases:
mt_metadata.base.MetadataBaseRange of values.
- start
starting value of the range.
- Type:
float
- end
Ending value of the range.
- Type:
float
- start: Annotated[float, Field(default=0.0, description='Starting value.', validation_alias=AliasChoices('start', 'beginning'), json_schema_extra={'examples': '1.0', 'type': 'number', 'units': None, 'required': True})]
- end: Annotated[float, Field(default=0.0, description='Ending value of the range.', validation_alias=AliasChoices('end', 'finish'), json_schema_extra={'examples': '1.0', 'type': 'number', 'units': None, 'required': True})]
- class mt_metadata.common.Declination(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- comments: Annotated[mt_metadata.common.Comment, Field(default_factory=lambda: Comment(), description='any comments on declination', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['estimated from WMM 2016']})]
- model: Annotated[mt_metadata.common.GeomagneticModelEnum, Field(default='IGRF', description='geomagnetic reference model used to calculate declination', json_schema_extra={'units': None, 'required': True, 'examples': ['WMM']})]
- epoch: Annotated[str | None, Field(default=None, description='Epoch for which declination was approximated in.', json_schema_extra={'units': None, 'required': False, 'examples': ['2020']})]
- value: Annotated[float, Field(default=0.0, description='declination angle relative to geographic north positive clockwise', json_schema_extra={'units': 'degrees', 'required': True, 'examples': ['12.5']})]
- classmethod validate_comments(value, info)
Validate that the value is a valid comment.
- class mt_metadata.common.GeographicLocation(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- country: Annotated[str | list[str] | None, Field(default=None, description='Country of the geographic location, should be spelled out in full. Can be a list of countries.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'United States of America'})]
- state: Annotated[str | list[str] | None, Field(default=None, description='State or province of the geographic location, should be spelled out in full. Can be a list of states or provinces.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '[Colorado, Utah]'})]
- county: Annotated[str | list[str] | None, Field(default=None, description='County of the geographic location, should be spelled out in full. Can be a list of counties.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '[Douglass, Fayet]'})]
- township: Annotated[str | list[str] | None, Field(default=None, description='Township or city name or code.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '090'})]
- section: Annotated[str | list[str] | None, Field(default=None, description='Section name or code.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '012'})]
- quarter: Annotated[str | list[str] | None, Field(default=None, description='Quarter section code.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '400'})]
- parcel: Annotated[str | list[str] | None, Field(default=None, description='Land parcel ID.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '46b29a'})]
- class mt_metadata.common.Orientation(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- method: Annotated[mt_metadata.common.enumerations.OrientationMethodEnum, Field(default='compass', description='method for orienting station layout', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': 'compass', 'type': 'string'})]
- reference_frame: Annotated[mt_metadata.common.enumerations.GeographicReferenceFrameEnum, Field(default=GeographicReferenceFrameEnum.geographic, description='Reference frame for station layout. There are only 2 options geographic and geomagnetic. Both assume a right-handed coordinate system with North=0 E=90 and vertical positive downward', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': 'geomagnetic', 'type': 'string'})]
- angle_to_geographic_north: Annotated[float | None, Field(default=None, description='Angle to rotate the data to align with geographic north. If this number is 0 then it is assumed the data are aligned with geographic north in a right handed coordinate system.', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': 'geomagnetic', 'type': 'number'})]
- value: Annotated[mt_metadata.common.enumerations.ChannelOrientationEnum | None, Field(default=ChannelOrientationEnum.orthogonal, description='Channel orientation relative to each other', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'orthogonal', 'type': 'string'})]
- class mt_metadata.common.Instrument(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- id: Annotated[str | None, Field(default='', description='Instrument ID number can be serial number or a designated ID.', validation_alias=AliasChoices('id', 'serial'), json_schema_extra={'units': None, 'required': False, 'examples': ['mt01']})]
- manufacturer: Annotated[str | None, Field(default='', description='Who manufactured the instrument.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['mt gurus']})]
- type: Annotated[str | None, Field(default='', description='Description of the instrument type.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['broadband 32-bit']})]
- model: Annotated[str | None, Field(default=None, description='Model version of the instrument.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['falcon5']})]
- name: Annotated[str | None, Field(default=None, description='Standard marketing name of the instrument.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['falcon5']})]
- class mt_metadata.common.Fdsn(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- id: Annotated[str | None, Field(default=None, description='Given FDSN archive ID name.', alias=None, pattern='^[a-zA-Z0-9._-]*$', json_schema_extra={'units': None, 'required': False, 'examples': ['MT001']})]
- network: Annotated[str | None, Field(default=None, description='Given two character FDSN archive network code. Needs to be 2 alpha numeric characters.', alias=None, pattern='^[a-zA-Z0-9]{2}$', json_schema_extra={'units': None, 'required': False, 'examples': ['EM']})]
- channel_code: Annotated[str | None, Field(default=None, description='Three character FDSN channel code. http://docs.fdsn.org/projects/source-identifiers/en/v1.0/channel-codes.html', alias=None, pattern='^[a-zA-Z0-9]{3}*$', json_schema_extra={'units': None, 'required': False, 'examples': ['LQN']})]
- new_epoch: Annotated[bool | None, Field(default=None, description='Boolean telling if a new epoch needs to be created or not.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['False']})]
- alternate_code: Annotated[str | None, Field(default=None, description='Alternate Code', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['_INT-NON_FDSN', '.UNRESTRICTED', '_US-ALL', '_US-MT', '_US-MT-TA']})]
- alternate_network_code: Annotated[str | None, Field(default=None, description='Alternate Network Code', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['_INT-NON_FDSN', '.UNRESTRICTED', '_US-ALL', '_US-MT', '_US-MT-TA']})]
- class mt_metadata.common.Rating(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- author: Annotated[str | None, Field(default=None, description='Author of who rated the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'gradstudent ace'})]
- method: Annotated[str | None, Field(default=None, description='The method used to rate the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'standard deviation'})]
- value: Annotated[int | None | str, Field(default=None, description='A rating from 1-5 where 1 is bad and 5 is good and 0 if unrated.', ge=0, le=5, alias=None, json_schema_extra={'units': None, 'required': True, 'examples': '4'})]
- classmethod validate_value(value, info)
- class mt_metadata.common.DataQuality(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- warnings: Annotated[str | None, Field(default=None, description='any warnings about the data that should be noted', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['periodic pipeline noise']})]
- 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']})]
- 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, Field(default_factory=Comment, description='any comments about the data quality', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['0']})]
- rating: Annotated[mt_metadata.common.Rating, Field(default_factory=Rating, description='rating of the data quality', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['0']})]
- classmethod validate_comments(value, info)
Validate that the value is a valid string.
- class mt_metadata.common.Citation(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- doi: Annotated[pydantic.HttpUrl | str | None, Field(default=None, description='full url of the doi number', validation_alias=AliasChoices('doi', 'survey_doi'), json_schema_extra={'units': None, 'required': False, 'examples': ['http://doi.###']})]
- authors: Annotated[str | None, Field(default=None, description='author names', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['M.Tee A. Roura']})]
- title: Annotated[str | None, Field(default=None, description='Full title of the citation', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Paper Title']})]
- year: Annotated[str | None, Field(default=None, description='Year of citation', alias=None, pattern='^\\d{4}(-\\d{4})?$', json_schema_extra={'units': None, 'required': False, 'examples': ['2020']})]
- volume: Annotated[str | None, Field(default=None, description='Journal volume of the citation', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['12']})]
- pages: Annotated[str | None, Field(default=None, description='Page numbers of the citation', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['10-15']})]
- journal: Annotated[str | None, Field(default=None, description='Journal title of citation', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['Journal of Geophysical Research']})]
- url: Annotated[pydantic.HttpUrl | str | None, Field(default=None, description='URL of the citation', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['https://example.com/citation']})]
- classmethod validate_doi(value)
Validate the 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
- class mt_metadata.common.Copyright(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- release_license: Annotated[mt_metadata.common.LicenseEnum, Field(default='CC BY 4.0', description='How the data can be used. The options are based on https://github.com/spdx/license-list-data', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': 'CC BY', 'type': 'string'})]
- classmethod validate_license(value, info)
Validate that the value is a valid license.
- class mt_metadata.common.AuthorPerson(**data)
Bases:
GenericPersonBase 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
- author: Annotated[str | None, Field(default='', description='Persons name, should be full first and last name.', validation_alias=AliasChoices('author', 'name'), json_schema_extra={'units': None, 'required': True, 'examples': ['person name']})]
- class mt_metadata.common.Person(**data)
Bases:
GenericPersonBase 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 | None, Field(default='', description='Persons name, should be full first and last name.', validation_alias=AliasChoices('name', 'author'), json_schema_extra={'units': None, 'required': True, 'examples': ['person name']})]
- class mt_metadata.common.FundingSource(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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[list[str] | str | None, Field(default=None, description='Persons name, should be full first and last name.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'person name', 'items': {'type': 'string'}})]
- organization: Annotated[list[str] | str | None, Field(default=None, description='Organization full name', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'mt gurus', 'items': {'type': 'string'}})]
- email: Annotated[list[pydantic.EmailStr] | pydantic.EmailStr | None, Field(default=None, description='Email of the contact person', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'mt.guru@em.org', 'items': {'type': 'string'}})]
- url: Annotated[list[pydantic.AnyHttpUrl] | pydantic.AnyHttpUrl | None, Field(default=None, description='URL of the contact person', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'em.org', 'items': {'type': 'string'}})]
- comments: Annotated[mt_metadata.common.Comment, Field(default_factory=lambda: Comment(), description='Any comments about the person', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'expert digger'})]
- grant_id: Annotated[list[str] | str | None, Field(default=None, description='Grant ID number or name', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'MT-01-2020', 'items': {'type': 'string'}})]
- classmethod validate_comments(value, info)
- classmethod validate_input(value)
make sure the inputs are lists
- Parameters:
value (_type_) – _description_
- Returns:
_description_
- Return type:
list
- class mt_metadata.common.Software(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- author: Annotated[str | None, Field(default='', description='Author of the software', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['Neo']})]
- version: Annotated[str, Field(default='', description='Software version', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['12.01a']})]
- last_updated: Annotated[mt_metadata.common.mttime.MTime | str | float | int | numpy.datetime64 | pandas.Timestamp | None, Field(default_factory=lambda: MTime(time_stamp=None), description='Most recent date the software was updated. Prefer to use version, but this works for non-versioned software.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['2020-01-01']})]
- name: Annotated[str, Field(default='', description='Software name', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['mtrules']})]
- classmethod validate_last_updated(field_value)
- class mt_metadata.common.TimePeriod(**data)
Bases:
mt_metadata.base.MetadataBaseTime span of a period of time.
- end: Annotated[str | float | int | numpy.datetime64 | pandas.Timestamp | mt_metadata.common.mttime.MTime, Field(default_factory=lambda: MTime(time_stamp='1980-01-01T00:00:00+00:00'), description='End date and time of collection in UTC.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': '2020-02-04T16:23:45.453670+00:00', 'type': 'string'})]
- start: Annotated[str | float | int | numpy.datetime64 | pandas.Timestamp | mt_metadata.common.mttime.MTime, Field(default_factory=lambda: MTime(), description='Start date and time of collection in UTC.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': '2020-02-01T09:23:45.453670+00:00', 'type': 'string'})]
- classmethod validate_time(value, info)
Validate that the value is a valid time.
- start_is_default()
Check if the start time is the default time.
- end_is_default()
Check if the end time is the default time.
- class mt_metadata.common.TimePeriodDate(**data)
Bases:
mt_metadata.base.MetadataBaseTime span of a period of time.
- end_date: Annotated[str | float | int | numpy.datetime64 | pandas.Timestamp | mt_metadata.common.mttime.MTime | mt_metadata.common.mttime.MDate, Field(default_factory=lambda: MDate(time_stamp='1980-01-01'), description='End date and time of collection in UTC.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': '2020-02-04', 'type': 'string'})]
- start_date: Annotated[str | float | int | numpy.datetime64 | pandas.Timestamp | mt_metadata.common.mttime.MTime | mt_metadata.common.mttime.MDate, Field(default_factory=lambda: MDate(time_stamp='1980-01-01'), description='Start date and time of collection in UTC.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': '2020-02-01', 'type': 'string'})]
- classmethod validate_time(value, info)
Validate that the value is a valid time.
- start_is_default()
Check if the start time is the default time.
- end_is_default()
Check if the end time is the default time.
- class mt_metadata.common.Provenance(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- creation_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', 'type': 'string'})]
- comments: Annotated[mt_metadata.common.Comment, Field(default_factory=Comment, description='Any comments on provenance of the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'all good', 'type': 'string'})]
- log: Annotated[str | None, Field(default=None, description='A history of changes made to the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': '2020-02-10T14:24:45+00:00 updated metadata', 'type': 'string'})]
- creator: Annotated[mt_metadata.common.AuthorPerson, Field(default_factory=AuthorPerson, description='Person who created the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Person(name=J. Pedantic, email=jped@mt.com)'})]
- submitter: Annotated[mt_metadata.common.AuthorPerson, Field(default_factory=AuthorPerson, description='Person who submitted the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Person(name=submitter_name, email=submitter@email)'})]
- archive: Annotated[mt_metadata.common.Person, Field(default_factory=Person, description='Archive from which the data was downloaded from.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Person(name=archive_name, url=https://archive.url)'})]
- software: Annotated[mt_metadata.common.Software, Field(default_factory=Software, description='Software used to create the data.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': 'Software(name=mt_metadata, version=0.1)'})]
- classmethod validate_creation_time(field_value)
- classmethod validate_comments(value, info)
Validate that the value is a valid comment.
- class mt_metadata.common.BasicLocation(**data)
Bases:
BasicLocationNoDatumA partial location class that only includes the latitude, longitude, and elevation. This is used to avoid circular imports.
- datum: Annotated[str | int, Field(default='WGS 84', description='Datum of the location values. Usually a well known datum like WGS84.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['WGS 84']})]
- x: Annotated[float, Field(default=0.0, description='relative distance to the center of the station', validation_alias=AliasChoices('x', 'easting', 'east'), json_schema_extra={'units': 'meters', 'required': False, 'examples': ['10.0']})]
- y: Annotated[float, Field(default=0.0, description='relative distance to the center of the station', validation_alias=AliasChoices('y', 'north', 'northing'), json_schema_extra={'units': 'meters', 'required': False, 'examples': ['10.0']})]
- z: Annotated[float, Field(default=0.0, description='relative elevation to the center of the station', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['10.0']})]
- classmethod validate_datum(value)
Validate the datum value and convert it to the appropriate enum type.
- class mt_metadata.common.BasicLocationNoDatum(**data)
Bases:
mt_metadata.base.MetadataBaseA partial location class that only includes the latitude, longitude, and elevation. This is used to avoid circular imports.
- latitude: Annotated[float | None, Field(default=0.0, description='Latitude of the location.', validation_alias=AliasChoices('latitude', 'lat'), json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['12.324']})]
- longitude: Annotated[float | None, Field(default=0.0, description='Longitude of the location.', validation_alias=AliasChoices('longitude', 'lon', 'long'), json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['12.324']})]
- elevation: Annotated[float, Field(default=0.0, description='Elevation of the location.', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['1234.0']})]
- classmethod validate_position(value, info)
- class mt_metadata.common.Location(**data)
Bases:
BasicLocationPositional location of a geographic point
- latitude_uncertainty: Annotated[float, Field(default=0.0, description='uncertainty in latitude estimation in degrees', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['0.01']})]
- longitude_uncertainty: Annotated[float, Field(default=0.0, description='uncertainty in longitude estimation in degrees', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['0.01']})]
- elevation_uncertainty: Annotated[float, Field(default=0.0, description='uncertainty in elevation estimation', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['0.01']})]
- x2: Annotated[float, Field(default=0.0, description='relative distance to the center of the station', validation_alias=AliasChoices('x2', 'east', 'easting'), json_schema_extra={'units': 'meters', 'required': False, 'examples': ['10.0']})]
- y2: Annotated[float, Field(default=0.0, description='relative distance to the center of the station', validation_alias=AliasChoices('y2', 'north', 'northing'), json_schema_extra={'units': 'meters', 'required': False, 'examples': ['10.0']})]
- z2: Annotated[float, Field(default=0.0, description='relative elevation to the center of the station', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['10.0']})]
- x_uncertainty: Annotated[float, Field(default=0.0, description='uncertainty in longitude estimation in x-direction', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['0.01']})]
- y_uncertainty: Annotated[float, Field(default=0.0, description='uncertainty in longitude estimation in y-direction', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['0.01']})]
- z_uncertainty: Annotated[float, Field(default=0.0, description='uncertainty in longitude estimation in z-direction', alias=None, json_schema_extra={'units': 'meters', 'required': False, 'examples': ['0.01']})]
- class mt_metadata.common.StationLocation(**data)
Bases:
LocationA class that represents the location of a station. It includes latitude, longitude, elevation, and other related attributes.
- declination: Annotated[mt_metadata.common.Declination, Field(default_factory=Declination, description='Declination of the location.', alias=None, json_schema_extra={'units': 'degrees', 'required': False, 'examples': ['Declination(10.0)']})]
- geographic_location: Annotated[mt_metadata.common.GeographicLocation, Field(default_factory=GeographicLocation, description='Geographic location of the station.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['GeographicLocation(latitude=12.34, longitude=56.78)']})]
- class mt_metadata.common.Band(**data)
Bases:
mt_metadata.base.MetadataBaseBase 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
- decimation_level: Annotated[int, Field(default=None, description='Decimation level for the band', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['0']})]
- index_max: Annotated[int, Field(default=None, description='maximum band index', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['10']})]
- index_min: Annotated[int, Field(default=None, description='minimum band index', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['10']})]
- frequency_max: Annotated[float, Field(default=0.0, description='maximum band frequency', alias=None, json_schema_extra={'units': 'Hertz', 'required': True, 'examples': ['0.04296875']})]
- frequency_min: Annotated[float, Field(default=0.0, description='minimum band frequency', alias=None, json_schema_extra={'units': 'Hertz', 'required': True, 'examples': ['0.03515625']})]
- center_averaging_type: Annotated[CenterAveragingTypeEnum, Field(default=CenterAveragingTypeEnum.geometric, description='type of average to apply when computing the band center', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['geometric']})]
- closed: Annotated[ClosedEnum, Field(default=ClosedEnum.left, description='whether interval is open or closed', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['left']})]
- name: Annotated[Optional[str], Field(default='', description='Name of the band', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['0.039062']})]
- classmethod validate_name(value, info)
- classmethod update_name_on_frequency_change(value, info)
- check_name()
- property lower_bound: float
- property upper_bound: float
- property width: float
returns the width of the band (the bandwidth).
- property lower_closed: bool
- property upper_closed: bool
- set_indices_from_frequencies(frequencies)
assumes min/max freqs are defined
- to_interval()
- property harmonic_indices
Assumes all harmoincs between min and max are present in the band
- Return type:
numpy array of integers corresponding to harminic indices
- in_band_harmonics(frequencies)
- Parameters:
frequencies (array-like, floating poirt)
Returns (numpy array) – the actual harmonics or frequencies in band, rather than the indices.
-------
- property center_frequency: float
returns: center_frequency – The frequency associated with the band center. :rtype: float
- property center_period: float
Returns the inverse of center frequency.
- overlaps(other)
Check if this band overlaps with another
- contains(other)
Check if this band contains nother
- property fractional_bandwidth: float
See - https://en.wikipedia.org/wiki/Bandwidth_(signal_processing)#Fractional_bandwidth - https://en.wikipedia.org/wiki/Q_factor
- property Q: float
Quality factor (Q) of the band.
- Returns:
Q factor. Returns infinity for zero-width bands.
- Return type:
float
- class mt_metadata.common.CenterAveragingTypeEnum
Bases:
mt_metadata.common.enumerations.StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- arithmetic = 'arithmetic'
- geometric = 'geometric'
- class mt_metadata.common.ClosedEnum
Bases:
mt_metadata.common.enumerations.StrEnumerationBasestr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- left = 'left'
- right = 'right'
- both = 'both'