Skip to content
Snippets Groups Projects
Commit 567fefd4 authored by Pablo Iturrieta Rebolledo's avatar Pablo Iturrieta Rebolledo
Browse files

Added verbose

parent 6e41dbca
Branches
No related tags found
No related merge requests found
......@@ -30,15 +30,18 @@ def import_model(modelpath):
region - csep.core.regions.CartesianGrid2D object
magnitudes - np.array with size nmagbins.
"""
(' Loading data')
data = numpy.loadtxt(modelpath, delimiter=',', skiprows=1)
with open(modelpath, 'r') as model:
magnitudes = [float(i) for i in model.readline().split(',')[2:]]
area = numpy.loadtxt(paths.area, delimiter=',', skiprows=1)[:, 2].reshape((-1, 1))
(' Calculating rates')
points = data[:, :2]
rates_density = numpy.hstack(numpy.diff(data[:, 2:], axis=1), data[:, -1])
rates = numpy.multiply(rates_density, area)
(' Creating forecast region')
region = CartesianGrid2D.from_origins(points - dh / 2, dh)
print(' > Total events: %.4f' % numpy.sum(rates))
return rates, region, magnitudes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment