:mod:`dataclasses` ================== .. py:module:: dataclasses Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dataclasses.KM3Object dataclasses.Table dataclasses.Function dataclasses.LookUpTable dataclasses.HDFTable dataclasses.SCSServiceVO dataclasses.AudioWave dataclasses.BytesEncoder Functions ~~~~~~~~~ .. autoapisummary:: dataclasses.print_nice dataclasses.from_json dataclasses._contract_dict .. py:class:: KM3Object Class to hold data object from ODC .. !! processed by numpydoc !! .. method:: from_resource(cls, resourceinfo, datalocation, loadoption='') :classmethod: Create class instance from resource info (metadata from ODC) and filepath to datafile in cache. .. !! processed by numpydoc !! .. method:: _set_meta(self) Function template to set object attributes from resource metadata .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reads data from file in cache. .. !! processed by numpydoc !! .. method:: show_metadata(self) .. py:class:: Table Bases: :class:`dataclasses.KM3Object` Table of values from json-formatted data .. !! processed by numpydoc !! .. method:: _set_meta(self) Function template to set object attributes from resource metadata .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reads data from file in cache. .. !! processed by numpydoc !! .. method:: get_dataframe(self) returns table as pandas dataframe. .. !! processed by numpydoc !! .. py:class:: Function Bases: :class:`dataclasses.KM3Object` Class to generate numpy function from resource .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reads json file .. !! processed by numpydoc !! .. method:: _set_meta(self) Setting parameter info from metadata .. !! processed by numpydoc !! .. method:: show_paraminfo(self) returns info on parameter ranges .. !! processed by numpydoc !! .. method:: get_function(self) Returns function as numpy object .. !! processed by numpydoc !! .. method:: evaluate(self, xvalue) Returns evaluated function for a given input value .. !! processed by numpydoc !! .. py:class:: LookUpTable Bases: :class:`dataclasses.KM3Object` Table that can be queried for given x and y value. .. !! processed by numpydoc !! .. method:: _set_meta(self) Setting parameter info and normalization from metadata .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reads json file .. !! processed by numpydoc !! .. method:: show_paraminfo(self) returns info on parameter ranges .. !! processed by numpydoc !! .. method:: check_inrange(self, xvalue, yvalue) Check if query values (xvalue, yvalue) in range .. !! processed by numpydoc !! .. method:: get_dataframe(self) returns table as pandas dataframe. .. !! processed by numpydoc !! .. method:: lookup(self, xvalue, yvalue) Returns value for given x and y values from table .. !! processed by numpydoc !! .. py:class:: HDFTable Bases: :class:`dataclasses.KM3Object` Class to hold data object from ODC .. !! processed by numpydoc !! .. method:: _set_meta(self) Function template to set object attributes from resource metadata .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reading data as 'pandas' or 'table' (default). .. !! processed by numpydoc !! .. method:: get_provenance(self, displayinfo=True) Returns provenance information stored in the file .. !! processed by numpydoc !! .. method:: get_dataframe(self) .. method:: get_paraminfo(self, colname='') Shows information about parameters in table .. !! processed by numpydoc !! .. py:class:: SCSServiceVO Bases: :class:`dataclasses.KM3Object` Class returning TAP service using the pyvo package. For further use of pyvo, see https://pyvo.readthedocs.io/en/latest/ .. !! processed by numpydoc !! .. method:: _set_meta(self) Function template to set object attributes from resource metadata .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reads data from file in cache. .. !! processed by numpydoc !! .. method:: get_tap(self) returns VO TAP service to use ADQL queries on data table .. !! processed by numpydoc !! .. method:: get_scs(self) returns Simple Cone Search Service .. !! processed by numpydoc !! .. method:: get_dataframe(self) returns astropy table with full data set. .. !! processed by numpydoc !! .. method:: show_paraminfo(self) returns info on parameters .. !! processed by numpydoc !! .. py:class:: AudioWave Bases: :class:`dataclasses.KM3Object` Class for handling wave audio files from KM3NeT hydrophones .. !! processed by numpydoc !! .. method:: _set_meta(self) Function template to set object attributes from resource metadata .. !! processed by numpydoc !! .. method:: _read_data(self, loadoption='') Reads data from file in cache. .. !! processed by numpydoc !! .. method:: show_paraminfo(self) returns info on parameters .. !! processed by numpydoc !! .. method:: get_dataframe(self, endframe=1000, startframe=0) Returns wave frames as pandas DataFrame, betweem startframe and endframe. .. !! processed by numpydoc !! .. function:: print_nice(inlist, selection={'Identifier': 'odcid', 'Title': 'title', 'Description': 'description'}) function to display contents of list of dictionaries as table. Option 'selection' takes dictionary with pairs of (columnname, key). .. !! processed by numpydoc !! .. py:class:: BytesEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None) Bases: :class:`json.JSONEncoder` Helper to handle hdf5 headers .. !! processed by numpydoc !! .. method:: default(self, obj) Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o) .. !! processed by numpydoc !! .. function:: from_json(instring) Formatting the json string to make it useable from json.loads .. !! processed by numpydoc !! .. function:: _contract_dict(indict, inlist=False, tofloat=False) Reformat dictionary with entries of similar keys to unnested dictionary .. !! processed by numpydoc !!