Metadata for magnetotelluric data
Project description
mt_metadata
Standard MT metadata
Description
MT Metadata is a project led by IRIS-PASSCAL MT Software working group and USGS to develop tools that standardize magnetotelluric metadata, well, at least create tools for standards that are generally accepted. This include the two main types of magnetotelluric data
-
Time Series
- Supports translation to/from StationXML
- Structured as:
- Experiment -> Survey -> Station -> Run -> Channel
-
Transfer Functions
- Supports (will support) to/from EDI, ZMM (Egberts EMTF output), JFILE (BIRRP output), EMTFXML (Kelbert's format)
Most people will be using the transfer functions, but a lot of that metadata comes from the time series metadata. This module supports both and has tried to make them more or less seamless to reduce complication.
Standards
Each metadata keyword has an associated standard that goes with it. These are stored internally in JSON file. The JSON files are read in when the package is loaded to initialize the standards. Each keyword is described by:
-
type - How the value should be represented based on very basic types
- string
- number (float or integer)
- boolean
-
required - A boolean (True or False) denoting whether the metadata key word required to represent the data.
-
style - How the value should be represented within the type. For instance is the value a controlled string where there are only a few options, or is the value a controlled naming convention where only a 5 character alpha-numeric string is allowed. The styles are
- Alpha Numeric a string with alphabetic and numberic characters
- Free Form a free form string
- Controlled Vocabulary only certain values are allowed according to options
- Date a date and/or time string in ISO format
- Number a float or integer
- Boolean the value can only be True or False
-
units - Units of the value
-
description - Full description of what the metadata key is meant to convey.
-
options - Any options of a Controlled Vocabulary style.
-
alias - Any aliases that may represent the same metadata key.
-
example - An example value to inform the user.
All input values are internally validated according to the definition providing a robust way to standardize metadata.
Each metadata object is based on a Base class that has methods:
- to/from_json
- to/from_xml
- to_from_dict
- attribute_information
And each object has a doc string that describes the standard:
Metadata Key | Description | Example |
---|---|---|
key | description of what the key describes | example value |
Required: False | ||
Units: None | ||
Type: string | ||
Style: controlled vocabulary |
The time series module is more mature than the transfer function module at the moment, and this is still a work in progress.
Installation
PIP
pip install mt_metadata
Conda
Soon to be
conda install mt_metadata
Documentation
Example
from mt_metadata import timeseries
x = timeseries.Instrument()
Help
help(x)
+----------------------------------------------+-----------------------------------------------+----------------+
| **Metadata Key** | **Description** | **Example** |
+==============================================+===============================================+================+
| **id** | instrument ID number can be serial number or | mt01 |
| | a designated ID | |
| Required: True | | |
| | | |
| Units: None | | |
| | | |
| Type: string | | |
| | | |
| Style: free form | | |
+----------------------------------------------+-----------------------------------------------+----------------+
| **manufacturer** | who manufactured the instrument | mt gurus |
| | | |
| Required: True | | |
| | | |
| Units: None | | |
| | | |
| Type: string | | |
| | | |
| Style: free form | | |
+----------------------------------------------+-----------------------------------------------+----------------+
| **type** | instrument type | broadband |
| | | 32-bit |
| Required: True | | |
| | | |
| Units: None | | |
| | | |
| Type: string | | |
| | | |
| Style: free form | | |
+----------------------------------------------+-----------------------------------------------+----------------+
| **model** | model version of the instrument | falcon5 |
| | | |
| Required: False | | |
| | | |
| Units: None | | |
| | | |
| Type: string | | |
| | | |
| Style: free form | | |
+----------------------------------------------+-----------------------------------------------+----------------+
Fill in metadata
x.model = "falcon 5"
x.type = "broadband 32-bit"
x.manufacturer = "MT Gurus"
x.id = "f176"
to JSON
print(x.to_json())
{
"instrument": {
"id": "f176",
"manufacturer": "MT Gurus",
"model": "falcon 5",
"type": "broadband 32-bit"
}
}
to XML
print(x.to_xml(string=True))
<?xml version="1.0" ?>
<instrument>
<id>f176</id>
<manufacturer>MT Gurus</manufacturer>
<model>falcon 5</model>
<type>broadband 32-bit</type>
</instrument>
======= History
0.1.0 (2020-12-30)
- First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file mt_metadata-0.1.2.tar.gz
.
File metadata
- Download URL: mt_metadata-0.1.2.tar.gz
- Upload date:
- Size: 358.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef5f9c121994ecb3cb3240eea1176ef14b4343309ca78398a098cdfe1a9263ae |
|
MD5 | e11ae619782df39877d7c86054bfb40a |
|
BLAKE2b-256 | 775540fa825b3dd139f3be3ca092918748591eaea82a570b8b973df251787c8b |
File details
Details for the file mt_metadata-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: mt_metadata-0.1.2-py3-none-any.whl
- Upload date:
- Size: 193.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a69cceb7dbdc73290d4839ef8ce558a2d0cf319371ed176f7d1a21cc8a7c5a02 |
|
MD5 | f0622e0fb314814c3248763ee2146991 |
|
BLAKE2b-256 | 4719ce315ee7ad0e9b36ae3298db76f977402a8cbdeff573b9ba9f736a907ec9 |
File details
Details for the file mt_metadata-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: mt_metadata-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 193.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b69172e5dc6863b87ffe840543cd3f76eaba8b44c5472a6563b232ff7318f170 |
|
MD5 | ed6c31ede96c04af487b26cff40931c4 |
|
BLAKE2b-256 | b926d3b0459983b461dfaaac08d3fcd4cd34c64896b26aeb75ad7374aaa93780 |