TCTrackerVitart¶
GlobalMRFNVIDIAPyTorch
Import path: earth2studio.models.dx.TCTrackerVitart
View source on GitHub View install commands
Documentation¶
Bases: Module, _TCTrackerBase
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, default:3.5e-05) –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, default:99000.0) –The threshold for minimum sea level pressure for local minimums to be considered tropical cyclone, by default 99000 Pa
-
temp_dec_threshold(float, default:0.5) –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, default:60.0) –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, default:True) –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, 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 = 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])