Loading TempestExtremes data#

If you are running TempestExtremes, we would recommend outputting your tracks as CSV. However, if you use the default output or want to read output that has been produced in this format then huracanpy can load that.

[1]:
import huracanpy

Basic functionnality#

The tracks can be loaded providing the file path and the tracker=tempestextremes option.

[2]:
# Embedded TempestExtremes example file
filename = huracanpy.example_TE_file
# Load the tracks
huracanpy.load(filename, source="tempestextremes")
[2]:
<xarray.Dataset> Size: 13kB
Dimensions:    (record: 210)
Dimensions without coordinates: record
Data variables:
    i          (record) float64 2kB 605.0 604.0 602.0 ... 237.0 236.0 235.0
    j          (record) float64 2kB 36.0 37.0 39.0 40.0 ... 45.0 47.0 48.0 48.0
    lon        (record) float64 2kB 302.5 302.0 301.0 ... 118.5 118.0 117.5
    lat        (record) float64 2kB 18.0 18.5 19.5 20.0 ... 22.5 23.5 24.0 24.0
    feature_0  (record) float64 2kB 1.004e+05 1.002e+05 ... 1.002e+05 1.004e+05
    feature_1  (record) float64 2kB 19.19 23.98 22.35 26.91 ... 28.46 29.49 24.0
    track_id   (record) int64 2kB 0 0 0 0 0 0 0 0 0 0 0 ... 7 7 7 7 7 7 7 7 7 7
    time       (record) datetime64[ns] 2kB 1999-09-10 ... 1999-10-09T06:00:00

Dealing with metadata#

TempestExtremes files can include more data than just time, longitude and latitude. However, the ASCII format does not embed metadata, you need to obtain the name of the variables that were appended to the file from the person that produced it. Then, you can give them to the load function to be used as variable names, as illustrated below.

[3]:
# Load the tracks with metadata
huracanpy.load(
    filename,
    source="tempestextremes",
    variable_names=[
        "mslp",
        "vmax",
    ],
)
[3]:
<xarray.Dataset> Size: 13kB
Dimensions:   (record: 210)
Dimensions without coordinates: record
Data variables:
    i         (record) float64 2kB 605.0 604.0 602.0 601.0 ... 237.0 236.0 235.0
    j         (record) float64 2kB 36.0 37.0 39.0 40.0 ... 45.0 47.0 48.0 48.0
    lon       (record) float64 2kB 302.5 302.0 301.0 300.5 ... 118.5 118.0 117.5
    lat       (record) float64 2kB 18.0 18.5 19.5 20.0 ... 22.5 23.5 24.0 24.0
    mslp      (record) float64 2kB 1.004e+05 1.002e+05 ... 1.002e+05 1.004e+05
    vmax      (record) float64 2kB 19.19 23.98 22.35 26.91 ... 28.46 29.49 24.0
    track_id  (record) int64 2kB 0 0 0 0 0 0 0 0 0 0 0 ... 7 7 7 7 7 7 7 7 7 7 7
    time      (record) datetime64[ns] 2kB 1999-09-10 ... 1999-10-09T06:00:00