Skip to content

TropCyclone.from_tracks() takes considerably longer in climada 5.0.0 #988

@sarah-hlsn

Description

@sarah-hlsn

TropCyclone.from_tracks() takes orders of magnitude longer in climada 5.0.0 compared to 3.3.0 (all else being equal in terms of numbers of tracks, centroid resolution etc.)

Code example:

from climada.hazard import TCTracks, Centroids, TropCyclone, tc_tracks_synth
import numpy as np

# get tracks
tracks_SI_proba = TCTracks.from_ibtracs_netcdf(year_range=(1990, 2023), basin='SI')
tracks_SI_proba.equal_timestep(time_step_h=1)
tracks_SI_proba.calc_perturbed_trajectories(nb_synth_tracks=9, max_shift_ini=0.75, max_dspeed_rel=0.3)

# create centroids
min_lat, max_lat, min_lon, max_lon = -26, -12, 40, 54
resol = 10
grid = (np.mgrid[min_lat : max_lat : complex(0, resol),
min_lon : max_lon : complex(0, resol)]). \
reshape(2, resol*resol).transpose()
cent = Centroids.from_lat_lon(grid[:,0], grid[:,1])
cent.id = np.arange(cent.lat.size)

# Calculate windfields
tc_SI_proba = TropCyclone.from_tracks(tracks_SI_proba, centroids=cent) ## this is the line that takes so long
tc_SI_proba.check()
tc_SI_proba.plot_intensity(event=0, smooth=False);

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2024-12-18 at 16 18 34
Screenshot 2024-12-18 at 16 18 22

Climada Version: 5.0.0

System Information (please complete the following information):
Run on IAC hub

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions