Plotting gridded forecast

This example show you how to load a gridded forecast stored in the default ASCII format.

Load required libraries

Most of the core functionality can be imported from the top-level csep package. Utilities are available from the csep.utils subpackage.

import csep
from csep.utils import datasets, time_utils

Define forecast properties

We choose a Time-independent Forecast to show how to evaluate a grid-based earthquake forecast using PyCSEP. Note, the start and end date should be chosen based on the creation of the forecast. This is important for time-independent forecasts because they can be rescale to any arbitrary time period.

Load forecast

For this example, we provide the example forecast data set along with the main repository. The filepath is relative to the root directory of the package. You can specify any file location for your forecasts.

Plot forecast

The forecast object provides csep.core.forecasts.GriddedForecast.plot() to plot a gridded forecast. This function returns a matplotlib axes, so more specific attributes can be set on the figure.

helmstetter_mainshock

Out:

/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/cartopy/mpl/gridliner.py:343: UserWarning: The .ylabels_right attribute is deprecated. Please use .right_labels to toggle visibility instead.
  warnings.warn('The .ylabels_right attribute is deprecated. Please '

Total running time of the script: ( 0 minutes 6.596 seconds)

Gallery generated by Sphinx-Gallery