earth2studio.models.dx
.TCTrackerWuDuan#
- class earth2studio.models.dx.TCTrackerWuDuan(path_search_distance=300, path_search_window_size=3)[source]#
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, 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 = 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])