runtraj.models.hysplit.read_tdump#

runtraj.models.hysplit.read_tdump(path)[source]#

Read a trajectory file hyts_std wrote.

Parameters:

path (str | Path) – The file, tdump in a run’s workdir.

Returns:

One row per trajectory per output time, in the file’s order, with trajectory, time (UTC), age (minutes since the trajectory’s first row, which is where it started), lon, lat, zagl, pres (hPa), and a column for each other value the run wrote (TDUMP_COLUMNS). Its attrs hold the file’s header: trajectories, how many the run followed, direction (FORWARD or BACKWARD) and vertical_motion, HYSPLIT’s name for the method.

Return type:

DataFrame

Raises:

ValueError – If the file is not a trajectory file in the format runtraj reads, or ends inside its header.

Notes

The rows are read by the widths Fortran wrote them with, not by spaces, so a value that fills its field is still read. age comes from each row’s date and time, not from the file’s column of hours, which has one decimal. The height is above ground only when the run had KAGL=1, as runtraj’s do: the file does not say. The file’s columns for the met grid and the forecast hour are left out.