pycontrails.datalib.ecmwf.hres.get_forecast_filename

pycontrails.datalib.ecmwf.hres.get_forecast_filename(forecast_time, timestep, cc='A1', S=None, E='1')

Create forecast filename from ECMWF dissemination products.

See ECMWF Dissemination for more information:

The following dissemination filename convention is used for the
transmission of ECMWF dissemination products:

ccSMMDDHHIImmddhhiiE where:

    cc is Dissemination stream name
    S is dissemination data stream indicator
    MMDDHHII is month, day, hour and minute on which the products are based
    mmddhhii is month, day, hour and minute on which the products are valid at
        ddhhii is set to “______” for Seasonal Forecasting System products
        ii is set to 01 for high resolution forecast time step zero, type=fc, step=0
    E is the Experiment Version Number' (as EXPVER in MARS, normally 1)
Parameters:
  • forecast_time (datetime) – Forecast time to stage

  • timestep (datetime) – Time within forecast

  • cc (str, optional) – Dissemination stream name. Defaults to “A1”

  • S (str, optional) – Dissemination data stream indicator. If None, S is set to “S” for 6 or 18 hour forecast and “D” for 0 or 12 hour forecast.

  • E (str, optional) – Experiment Version Number. Defaults to “1”

Returns:

str – Filename to forecast file

Raises:

ValueError – If forecast_time is not on a synoptic hour (00, 06, 12, 18) If timestep is before forecast_time