mt_metadata.timeseries.stationxml.utils

Created on Tue Feb 16 10:33:27 2021

copyright:

Jared Peacock (jpeacock@usgs.gov)

license:

MIT

Classes

BaseTranslator

Base translator for StationXML <--> MT Metadata

Module Contents

class mt_metadata.timeseries.stationxml.utils.BaseTranslator

Base translator for StationXML <–> MT Metadata

logger
xml_translator
mt_translator
mt_comments_list = []
static flip_dict(original_dict)

Flip keys and values of the dictionary

Need to take care of duplicate names and lists of names

Parameters:

original_dict (dict) – original dictionary

Returns:

reversed dictionary

Return type:

dictionary

static read_xml_comment(comment)

read stationxml comment

Assuming that separate comments are split by ‘:’ and separated by a comma.

static read_xml_identifier(identifiers)

Read stationxml idenfier, which is a list of doi numbers, make it into a string without the doi

Parameters:

doi (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

get_comment(comments, subject)

Get the correct comment from a list of comments

Parameters:
  • comments (list) – list of obspy.core.inventory.Comments

  • subject (string) – subject heading to get

Returns:

the corresponding comment

Return type:

obspy.core.inventory.Comments

make_mt_comments(mt_element, mt_key_base='mt')

make comments from an MT element from self.mt_comments_list

Parameters:

mt_element – MT metadata element

xml_to_mt(value)
mt_to_xml(value)