TCTrackerWuDuan¶
GlobalMRF2023NVIDIAPyTorch
Import path: earth2studio.models.dx.TCTrackerWuDuan
View source on GitHub View install commands
Documentation¶
Bases: Module, _TCTrackerBase
Finds a list of tropical cyclone (TC) centers using an adaption of the method described in the conditions in Wu and Duan 2023. The algorithm converts vorticity from reanalysis data into a binary image using a defined critical threshold. Subsequent processing with connected component labeling and erosion identifies the resulting inner cores as TC seeds.
Parameters:
-
path_search_distance(int, default:300) –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, default:2) –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 = TCTrackerWuDuan()
>>> # 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])