tropycal.realtime.Realtime¶
- class tropycal.realtime.Realtime(jtwc=False, jtwc_source='ucar', ssl_certificate=None)[source]¶
Creates an instance of a Realtime object containing currently active tropical cyclones and invests.
Realtime objects are used to retrieve RealtimeStorm objects, which are created for every active tropical cyclone globally upon creating an instance of Realtime.
Data sources are as follows: National Hurricane Center (NHC): https://ftp.nhc.noaa.gov/atcf/btk/ Joint Typhoon Warning Center (JTWC): (read notes for more details)
- Parameters
jtwc (bool, optional) – Flag determining whether to read JTWC data in. If True, specify the JTWC data source using “jtwc_source”. Default is False.
jtwc_source (str, optional) – If jtwc is set to True, this specifies the JTWC data source to read from. Available options are “noaa”, “ucar” or “jtwc”. Default is “jtwc”. Read the notes for more details.
ssl_certificate (str, optional) – If jtwc is set to True, and jtwc_source is set to “jtwc”, use this argument to provide the path to a valid SSL certificate in case the default one is expired.
- Returns
tropycal.realtime.Realtime – An instance of Realtime.
Notes
During 2021, the multiple sources offering a Best Track archive of raw JTWC tropical cyclone data experienced frequent outages and/or severe slowdowns, hampering the ability to easily retrieve this data. As such, JTWC data has been optional in Realtime objects since v0.2.7. There are three JTWC sources available:
jtwc - This is currently the default JTWC source if JTWC data is read in. As of June 2022, this source is working, but reading data is somewhat slow (can take up to 2 minutes).
ucar - As of September 2021, this source is available and fairly quick to read in, but offers a less compherensive storm history than the “jtwc” source. Between July and September 2021, this source did not update any active tropical cyclones outside of NHC’s domain. If using this source, check to make sure it is in fact retrieving current global tropical cyclones.
noaa - This source was inactive from July 2021 through early 2022, and appears to be back online again. The code retains the ability to read in data from this source should it go back offline then return online again.
Warning
JTWC’s SSL certificate appears to have expired sometime in early 2022. If using JTWC data with the
jtwc=True
argument, this will result in Realtime functionality crashing by default. To avoid this, use thessl_certificate
argument to provide a SSL ceritifcate file, both when creating an instance of Realtime and to any method that retrieves JTWC forecast.Affected functions include
Realtime.plot_summary()
,RealtimeStorm.get_forecast_realtime()
, andRealtimeStorm.plot_forecast_realtime()
.The following block of code creates an instance of a Realtime() object and stores it in a variable called “realtime_obj”:
from tropycal import realtime realtime_obj = realtime.Realtime()
With an instance of Realtime created, any of the methods listed below can be accessed via the “realtime_obj” variable. All active storms and invests are stored as attributes of this instance, and can be simply retrieved:
#This stores an instance of a RealtimeStorm object for AL012021 in the "storm" variable. storm = realtime_obj.AL012021 #From there, you can use any method of a Storm object: storm.plot()
RealtimeStorm objects contain all the methods of Storm objects, in addition to special methods available only for storms retrieved via a Realtime object. As of Tropycal v0.3, this now includes invests, though Storm and RealtimeStorm objects retrieved for invests are blocked from performing functionality that does not apply to invests operationally (e.g., forecast discussions, official NHC/JTWC track forecasts).
To check whether a RealtimeStorm object contains an invest, check the “invest” boolean stored in it:
if storm.invest == True: print("This is an invest!") else: print("This is not an invest!")
Realtime objects have several attributes, including the time the object was last updated, which can be accessed in dictionary format as follows:
>>> realtime_obj.attrs
Methods Summary
Realtime.get_storm
(storm)Returns a RealtimeStorm object for the requested storm ID.
Realtime.list_active_storms
([basin])Produces a list of storms currently stored in Realtime.
Realtime.plot_summary
([domain, ax, ...])Plot a summary map of ongoing tropical cyclone and potential development activity.
Update with the latest realtime data.