CFS_Reforecast_FX_Flux#

class earth2studio.data.CFS_Reforecast_FX_Flux(
cache=True,
verbose=True,
async_timeout=600,
async_workers=16,
retries=3,
)[source]#
Global

NCEP CFSv2 6-hourly 9-month reforecast (surface-flux product).

Same archive and access pattern as CFS_Reforecast_FX but exposes the flxf product on the native T126 Gaussian grid (190 x 384). Variable inventory mirrors CFSFluxLexicon (which the reforecast grib2 inventories match).

Parameters:
  • cache (bool, optional) – Cache data source on local memory, by default True.

  • verbose (bool, optional) – Print download progress, by default True.

  • async_timeout (int, optional) – Total timeout in seconds for the entire fetch operation, by default 600.

  • async_workers (int, optional) – Maximum number of concurrent async fetch tasks, by default 16.

  • retries (int, optional) – Number of retry attempts per failed fetch task with exponential backoff, by default 3.

Warning

This is a remote data source and can potentially download a large amount of data to your local machine for large requests.

__call__(time, lead_time, variable)[source]#

Retrieve CFS reforecast data.

Parameters:
  • time (datetime | list[datetime] | TimeArray) – Initial-condition timestamps to return data for (UTC).

  • lead_time (timedelta | list[timedelta] | LeadTimeArray) – Forecast lead times to fetch (6-hour increments, 0 to ~9 months).

  • variable (str | list[str] | VariableArray) – Variable identifier(s). Must be in the source’s lexicon.

Returns:

CFS reforecast data array with dimensions [time, lead_time, variable, lat, lon].

Return type:

xr.DataArray

async fetch(time, lead_time, variable)[source]#

Async fetch of CFS reforecast data.

Parameters:
  • time (datetime | list[datetime] | TimeArray) – Initial-condition timestamps (UTC).

  • lead_time (timedelta | list[timedelta] | LeadTimeArray) – Forecast lead times.

  • variable (str | list[str] | VariableArray) – Variable identifier(s). Must be in the source’s lexicon.

Returns:

CFS reforecast data array.

Return type:

xr.DataArray

classmethod available(time)[source]#

Check whether a CFS reforecast initial condition is available.

Performs offline validity checks (6-hour cycle, history range); the every-5-days cycle calendar is not enforced here because it shifts slightly across leap-year boundaries. Off-schedule requests are surfaced as FileNotFoundError at fetch time.

Parameters:

time (datetime | np.datetime64) – Initial-condition date time to check.

Returns:

Whether the offline checks pass.

Return type:

bool