earth2studio.models.dx.TCTrackerVitart#

class earth2studio.models.dx.TCTrackerVitart(vorticity_threshold=3.5e-05, mslp_threshold=99000.0, temp_dec_threshold=0.5, lat_threshold=60.0, exclude_border=True, path_search_distance=300, path_search_window_size=3)[source]#

Finds a list of tropical cyclone centers using the conditions in Vitart 1997

Note

For more information about this method see:

Parameters:
  • vorticity_threshold (float, optional) – The threshold for vorticity at 850, below which a possible tropical cyclone center is rejected, by default 3.5e-5 1/s

  • mslp_threshold (float, optional) – The threshold for minimum sea level pressure for local minimums to be considered tropical cyclone, by default 99000 Pa

  • temp_dec_threshold (float, optional) – The value for which average temperature must decrease away from the warm core for a possible center to be considered a tropical cyclone, by default 0.5 degrees celsius

  • lat_threshold (float, optional) – The maximum absolute latitude that a point will be considered to be a tropical cyclone, by default 60 degrees (N and S).

  • exclude_border (bool | int, optional) – If positive integer, exclude_border excludes peaks from within exclude_border-pixels of the border of the image. If tuple of non-negative ints, the length of the tuple must match the input array dimensionality. Each element of the tuple will exclude peaks from within exclude_border-pixels of the border of the image along that dimension. If True, takes the min_distance parameter as value. If zero or False, peaks are identified regardless of their distance from the border.

  • path_search_distance (int, optional) – The max radial distance two cyclone centers will be considered part of the same path in km, by default 300

  • path_search_window_size (int, optional) – The historical window size used when creating TC paths, by default 2

Examples

The cyclone tracker will return a tensor of TC paths collected over a series of forward passes which are held inside of the models state. Namely given a time series of n snap shots, the tracker should be called for each time-step resulting in a tensor consisting of a set number of paths with n steps. Any non-valid / missing data will be torch.nan for filtering in post processing steps.

>>> model = TCTrackerVitart()
>>> # Process each timestep
>>> for time in [datetime(2017, 8, 25) + timedelta(hours=6 * i) for i in range(3)]:
...     da = data_source(time, tracker.input_coords()["variable"])
...     input, input_coords = prep_data_array(da, device=device)
...     output, output_coords = model(input, input_coords)
>>> # Final path_buffer shape: [batch, path_id, steps, variable]
>>> output.shape  # torch.Size([1, 6, 3, 4])
>>> model.path_buffer.shape  # torch.Size([1, 6, 3, 4])
>>> # Remove current paths from models state
>>> model.reset_path_buffer()
>>> model.path_buffer.shape  # torch.Size([0])
__call__(x, coords)[source]#

Forward pass of diagnostic

Parameters:
  • x (Tensor)

  • coords (OrderedDict[str, ndarray])

Return type:

tuple[Tensor, OrderedDict[str, ndarray]]

Examples using earth2studio.models.dx.TCTrackerVitart#

Tropical Cyclone Tracking

Tropical Cyclone Tracking