gemsciencetools / hmtk Goto Github PK
View Code? Open in Web Editor NEWHazard Modeller's Toolkit prototype code
Hazard Modeller's Toolkit prototype code
When using Numpy v 1.8.1 the plot_observed_recurrence gives the following error
/home/gw/Documents/hmtk/hmtk/hmtk/plotting/seismicity/catalogue_plots.py in plot_observed_recurrence(catalogue, completeness, dmag, end_year, filename, filetype, dpi)
319 completeness,
320 dmag,
--> 321 end_year)
322 plt.figure(figsize=DEFAULT_SIZE)
323 plt.semilogy(recurrence[:, 0], recurrence[:, 1], 'bo')
/home/gw/Documents/hmtk/hmtk/hmtk/plotting/seismicity/catalogue_plots.py in get_completeness_adjusted_table(catalogue, completeness, dmag, end_year)
288 if iloc == n_comp - 1:
289 print temp_rates, obs_idx
--> 290 obs_rates[obs_idx] = temp_rates
291 else:
292 obs_rates[obs_idx[:-1]] = temp_rates
ValueError: NumPy boolean array indexing assignment cannot assign 25 input values to the 26 output values where the mask is true
The documentation of this methods says that one of the two input parameters is a nhlib object. It needs to be updated. See https://github.com/GEMScienceTools/hmtk/blob/master/hmtk/seismicity/selector.py#L166
A setup.py
must be added to allow easy installation of the toolkit without the need to change the PYTHONPATH
, like:
pip install -e hmtk/
By chance I stumbled on this:
In several functions you use the numpy.arange method.
The way you use it affects e.g.
the plot_depth_histogram method in
hmtk/plotting/seismicity/catalogue_plots.py
where you exclude the largest depth in the catalogue from the plot.
Instead of
numpy.arange(0.,max_depth,bin_width)
I'd do something like:
numpy.arange(0.,max_depth+bin_width,bin_width)
I saw several other lines where this might cause problems
this function returns wrong observed rate values...
this line seems that should be
obs_idx = np.logical_and(mag_bins >= low_mag, mag_bins < high_mag + dmag)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.