Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pykonal fmm #146

Open
wants to merge 54 commits into
base: development
Choose a base branch
from

Conversation

tmgreenfield1101
Copy link
Collaborator

What is the purpose of this Pull Request?

change sections of trigger and locate to be compatible with pandas 1.5
remove references to np.float, np.int and np.bool and replaced with float, int and bool respectively. This was depreciated in numpy versions > 1.20 and produces errors
added a new travel time calculation method "1dpykonal". This uses the package pykonal to caulate a 2D grid which is swept across the 3D volume.
it adds a new dependency (pykonal, cython and hdf5).

Relevant Issues

Link any open Issues here.

Test cases

Please detail any tests that you have used to ensure your changes do not introduce bugs.

  • All examples run without any new warnings
  • test_benchmarks.py reports all example tests pass
  • results using the new LUT method are the same as 1dnlloc

System details

Please state the systems on which you have tested this change.

Final checklist

  • develop base branch selected?
  • All tests still pass.
  • Any new features or fixed regressions are covered by new tests.
  • Any new or changed features are fully documented.
  • Significant changes have been added to CHANGES.md.
  • First time contributors have added your name to CONTRIBUTORS.md.

tmgreenfield1101 and others added 30 commits September 19, 2019 10:15
fixed a bug in which when no plot is being made (all optional outputs are false) locate attempted to delete the quake_plot instance when it wasn't created
was a noob - fixed it
Add docs generated by Sphinx. This is still a work in progress, but lays
the groundwork for the online documentation. So far we have completed
the landing page, basic installation guide, a tutorial on the lookup
table definitions and generation and API docs for the core and lookup
table subpackages.
Update docs config file - no longer required to have napoleon installed.
If this doesn't work, will set up the virtualenv installation.
Make requirements.txt file for docs to ensure the installation of
nbsphinx, used to parse jupyter notebooks into docs with sphinx.
Add requirements.txt file for docs specifying the installation of
nbsphinx, used to view jupyter notebooks in rtd.
Add numpy to docs/requirements.txt. This is getting long.
Update setup.py to ignore the C compiling if in the READTHEDOCS
environment.
The following warning message was being returned:

The current behaviour of ‘Series.argmax’ is deprecated, use ‘idxmax’ instead.
The behavior of ‘argmax’ will be corrected to return the positional maximum in
the future. For now, use ‘series.values.argmax’ or ‘np.argmax(np.array(values))’
to get the position of the maximum row.

And the error message:

AttributeError: 'Series' object has no attribute 'to_pydatetime'

This has now been fixed; it also maintains backwards compatibility to older
versions of pandas.
Station names composed entirely of numbers were being read in as ints,
causing a bug with obspy. This has been fixed; all station names are
now read in as strings.
Fix reading of triggered events by adding the Julian day of the
start time and end time. Previously, the triggered events csv file was
written with these Julian days included, but was not expected when they were
read. This is a minor correction required to keep the example icequake script
running.

Addresses Issue 70.
Update .stickler.yml to only perform linting check, with no automatic
updates.
This includes:
 * changing the docs links to latest (this will not build until we have merged down to master)
 * updating citation info
 * adding links to the Jupyter Notebooks hosted on binder
Co-authored-by: Conor Bacon <conor.bacon@gmail.com>
Add link to template scripts.
Merged using the strategy "ours" - this should mean all the commits that
were present on master are still present in the package history, but
none of the changes made are actually present in the new master.

This has been done as the v1.0 (long known as the 'development' branch)
release is so significantly different (and improved!) from master that
they only bear a weak resemblance!
Re-add the .stickler.yml control file that was overwritten during the
force-merge of v1.0 onto master.
Add setup.cfg file in advance of registering QuakeMigrate with the
Python Package Index (PyPI). This simply points at the project
description file, such that that information appears on the PyPI entry.
The catch for a `util.ResponseNotFoundError` was incorrectly placed at the
top-level call to get_waveforms() for a given event. This meant that if a
single station / trace was not able to be matched to a response in the
provided response inventory, the function would return (and no waveform
data be written). This is now re-raised with a helpful explanation.

Checks are also added that the traces are not empty (particularly after
trimming to the `pre_cut` and `post_cut`, if applicable) before attempting
to remove / simulate the response, and that the Stream is not empty,
before attempting to write it to file.

Plus some minor docstrings etc. tidying.
The approximate nature of our frequency estimate for the amplitude
measurement makes it possible for it to be equal to (or minutely
higher than) the Nyquist frequency of the data. If a bandpass filter has
been applied, its gain is not defined above the Nyquist, so a query for
the absolute value of the filter gain would be returned zero, leading
to an overflow and an amplitude measurement of inf.

This case is now caught, returning an info-level message reporting the
approx_freq and phase of the failed measurement, and the trace summary
string.
As originally requested in QuakeMigrate#98, this is now handled instead of being raised.
It should hopefully be very rare now, and will still be highlighted by the
warning-level PickOrderException message.
Add Travis Continuous Integration - this will allow us to catch breaking
issues before new features/fixes are merged and, in particular, should
help us keep on top of changes related to upstream changes to
dependencies. Both the Iceland icequake and Iceland dike examples are
tested.

This includes a few adjustments to the existing tests and some new ones:

- New import tests to ensure everything has been installed and works
nicely before running the examples
- Test all .event, .amps, and .picks files. Ensure these are correctly
matched by sorting the globbed files
- Switch to using the the pandas.testing function to ensure DataFrames
are equivalent (up to floating-point errors)

This has been extensively tested on a remote fork and everything passes.

Also included is an automatic assessment of the 'code coverage' (i.e.
how many lines of the package are run and validated), which is uploaded
to codecov.io on a successful test!
Update all copyright notices package-wide to include 2021!
Pin the version of pandas required to 1.0.* - this ensures a minimum
requirement (e.g. NOT using 0.19), but without upgrading to 1.1 (/1.2 as
the most recent version is!).
hemmelig and others added 24 commits January 12, 2021 04:25
Add badges for Travis and codecov. The Travis one should only start to
show 'passing' when this commit has been merged to master, but the
codecov one should in theory work as a coverage report has been uploaded
to the QuakeMigrate codecov account.
Make changes suggested by Stickler.
Make minor style change recommended by Stickler
Co-authored-by: Tom Winder <tom.winder@esc.cam.ac.uk>
Name change for increased clarity (the sweeping business is not user-facing).
The template script and dike intrusion example are update to reflect this,
and a deprecation handler has been added and tested.

Also a significant batch of docstring improvements / fixes within
create_lut.py, plus the addition of an AttributeError to handle the case
where a user specifies an invalid method for traveltime computation.
The headline change here is just updating the parameter name. However, a
raft of other tweaks/fixes/improvements have been made:
 - allow the autosectionlabel extension for sphinx (allows in-document links)
 - update copyright
 - use rounded logo for readthedocs logo
 - remove erroneous "package" in name of lut sub-module
 - LUT tutorial:
    * add links between sections
    * fix some existing hyperlinks
    * update standard parallels choices; add more info
    * extend NonLinLoc description, improve installation guidance
      (particularly wrt. macOS)
    * add `phases=["P", "S"]` to compute_traveltimes() examples
    * add decimation section
    * general clarity and layout improvements
 - docs tweaks in lut/lut.py
This is split into 2 main areas:
index.rst:
 - match main GitHub README; update summary, description & citation
 - minor fixes to links, formatting
 - update supported OS's

installation.rst:
 - add in-document links
 - update supported OS's
 - formatting improvements
 - add more NonLinLoc info
 - add `.bash_profile` info (equivalent to `.bashrc` on macOS)
 - add info on running the dike intrusion test
Update the package description across these remaining few files. Also
update copyright dates, emails.

Also tweak the logo on the main GH README so it is a little less large.
With a clear message to increase the thread count if the user's system
allows.

Also add a pick plot example to the Rutford example. The same can be done
for the icequake example when the parameter choices have been updated.

Plus a couple of minor formatting tweaks (let's see how thorough stickler
is with notebooks....)
This has been reduced from 12 as it is a more widely-appropriate starting
value, for testing on a desktop/laptop.

Within the Rutford example, the detect sampling rate has been reduced from
1000 Hz -> 500 Hz, and the time timespan reduced slightly. This is to match
the paper settings, and reduce redundant detect computation.
Updated the default thread-count consistently with the example scripts,
and with a clear message to increase it if the user's system allows.

Updated the onset function parameters to more widely appropriate values,
plus tweaks to the local_mag and trigger settings / comments.
The dike intrusion example was missed from the previous commit where
this change was made for the 2 icequake examples.
Co-authored-by: Conor Bacon <conor.bacon@gmail.com>
These will not work until the PR is pushed to master and we have then
subsequently built the binder image for that branch. Testing on this PR
branch looks good.
No functional change, just using the "best practice" exception type.

Co-authored-by: Conor Bacon <conor.bacon@gmail.com>
To reflect the updated (better!) choice of standard parallels in the LUT
tutorial.
Corrected internal links, updated some deprecated documentation (e.g. now
that we can use m or km for Z units; use single/multiple/arbitrary phases
etc.) and general tidy up. Boring but satisfying.
…eaks

CHORE: Final tweaks for v1.0.0 release
    change sections of trigger and locate to be compatible with pandas 1.5
    remove references to np.float, np.int and np.bool and replaced with float, int and bool respectively. This was depreciated in numpy versions > 1.20 and produces errors
    added a new travel time calculation method "1dpykonal". This uses the package pykonal to caulate a 2D grid which is swept across the 3D volume.
    it adds a new dependency (pykonal, cython and hdf5).
    results using the new LUT method are the same as 1dnlloc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants