mt_metadata.timeseries.experiment ================================= .. py:module:: mt_metadata.timeseries.experiment .. autoapi-nested-parse:: Containers for the full metadata tree Experiment --> Survey --> Station --> Run --> Channel Each level has a list attribute Created on Mon Feb 8 21:25:40 2021 :copyright: Jared Peacock (jpeacock@usgs.gov) :license: MIT Classes ------- .. autoapisummary:: mt_metadata.timeseries.experiment.Experiment Module Contents --------------- .. py:class:: Experiment(**data) Bases: :py:obj:`mt_metadata.base.MetadataBase` Top level of the metadata .. py:attribute:: surveys :type: Annotated[mt_metadata.common.list_dict.ListDict | list | dict | collections.OrderedDict, Field(default_factory=ListDict, description='List of surveys in the experiment', title='List of Surveys', json_schema_extra={'required': False, 'units': None, 'examples': [{'id': 'survey_1'}, {'id': 'survey_2'}]})] .. py:method:: merge(other) Merge two Experiment objects .. py:property:: n_surveys :type: int .. py:method:: validate_surveys(value) :classmethod: set the survey list .. py:property:: survey_names :type: list[str] Return names of surveys in experiment .. py:method:: has_survey(survey_id) Has survey id :param survey_id: DESCRIPTION :type survey_id: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: survey_index(survey_id) Get survey index :param survey_id: DESCRIPTION :type survey_id: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: add_survey(survey_obj) Add a survey, if has the same name update that object. :param survey_obj: DESCRIPTION :type survey_obj: `:class:`mt_metadata.timeseries.Survey` :return: DESCRIPTION :rtype: TYPE .. py:method:: get_survey(survey_id) Get a survey from the survey id :param survey_id: DESCRIPTION :type survey_id: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: remove_survey(survey_id, update = True) Remove a survey from the experiment :param survey_id: DESCRIPTION :type survey_id: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: to_dict(nested = False, required = True) create a dictionary for the experiment object. :param nested: DESCRIPTION, defaults to False :type nested: TYPE, optional :param single: DESCRIPTION, defaults to False :type single: TYPE, optional :param required: DESCRIPTION, defaults to True :type required: TYPE, optional :return: DESCRIPTION :rtype: TYPE .. py:method:: from_dict(ex_dict, skip_none = True) fill from an input dictionary :param ex_dict: DESCRIPTION :type ex_dict: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: to_json(fn = None, nested = False, indent = ' ' * 4, required = True) Write a json string from a given object, taking into account other class objects contained within the given object. :param nested: make the returned json nested :type nested: [ True | False ] , default is False .. py:method:: from_json(json_str, skip_none = True) read in a json string and update attributes of an object :param json_str: json string or file path :type json_str: string or :class:`pathlib.Path` .. py:method:: to_xml(fn = None, required = True, sort = True) Write XML version of the experiment :param fn: DESCRIPTION :type fn: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: from_xml(fn = None, element = None, sort = True, skip_none = True) :param fn: DESCRIPTION, defaults to None :type fn: TYPE, optional :param element: DESCRIPTION, defaults to None :type element: TYPE, optional :return: DESCRIPTION :rtype: TYPE .. py:method:: to_pickle(fn = None) Write a pickle version of the experiment :param fn: DESCRIPTION :type fn: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: from_pickle(fn = None) Read pickle version of experiment :param fn: DESCRIPTION :type fn: TYPE :return: DESCRIPTION :rtype: TYPE .. py:method:: sort(inplace = True) sort surveys, stations, runs, channels alphabetically/numerically :param inplace: DESCRIPTION, defaults to True :type inplace: TYPE, optional :return: DESCRIPTION :rtype: TYPE