4.2.2. thuner.option.track

Classes for managing tracking related options.

pydantic model thuner.option.track.BaseObjectOptions[source]

Bases: BaseOptions

Base class for object options.

Fields:
Validators:

field allowed_gap: int = 30

Allowed gap in minutes between consecutive times when tracking.

Constraints:
  • gt = 0

  • lt = 360

field attributes: Attributes | None = None

Options for object attributes.

field dataset: str [Required]

Name of the dataset used for detection if applicable.

field deque_length: int = 2

Length of the deque used for tracking.

Constraints:
  • gt = 0

  • lt = 10

field hierarchy_level: int = 0

Level of the object in the hierachy. Higher level objects may depend on lower level objects.

Constraints:
  • ge = 0

field mask_options: MaskOptions = MaskOptions(type='MaskOptions', save=True, load=False)

Options for saving and loading masks.

field method: Literal['detect', 'group'] = 'detect'

Method used to obtain the object, i.e. detect or group.

field name: str [Required]

Name of the object.

field type: Literal['BaseObjectOptions'] = 'BaseObjectOptions'
field write_interval: int = 1

Interval in hours for writing objects to disk.

Constraints:
  • gt = 0

  • lt = 1440

pydantic model thuner.option.track.DetectedObjectOptions[source]

Bases: BaseObjectOptions

Options for detected objects.

Fields:
Validators:
  • _check_mask » all fields

field detection: DetectionOptions = DetectionOptions(type='DetectionOptions', method='steiner', altitudes=[], flatten_method=Retrieval(type='Retrieval', function=<function vertical_max>, keyword_arguments={}), min_area=10, threshold=None, threshold_type='minima')

Method used to detect the object.

field object_type: Literal['detected'] = 'detected'

Type of object.

field tracking: TintOptions | MintOptions | None = TintOptions(type='TintOptions', name='tint', search_margin=np.float32(10.0), local_flow_margin=np.float32(10.0), global_flow_margin=np.float32(150.0), unique_global_flow=True, max_cost=np.float32(200.0), max_velocity_mag=np.float32(60.0), max_velocity_diff=np.float32(60.0), matched_object=None)

Options for tracking the object.

field type: Literal['DetectedObjectOptions'] = 'DetectedObjectOptions'
field variable: str = 'reflectivity'

Variable to use for detection.

pydantic model thuner.option.track.DetectionOptions[source]

Bases: BaseOptions

Options for object detection.

Fields:
Validators:
  • _check_threshold » all fields

field altitudes: List[int] = []

Altitudes over which to detect objects.

field flatten_method: Retrieval | None = Retrieval(type='Retrieval', function=<function vertical_max>, keyword_arguments={})

Method used to flatten the grid before detection if relevant.

field method: Literal['steiner', 'threshold'] [Required]

Method used to detect the object.

field min_area: int = 10

Minimum area of the object in km squared.

field threshold: int | None = None

Threshold used for detection if required.

field threshold_type: Literal['minima', 'maxima'] = 'minima'

Threshold type, i.e. a minima or maxima threshold.

field type: Literal['DetectionOptions'] = 'DetectionOptions'
pydantic model thuner.option.track.GroupedObjectOptions[source]

Bases: BaseObjectOptions

Options for grouped objects.

Fields:
Validators:
  • _check_mask » all fields

field grouping: GroupingOptions = GroupingOptions(type='GroupingOptions', method='graph', member_objects=[], member_levels=[], member_min_areas=[])

Options for grouping objects.

field object_type: Literal['grouped'] = 'grouped'

Type of object.

field tracking: TintOptions | MintOptions | None = MintOptions(type='MintOptions', name='mint', search_margin=np.float32(25.0), local_flow_margin=np.float32(35.0), global_flow_margin=np.float32(150.0), unique_global_flow=True, max_cost=np.float32(200.0), max_velocity_mag=np.float32(60.0), max_velocity_diff=np.float32(60.0), matched_object=None, max_velocity_diff_alt=np.float32(25.0))

Options for tracking the object.

field type: Literal['GroupedObjectOptions'] = 'GroupedObjectOptions'
pydantic model thuner.option.track.GroupingOptions[source]

Bases: BaseOptions

Options class for grouping lower level objects into higher level objects.

Fields:
Validators:
  • _check_list_length » all fields

field member_levels: List[Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])]] = []

Hierarchy levels of objects to group.

field member_min_areas: List[Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Gt(gt=0)])]] = []

Minimum area of each member object in km squared.

field member_objects: List[str] = []

Names of objects to group

field method: str = 'graph'

Method used to group objects.

field type: Literal['GroupingOptions'] = 'GroupingOptions'
pydantic model thuner.option.track.LevelOptions[source]

Bases: BaseOptions

Options for a tracking hierachy level. Objects identified at lower levels are used to define objects at higher levels.

Fields:
Validators:
field object_names: List[str] = []

Names of the objects comprising this tracking level.

field objects: List[Annotated[DetectedObjectOptions | GroupedObjectOptions, FieldInfo(annotation=NoneType, required=True, discriminator='object_type')]] = []

Options for each object in the level.

field type: Literal['LevelOptions'] = 'LevelOptions'
validator initialize_object_lookup  »  all fields[source]

Initialize object lookup dictionary.

object_by_name(obj_name: str) BaseObjectOptions[source]

Return object options by name.

pydantic model thuner.option.track.MaskOptions[source]

Bases: BaseOptions

Options for saving and loading masks. Note thuner uses .zarr format for saving masks, which is great for sparse, chunked arrays.

Fields:
Validators:

field load: bool = False

If True, load masks from .zarr files.

field save: bool = True

If True, save masks as .zarr files.

field type: Literal['MaskOptions'] = 'MaskOptions'
pydantic model thuner.option.track.MintOptions[source]

Bases: TintOptions

Options for the MINT tracking algorithm.

Fields:
Validators:

field local_flow_margin: float = 35.0

Margin in km around object for phase correlation.

Constraints:
  • gt = 0

field max_velocity_diff_alt: float = 25.0

Alternative max shift difference used by MINT.

Constraints:
  • gt = 0

field name: str = 'mint'
field search_margin: float = 25.0

Margin in km for object matching. Does not affect flow vectors.

Constraints:
  • gt = 0

field type: Literal['MintOptions'] = 'MintOptions'
pydantic model thuner.option.track.TintOptions[source]

Bases: BaseOptions

Options for the TINT tracking algorithm. See the following publications

Fields:
Validators:

field global_flow_margin: float = 150.0

Margin in km around object for global flow vectors.

Constraints:
  • gt = 0

field local_flow_margin: float = 10.0

Margin in km around object for phase correlation.

Constraints:
  • gt = 0

field matched_object: str | None = None

Name of object used for matching/tracking.

field max_cost: float = 200.0

Maximum allowable matching cost. Units of km.

Constraints:
  • gt = 0

  • lt = 1000.0

field max_velocity_diff: float = 60.0

Maximum allowable shift difference. Units of m/s.

Constraints:
  • gt = 0

field max_velocity_mag: float = 60.0

Maximum allowable shift velocity magnitude. Units of m/s.

Constraints:
  • gt = 0

field name: str = 'tint'
field search_margin: float = 10.0

Margin in km for object matching. Does not affect flow vectors.

Constraints:
  • gt = 0

field type: Literal['TintOptions'] = 'TintOptions'
field unique_global_flow: bool = True

If True, create unique global flow vectors for each object.

pydantic model thuner.option.track.TrackOptions[source]

Bases: BaseOptions

Options for the levels of a tracking hierarchy.

Fields:
Validators:
field levels: List[LevelOptions] = []

Hierachy levels.

field object_names: List[str] = []

Names of the objects.

field type: Literal['TrackOptions'] = 'TrackOptions'
validator initialize_object_lookup  »  all fields[source]

Initialize object lookup dictionary.

object_by_name(obj_name: str) BaseObjectOptions[source]

Return object options by name.