Main Modules¶
stormtracks.analysis – Analysis of results¶
stormtracks.c20data – C20 Reanalysis Data¶
- class stormtracks.c20data.C20Data(year, fields='all', version='v1')¶
Class used for accessing data from C20 Reanalysis project.
This acts as a wrapper around netCDF4.Datasets and makes it easy to view data. Typically it exposes the prmsl and vort850/vort9950 fields for all ensemble members. It will load these fields, along with corresponding maxima (vorticity) and minima (pressure) each time a new date is set.
Parameters: - year – Year from which to take data
- fields – List of C20 fields that are to be loaded, or use ‘all’ for complete set
- version – Version of C20 data to use
- close_datasets()¶
Closes all open datasets
- first_date()¶
Sets date to the first date of the year (i.e. Jan the 1st)
- next_date()¶
Moves date on by one timestep (6hr)
- prev_date()¶
Moves date back by one timestep (6hr)
- set_date(date)¶
Sets date and loads all data for that date
Will have no effect if there is no difference in date.
Parameters: date – date to load Returns: date if successful, otherwise None
- set_year(year)¶
Sets a year and loads the relevant dataset
stormtracks.ibtracsdata – IBTrACS Data¶
- class stormtracks.ibtracsdata.IbStormtrack(year, name)¶
Holds info about an IBTrACS best track
- class stormtracks.ibtracsdata.IbtracsData(data_dir=None, verbose=True)¶
Class used for accessing IBTrACS data
Wraps the underlying NetCDF4 files and extracts the information required from them.
Parameters: - data_dir – directory where IBTrACS NetCDF4 files are held
- verbose – whether to pring lots of output
- load_ibtracks_year(year, basin='NA')¶
Loads a given year’s worth of data
Parameters: - year – year to load
- basin – which basins to load (‘all’ for all of them)
Returns: list of loaded best tracks
- load_wilma_katrina()¶
Loads only best tracks corresponding to Wilma and Katrina (2005)
stormtracks.results – Store and Access Results¶
- exception stormtracks.results.ResultNotFound¶
Simple exception thrown if result cannot be found in results manager or on disk
- class stormtracks.results.StormtracksResultsManager(name, output_dir=None)¶
Manager class that is responsible for loading and saving all python results
Simple key/value store. Load/saves to settings.OUTPUT_DIR.
- compress_year(year, delete=False)¶
Compresses a given year’s dir and then optionally deletes that year
- decompress_year(year)¶
Decompresses a given year’s tarball
- delete(year, result_key)¶
Deletes a specific result from disk
- delete_year(year)¶
Deletes a year (use with caution!)
- get_result(year, result_key)¶
Returns a result from an HDF file.
- list_results(year)¶
List all results saved for a particular year
- list_years()¶
List all saved years
- save_result(year, result_key, result)¶
Saves a given result based on year, user chosen result_key