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:
Note
The loader function func needs to return a tuple that contains (data, region, magnitudes). data is a
numpy.ndarray
, region is aCartesianGrid2D
, and magnitudes are anumpy.ndarray
consisting of the magnitude bin edges. See the functionload_ascii
for an example.