mt_metadata.timeseries.stationxml.utils ======================================= .. py:module:: mt_metadata.timeseries.stationxml.utils .. autoapi-nested-parse:: Created on Tue Feb 16 10:33:27 2021 :copyright: Jared Peacock (jpeacock@usgs.gov) :license: MIT Classes ------- .. autoapisummary:: mt_metadata.timeseries.stationxml.utils.BaseTranslator Module Contents --------------- .. py:class:: BaseTranslator Base translator for StationXML <--> MT Metadata .. py:attribute:: logger .. py:attribute:: xml_translator .. py:attribute:: mt_translator .. py:attribute:: mt_comments_list :value: [] .. py:method:: flip_dict(original_dict) :staticmethod: Flip keys and values of the dictionary Need to take care of duplicate names and lists of names :param original_dict: original dictionary :type original_dict: dict :return: reversed dictionary :rtype: dictionary .. py:method:: read_xml_comment(comment) :staticmethod: read stationxml comment Assuming that separate comments are split by ':' and separated by a comma. .. py:method:: read_xml_identifier(identifiers) :staticmethod: Read stationxml idenfier, which is a list of doi numbers, make it into a string without the doi :param doi: DESCRIPTION :type doi: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: get_comment(comments, subject) Get the correct comment from a list of comments :param comments: list of :class:`obspy.core.inventory.Comments` :type comments: list :param subject: subject heading to get :type subject: string :return: the corresponding comment :rtype: :class:`obspy.core.inventory.Comments` .. py:method:: make_mt_comments(mt_element, mt_key_base='mt') make comments from an MT element from self.mt_comments_list :param mt_element: MT metadata element .. py:method:: xml_to_mt(value) .. py:method:: mt_to_xml(value)