Skip to content

Commit

Permalink
Update IBTrACS version
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisFairless committed Nov 11, 2024
1 parent bb9428c commit 6a28387
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions climada/hazard/tc_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
IBTRACS_URL = (
"https://www.ncei.noaa.gov/data/"
"international-best-track-archive-for-climate-stewardship-ibtracs/"
"v04r00/access/netcdf"
"v04r01/access/netcdf"
)
"""Site of IBTrACS netcdf file containing all tracks v4.0,
s. https://www.ncdc.noaa.gov/ibtracs/index.php?name=ib-v4-access"""

IBTRACS_FILE = "IBTrACS.ALL.v04r00.nc"
"""IBTrACS v4.0 file all"""
IBTRACS_FILE = "IBTrACS.ALL.v04r01.nc"
"""IBTrACS v4.1 file all"""

IBTRACS_AGENCIES = [
"usa",
Expand Down Expand Up @@ -376,7 +376,7 @@ def from_ibtracs_netcdf(
correct_pres=False,
discard_single_points=True,
additional_variables=None,
file_name="IBTrACS.ALL.v04r00.nc",
file_name=IBTRACS_FILE,
):
"""Create new TCTracks object from IBTrACS databse.
Expand Down Expand Up @@ -485,7 +485,7 @@ def from_ibtracs_netcdf(
compatiblity with other functions such as `equal_timesteps`. Default: True.
file_name : str, optional
Name of NetCDF file to be dowloaded or located at climada/data/system.
Default: 'IBTrACS.ALL.v04r00.nc'
Default: 'IBTrACS.ALL.v04r01.nc'
additional_variables : list of str, optional
If specified, additional IBTrACS data variables are extracted, such as "nature" or
"storm_speed". Only variables that are not agency-specific are supported.
Expand Down Expand Up @@ -2576,7 +2576,7 @@ def ibtracs_fit_param(explained, explanatory, year_range=(1980, 2019), order=1):
raise KeyError("Unknown ibtracs variable: %s" % var)

# load ibtracs dataset
fn_nc = SYSTEM_DIR.joinpath("IBTrACS.ALL.v04r00.nc")
fn_nc = SYSTEM_DIR.joinpath(IBTRACS_FILE)
with xr.open_dataset(fn_nc) as ibtracs_ds:
# choose specified year range
years = ibtracs_ds.sid.str.slice(0, 4).astype(int)
Expand Down
6 changes: 3 additions & 3 deletions climada/hazard/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def download_ibtracs():
"""This makes sure a IBTrACS.ALL.v04r00.nc file is present in SYSTEM_DIR
"""This makes sure a IBTrACS.ALL.v04r01.nc file is present in SYSTEM_DIR
First, downloading from the original sources is attempted. If that fails an old version
is downloaded from the CLIMADA Data API
"""
Expand All @@ -44,9 +44,9 @@ def download_ibtracs():
): # plan b: download an old version of that file from the climada api
client = Client()
dsinfo = client.get_dataset_info(
name="IBTrACS", version="v04r00", status="external"
name="IBTrACS", version="v04r01", status="external"
)
[fileinfo] = [
fi for fi in dsinfo.files if fi.file_name == "IBTrACS.ALL.v04r00.nc"
fi for fi in dsinfo.files if fi.file_name == "IBTrACS.ALL.v04r01.nc"
]
client._download_file(local_path=SYSTEM_DIR, fileinfo=fileinfo)
4 changes: 2 additions & 2 deletions doc/tutorial/climada_hazard_TropCyclone.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
"<a id='Part1.a'></a> \n",
"### a) Load TC tracks from historical records\n",
"\n",
"The best-track historical data from the International Best Track Archive for Climate Stewardship ([IBTrACS](https://www.ncdc.noaa.gov/ibtracs/)) can easily be loaded into CLIMADA to study the historical records of TC events. The constructor `from_ibtracs_netcdf()` generates the `Datasets` for tracks selected by [IBTrACS](https://www.ncdc.noaa.gov/ibtracs/) id, or by basin and year range. To achieve this, it downloads the first time the [IBTrACS data v4 in netcdf format](https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/netcdf/) and stores it in `~/climada/data/`. The tracks can be accessed later either using the attribute `data` or using `get_track()`, which allows to select tracks by its name or id. Use the method `append()` to extend the `data` list.\n",
"The best-track historical data from the International Best Track Archive for Climate Stewardship ([IBTrACS](https://www.ncdc.noaa.gov/ibtracs/)) can easily be loaded into CLIMADA to study the historical records of TC events. The constructor `from_ibtracs_netcdf()` generates the `Datasets` for tracks selected by [IBTrACS](https://www.ncdc.noaa.gov/ibtracs/) id, or by basin and year range. To achieve this, it downloads the first time the [IBTrACS data v4 in netcdf format](https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r01/access/netcdf/) and stores it in `~/climada/data/`. The tracks can be accessed later either using the attribute `data` or using `get_track()`, which allows to select tracks by its name or id. Use the method `append()` to extend the `data` list.\n",
"\n",
"If you get an error downloading the IBTrACS data, try to manually access [https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/netcdf/](https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/netcdf/), click on the file `IBTrACS.ALL.v04r00.nc` and copy it to `~/climada/data/`.\n",
"If you get an error downloading the IBTrACS data, try to manually access [https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r01/access/netcdf/](https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r01/access/netcdf/), click on the file `IBTrACS.ALL.v04r01.nc` and copy it to `~/climada/data/`.\n",
"\n",
"To visualize the tracks use `plot()`.\n"
]
Expand Down

0 comments on commit 6a28387

Please sign in to comment.