Utility functions

Package providing utility functions for the user.

tctrack.utils.load_tracker_metadata(filename)[source]

Read the TCTrack metadata from an output file, returns the parameters.

Parameters:

filename (str) – The filename of the output netcdf file containing TC tracks.

Return type:

tuple[type, list[TCTrackerParameters]]

Returns:

  • tracker_cls (type) – The relevant TCTracker type. This can be initialised by: tracker_cls(*parameters).

  • parameters (list[TCTrackerParameters]) – A list of parameter objects that duplicate the information in the metadata.

Examples

To read in the metadata from an output file, instantiate a tracker and reproduce the results:

>>> tracker_cls, parameters = load_tracker_metadata("tracks.nc")
>>> tracker = tracker_cls(*parameters)
>>> tracker.run_tracker("tracks_new.nc")
tctrack.utils.read_tracker_metadata(filename)[source]

Print the TCTrack metadata from an output file to stdout in a readable format.

Parameters:

filename (str) – The filename of the output netcdf file containing TC tracks.

Return type:

None