Skip to content

Commit

Permalink
Update tc_tracks.py
Browse files Browse the repository at this point in the history
pylint
  • Loading branch information
NicolasColombi authored Jan 17, 2025
1 parent bd588c8 commit 6e075df
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions climada/hazard/tc_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
from shapely.geometry import LineString, MultiLineString, Point
from sklearn.metrics import DistanceMetric

import climada.hazard.tc_tracks_synth
import climada.util.coordinates as u_coord
import climada.util.plot as u_plot
from climada.hazard import Centroids, tc_tracks_synth
from climada.hazard import Centroids

# climada dependencies
from climada.util import ureg
Expand Down Expand Up @@ -1684,11 +1685,11 @@ def from_fast(cls, folder_name: str):
for file in file_tr:
if Path(file).suffix != ".nc":
continue
with xr.open_dataset(file) as ds:
for i in ds.n_trk:
with xr.open_dataset(file) as data:
for i in data.n_trk:

# Select track
track = ds.sel(n_trk=i)
track = data.sel(n_trk=i)

# Define coordinates
lat = track.lat_trks.data
Expand All @@ -1713,13 +1714,13 @@ def from_fast(cls, folder_name: str):

cen_pres_missing = np.full(lat.shape, np.nan)
rmw_missing = np.full(lat.shape, np.nan)
cen_pres = tc_tracks._estimate_pressure(
cen_pres = _estimate_pressure(
cen_pres_missing, lat, lon, max_sustained_wind_knots
)
rmw = tc_tracks.estimate_rmw(rmw_missing, cen_pres)
rmw = estimate_rmw(rmw_missing, cen_pres)

# Define attributes
category = tc_tracks.TCTracks.define_tc_category_fast(
category = TCTracks.define_tc_category_fast(
max_sustained_wind_knots
)
id_no = track.n_trk.item()
Expand Down

0 comments on commit 6e075df

Please sign in to comment.