pysiral.auxdata
Created on Fri May 19 14:42:35 2017
@author: Stefan
Submodules
Classes
Base class for all subtype auxdata base classes (e.g. SICBaseClass). |
|
A container for configuration data for any auxilary data handler class |
|
Implements fast extraction of gridded data along a track using Image Interpolation |
Functions
Get a list of all auxiliary data classes |
Package Contents
- class pysiral.auxdata.AuxdataBaseClass(auxclass_cfg)
Bases:
objectBase class for all subtype auxdata base classes (e.g. SICBaseClass). This class defines the mandatory set of methods and properties for all auxdata classes
- error
- _cfg
- _data = None
- _auxvars = []
- msgs = []
- _current_date = [0, 0, 0]
- _requested_date
- set_requested_date(year, month, day)
Use first timestamp as reference, date changes are ignored
- set_requested_date_from_l2(l2)
Convenience method, Use first timestamp as reference, date changes are ignored
- 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:
- 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)
- 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)
- 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:
- add_variables_to_l2(l2)
Main Access points for the Level-2 Processor
- 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)
- add_handler_message(msg)
- static get_empty_array(l2, empty_val=np.nan)
- update_external_data()
This method will check if the requested date matches current data and call the subclass data loader method if not
- Returns:
- load_requested_auxdata()
This method raises a NotImplementedError if it is not overwritten by child class :return:
- get_l2_track_vars(*args)
This method raises a NotImplementedError if it is not overwritten by child class :return:
- update_l2(l2)
Automatically add all auxiliary variables to a Level-2 data object
- property pyclass: str
- property cfg
- property has_data_loaded: bool
- property exception_on_error: bool
- property requested_filepath: pathlib.Path
Returns the local file path for the requested date :return:
- property year
- property month
- property day
- property requested_date: datetime.date
- 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
- property auxvar_names
- class pysiral.auxdata.AuxClassConfig(options: dict = None, local_repository: str = None, filename: str = None, filenaming: str = None, subfolders: List[str] = None, long_name: str = '')
Bases:
objectA container for configuration data for any auxilary data handler class #TODO: Quite outdated structure
- options = None
- local_repository = None
- filename = None
- filenaming = None
- subfolders = None
- long_name = ''
- set_long_name(docstr: str) None
Set a description of the auxdata source :param docstr: :return:
- set_options(**opt_dict: dict) None
Pass a dictionary with options :param opt_dict: :return:
- set_local_repository(path: str) None
Set the path the local auxdata repository :param path: :return:
- set_filename(filename: str) None
Set a constant filename (e.g. for mss) :param filename: :return:
- set_filenaming(filenaming: str) None
Set the filenaming of the auxdata files :param filenaming: :return:
- 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:
- property option_keys
- class pysiral.auxdata.GridTrackInterpol(lons, lats, grid_lons, grid_lats, griddef)
Bases:
objectImplements fast extraction of gridded data along a track using Image Interpolation
- lons
- lats
- grid_lons
- grid_lats
- griddef
- _set_projection()
- _get_track_image_coordinates()
Computes the image coordinates that will be used for the m
- get_from_grid_variable(gridvar, order=0, flipud=False)
Returns a along-track data from a grid variable
- abstractmethod debug_map(*args, **kwargs)
- pysiral.auxdata.get_all_auxdata_classes()
Get a list of all auxiliary data classes :return: List with auxdata_type, class_name, class for each auxiliary class