pysiral.auxdata =============== .. py:module:: pysiral.auxdata .. autoapi-nested-parse:: Created on Fri May 19 14:42:35 2017 @author: Stefan Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pysiral/auxdata/icechart/index /autoapi/pysiral/auxdata/mdt/index /autoapi/pysiral/auxdata/ml/index /autoapi/pysiral/auxdata/mss/index /autoapi/pysiral/auxdata/region/index /autoapi/pysiral/auxdata/rio/index /autoapi/pysiral/auxdata/sic/index /autoapi/pysiral/auxdata/sitype/index /autoapi/pysiral/auxdata/snow/index Classes ------- .. autoapisummary:: pysiral.auxdata.AuxdataBaseClass pysiral.auxdata.AuxClassConfig pysiral.auxdata.GridTrackInterpol Functions --------- .. autoapisummary:: pysiral.auxdata.get_all_auxdata_classes Package Contents ---------------- .. py:class:: AuxdataBaseClass(auxclass_cfg) Bases: :py:obj:`object` Base class for all subtype auxdata base classes (e.g. SICBaseClass). This class defines the mandatory set of methods and properties for all auxdata classes .. py:attribute:: error .. py:attribute:: _cfg .. py:attribute:: _data :value: None .. py:attribute:: _auxvars :value: [] .. py:attribute:: msgs :value: [] .. py:attribute:: _current_date :value: [0, 0, 0] .. py:attribute:: _requested_date .. py:method:: set_requested_date(year, month, day) Use first timestamp as reference, date changes are ignored .. py:method:: set_requested_date_from_l2(l2) Convenience method, Use first timestamp as reference, date changes are ignored .. py:method:: check_data_availability(data_container_name='_data') Checks if data is loaded. If data container is None, raise an Error :param data_container_name: :return: .. py:method:: reset_auxvars() Empties the auxiliary data store. To be executed during class initialization and before retrieving data (e.g. since the Level-2 processor calls this instance repeatedly) .. py:method:: reset_handler_messages() Empties the message list. To be executed during class initialization and before retrieving data (e.g. since the Level-2 processor calls this instance repeatedly) .. py:method:: receive_l1p_input(l1p: L1bdataNCFile) -> None An optional method to pass l1p information to the auxiliary data class prior to execution. For this method to work it needs to be overwritten to by the child class. :param l1p: :return: .. py:method:: add_variables_to_l2(l2) Main Access points for the Level-2 Processor .. py:method:: register_auxvar(var_id, var_name, value, uncertainty=None) Register an auxiliary variable. The different parameters are necessary for the L2 data object. When it will be added to the l2 object in self.update_l2, the variable will be accessible from the l2 with the following expressions: value = l2.%var_id% uncertainty = l2.%var_id%.uncertainty or value = l2.get_parameter_by_name(%var_name%) uncertainty = l2.get_parameter_by_name(%var_name%_uncertainty) .. py:method:: add_handler_message(msg) .. py:method:: get_empty_array(l2, empty_val=np.nan) :staticmethod: .. py:method:: update_external_data() This method will check if the requested date matches current data and call the subclass data loader method if not :return: .. py:method:: load_requested_auxdata() This method raises a NotImplementedError if it is not overwritten by child class :return: .. py:method:: get_l2_track_vars(*args) This method raises a NotImplementedError if it is not overwritten by child class :return: .. py:method:: update_l2(l2) Automatically add all auxiliary variables to a Level-2 data object .. py:property:: pyclass :type: str .. py:property:: cfg .. py:property:: has_data_loaded :type: bool .. py:property:: exception_on_error :type: bool .. py:property:: requested_filepath :type: pathlib.Path Returns the local file path for the requested date :return: .. py:property:: year .. py:property:: month .. py:property:: day .. py:property:: requested_date :type: datetime.date .. py:property:: has_mandatory_track_method Test if this object instance has the mandatory method for extracting track data. This method is named get_l2_track_vars() and needs to be present in any auxiliary subclass .. py:property:: auxvar_names .. py:class:: AuxClassConfig(options: dict = None, local_repository: str = None, filename: str = None, filenaming: str = None, subfolders: List[str] = None, long_name: str = '') Bases: :py:obj:`object` A container for configuration data for any auxilary data handler class #TODO: Quite outdated structure .. py:attribute:: options :value: None .. py:attribute:: local_repository :value: None .. py:attribute:: filename :value: None .. py:attribute:: filenaming :value: None .. py:attribute:: subfolders :value: None .. py:attribute:: long_name :value: '' .. py:method:: set_long_name(docstr: str) -> None Set a description of the auxdata source :param docstr: :return: .. py:method:: set_options(**opt_dict: dict) -> None Pass a dictionary with options :param opt_dict: :return: .. py:method:: set_local_repository(path: str) -> None Set the path the local auxdata repository :param path: :return: .. py:method:: set_filename(filename: str) -> None Set a constant filename (e.g. for mss) :param filename: :return: .. py:method:: set_filenaming(filenaming: str) -> None Set the filenaming of the auxdata files :param filenaming: :return: .. py:method:: set_subfolder(subfolder_list: List[str]) -> None Set a list of folders (year, [month, [day]]) where auxdata files can be found :param subfolder_list: :return: .. py:property:: option_keys .. py:class:: GridTrackInterpol(lons, lats, grid_lons, grid_lats, griddef) Bases: :py:obj:`object` Implements fast extraction of gridded data along a track using Image Interpolation .. py:attribute:: lons .. py:attribute:: lats .. py:attribute:: grid_lons .. py:attribute:: grid_lats .. py:attribute:: griddef .. py:method:: _set_projection() .. py:method:: _get_track_image_coordinates() Computes the image coordinates that will be used for the m .. py:method:: get_from_grid_variable(gridvar, order=0, flipud=False) Returns a along-track data from a grid variable .. py:method:: debug_map(*args, **kwargs) :abstractmethod: .. py:function:: get_all_auxdata_classes() Get a list of all auxiliary data classes :return: List with auxdata_type, class_name, class for each auxiliary class