csep.core.forecasts.GriddedForecast.load_ascii

classmethod GriddedForecast.load_ascii(ascii_fname, start_date=None, end_date=None, name=None, swap_latlon=False)[source]

Reads Forecast file from CSEP1 ascii format.

The ascii format from CSEP1 testing centers. The ASCII format does not contain headers. The format is listed here:

Lon_0, Lon_1, Lat_0, Lat_1, z_0, z_1, Mag_0, Mag_1, Rate, Flag

For the purposes of defining region objects and magnitude bins use the Lat_0 and Lon_0 values along with Mag_0. We can assume that the magnitude bins are regularly spaced to allow us to compute Deltas.

The file is row-ordered so that magnitude bins are fastest then followed by space.

Parameters
  • ascii_fname – file name of csep forecast in .dat format

  • swap_latlon (bool) – if true, read forecast spatial cells as lat_0, lat_1, lon_0, lon_1