4.1. thuner.utils
General utilities for the thuner package.
- pydantic model thuner.utils.BaseDatasetOptions[source]
Bases:
BaseOptionsBase class for dataset options.
- Fields:
- Validators:
_check_fields»all fields_check_name»all fields_check_parents»all fields
- field converted_options: ConvertedOptions = ConvertedOptions(type='ConvertedOptions', save=False, load=False, parent_converted='/home/docs/THUNER_output/input_data/converted')
Options for saving and loading converted data.
- field deque_length: int = 2
Number of current/previous grids from this dataset to keep in memory. Most tracking algorithms require a ‘next’ grid, ‘current’ grid, and at least two previous grids.
- field end: str | datetime64 [Required]
Tracking end time.
- field end_buffer: int = 0
Minutes after interval end time to include. Useful for tagging when one wants to record post-storm ambient profiles.
- field fields: list[str] | None = None
List of dataset fields, i.e. variables, to use. Fields should be given using their thuner, i.e. CF-Conventions, names, e.g. ‘reflectivity’.
- field parent_local: str | Path | None = '/home/docs/THUNER_output/input_data/raw'
Parent directory of the dataset on local storage.
- field start: str | datetime64 [Required]
Tracking start time.
- field start_buffer: int = -120
Minutes before interval start time to include. Useful for tagging when one wants to record pre-storm ambient profiles.
- field use: Literal['track', 'tag', 'both'] = 'track'
Whether this dataset will be used for tagging, tracking or both.
- field weights_filepath: str | None = None
This should generally be left as None and inferred during tracking.
- convert_dataset(time, filepath, track_options, grid_options)[source]
Convert the dataset. Note if the base class is used directly, the data is assumed to be already converted, and hence this function just opens the dataset. Function returns the converted dataset, and the boundary coordinates. Note the simple boundary coordinates are only used for visualization.
- get_filepaths()[source]
Return the subset of the input filepaths that is within the start and end time range.
- grid_from_dataset(dataset, variable, time)[source]
Get the grid from a generic/pre-converted dataset.
- pydantic model thuner.utils.BaseOptions[source]
Bases:
BaseModelThe base class for all options classes. This class is built on the pydantic BaseModel, which is similar to python dataclasses but with type checking.
- Fields:
- Validators:
convert_floats»all fields