csep.core.forecasts.GriddedForecast.from_custom

classmethod GriddedForecast.from_custom(func, func_args=(), **kwargs)[source]

Creates MarkedGriddedDataSet class from custom parsing function.

Parameters:
  • func (callable) – function will be called as func(*func_args).

  • func_args (tuple) – arguments to pass to func

  • **kwargs – keyword arguments to pass to the GriddedForecast class constructor.

Returns:

forecast object

Return type:

csep.core.forecasts.GriddedForecast

Note

The loader function func needs to return a tuple that contains (data, region, magnitudes). data is a numpy.ndarray, region is a CartesianGrid2D, and magnitudes are a numpy.ndarray consisting of the magnitude bin edges. See the function load_ascii for an example.