Skip to content

Commit

Permalink
Merge pull request #47 from calum-chamberlain/develop
Browse files Browse the repository at this point in the history
Merge develop for release 0.1.3
  • Loading branch information
calum-chamberlain committed Aug 10, 2016
2 parents 0b63105 + 43490b4 commit f63e5ff
Show file tree
Hide file tree
Showing 91 changed files with 5,487 additions and 1,099 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -27,3 +27,6 @@ station.dat
*L.S??????
*R.S??????
.idea
.coverage.*
eqcorrscan/core/subspace_statistic.c
eqcorrscan/core/sliding_normxcorr.c
53 changes: 34 additions & 19 deletions .travis.yml
Expand Up @@ -6,16 +6,19 @@ matrix:
env: PYTHON_VERSION=2.7
- os: linux
env: PYTHON_VERSION=3.5
- os: linux
env: PYTHON_VERSION=3.4
# - os: linux
# env: PYTHON_VERSION=3.3
# There isn't and openCV3 for python 3.3 on Conda

# Conda install on OSX is an issue - gives 0.238 xcorr when should give 1...
# - os: osx
# env: PYTHON_VERSION=2.7
# - os: osx
# env: PYTHON_VERSION=3.5
- os: osx
env: PYTHON_VERSION=2.7
- os: osx
env: PYTHON_VERSION=3.5

sudo: false

# Test with multiple obspy versions, allow some backwards compatability
env:
global:
- OBSPY_VERSION=1.0.1
Expand All @@ -26,7 +29,7 @@ install:
export py=$PYTHON_VERSION;
else
export OS="Linux";
export py=$TRAVIS_PYTHON_VERSION;
export py=$PYTHON_VERSION;
fi
- if [[ "$py" == "2.7_with_system_site_packages" ]]; then
export py="2.7";
Expand All @@ -41,6 +44,7 @@ install:
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels menpo
- conda config --add channels obspy
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
Expand All @@ -52,36 +56,47 @@ install:
env_file="misc/py2_test_env.lis"
PYFLAKES="pyflakes=0.9.0"
fi
- echo $PYTHON_VERSION
- |
if [[ "$OS" == "MacOSX" ]]; then
conda create -q -n test-environment python=$PYTHON_VERSION numpy scipy matplotlib basemap pyproj flake8 future lxml decorator sqlalchemy mock nose gdal docopt coverage requests
else
conda create -q -n test-environment python=$PYTHON_VERSION numpy scipy matplotlib obspy flake8 mock coverage opencv3
elif [[ "$py" == "3.5" ]]; then
conda create -q -n test-environment --file $env_file
elif [[ "$py" == "2.7" ]]; then
conda create -q -n test-environment --file $env_file
else
conda create -q -n test-environment python=$PYTHON_VERSION numpy scipy matplotlib obspy flake8 mock coverage opencv3
fi
- source activate test-environment
- conda install $PYFLAKES
- conda install pyproj
- |
if [[ "${py:0:1}" == "3" ]] && [[ "$OS" == "MacOSX" ]]; then
conda install -c menpo opencv3=3.1.0
elif [[ "$OS" == "MacOSX" ]]; then
conda install opencv
fi
- conda install h5py
# - |
# if [[ "${py:0:1}" == "3" ]] && [[ "$OS" == "MacOSX" ]]; then
# conda install opencv3
# conda install obspy
# fi
# elif [[ "$OS" == "MacOSX" ]]; then
# conda install -c menpo opencv3=3.1.0
# fi
- pip install coveralls
- pip install geographiclib
- pip install https://github.com/megies/PyImgur/archive/py3.zip
- pip install pep8-naming
- pip install pytest
- pip install pytest-cov
- pip install obspy==$OBSPY_VERSION
# - pip install obspy==$OBSPY_VERSION
- pip install Cython
# - pip install obspy==$OBSPY_VERSION
- pip freeze
- conda list
# done installing dependencies
- git version
- pip install .
- python setup.py install

script:
python setup.py test
# Need to ignore the files in current directory to ensure we find the
# installed version of EQcorrscan with compiled code.
- python setup.py test

after_success:
# Check how much code is actually tested and send this report to coveralls
Expand Down
14 changes: 14 additions & 0 deletions CHANGES.md
@@ -1,3 +1,17 @@
## 0.1.3
* Now testing on OSX (python 2.7 and 3.5) - also added linux python 3.4;
* Add lag-calculation and tests for it;
* Change how lag-calc does the trace splitting to reduce memory usage;
* Added pick-filtering utility to clean up tutorials;
* Change template generation function names for clarity (wrappers for
depreciated names);
* Add more useful error messages when picks are not associated with
waveforms;
* Add example plots for more plotting functions;
* Add subspace detector including docs and tutorial.
* Add *delayed* option to all template_gen functions, set to True by
default which retains old behaviour.

## 0.1.2
* Add handling for empty location information in sfiles.
* Added project setup script which creates a useful directory structure and copies
Expand Down
37 changes: 12 additions & 25 deletions README.md
@@ -1,5 +1,5 @@
# EQcorrscan
## A python package to conduct matched-filter earthquake detections.
## A python package for the detection and anlysis of repeating and near-repeating earthquakes.

[![Join the chat at https://gitter.im/calum-chamberlain/EQcorrscan](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/calum-chamberlain/EQcorrscan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![TravisCIStatus](https://travis-ci.org/calum-chamberlain/EQcorrscan.svg?branch=master)](https://travis-ci.org/calum-chamberlain/EQcorrscan)
Expand All @@ -9,10 +9,10 @@
[![DocumentationStatus](http://readthedocs.org/projects/eqcorrscan/badge/?version=latest)](http://eqcorrscan.readthedocs.org/en/latest/?badge=latest)

# Installation
Installation has been tested on both OSX and Linux (Ubuntu), and now
Windows systems. We support Python versions 2.7 and 3.5. The codes likely
work on Py 3.4 too, but we currently don't test this and recommend users to
work in Py 3.5.
Installation has been tested on both OSX and Linux (Ubuntu), and
Windows systems. We support Python versions 2.7, 3.4 and 3.5.
Note that, although we support Windows, EQcorrscan is optimized for
linux style distributions.

Instructions for installing EQcorrscan and the required dependency, openCV
are linked from the [docs](http://eqcorrscan.readthedocs.io/en/latest/intro.html#installation)
Expand Down Expand Up @@ -56,13 +56,13 @@ the gh-pages branch.

# Functionality

This package contains routines to enable the user to conduct match-filter earthquake
This package contains routines to enable the user to conduct matched-filter earthquake
detections using [obspy](https://github.com/obspy/obspy/wiki) bindings when reading
and writing seismic data, and the correlation routine in [openCV](http://opencv.org/).
The OpendCV package is not installed by this software, due to a need to build from
The OpenCV package is not installed by this software, due to a need to build from
source. The user should follow the instructions above for OpenCV install.
This package was written to implement the Matlab routines
used by Chamberlain et al. (2014) for the detection of low-frequency earthquakes.

We have also added subspace detection and correlation derived pick adjustment.

Also within this package are:
* Clustering routines for seismic data;
Expand All @@ -74,10 +74,9 @@ Also within this package are:
* Brightness based template creation based on the work of Frank et al. (2014);
* Singular Value Decomposition derived magnitude calculations based on Rubinstein & Ellsworth (2010).

We are currently hovering around 9,000 lines of code (including doc-strings) - it is probably worth
having a look at the docs to check what functions we have. We plan to write a series of tutorials to be
included on the EQcorrscan API to highlight key functions, currently our tutorials only show
how to do the core matched-filter detection.
We are currently hovering around 15,000 lines of code (including doc-strings) - it is probably worth
having a look at the docs to check what functions we have. We are writing a series of tutorials
included on the EQcorrscan API to highlight key functions.

# Licence

Expand All @@ -100,18 +99,6 @@ Please document your functions following the other documentation within the
functions, these doc-scripts will then be built into the main documentation
using Sphinx.

We are trying to implement a better branching model, following that found [here](http://nvie.com/posts/a-successful-git-branching-model/).
To this end, please fork the development branch if you want to develop
things, and flag issues in the master for us to bugfix.
If you have a feature you want to develop please create a new branch
from the development branch and work on it there, we can then merge
it back in to the development branch when it is stable enough.

This branching model (git-flow) is pretty well established, and I would recommend
you to install [git-flow](https://github.com/nvie/gitflow/wiki/Installation) and
read their [documentation](https://github.com/nvie/gitflow). It seems pretty intuitive and
will keep us all branching in the same way.

# References
* CJ Chamberlain, DR Shelly, J Townend, TA Stern (2014) [Low‐frequency earthquakes reveal punctuated slow slip on the deep extent of the Alpine Fault, New Zealand](http://onlinelibrary.wiley.com/doi/10.1002/2014GC005436/full), __G-cubed__,doi:10.1002/2014GC005436
* Thurber, C. H., Zeng, X., Thomas, A. M., & Audet, P. (2014). [Phase‐Weighted Stacking Applied to Low‐Frequency Earthquakes](http://www.bssaonline.org/content/early/2014/08/12/0120140077.abstract), __BSSA__, doi:10.1785/0120140077.
Expand Down
11 changes: 7 additions & 4 deletions appveyor.yml
@@ -1,4 +1,5 @@


# AppVeyor.com is a Continuous Integration service to build and run tests under Windows

environment:
Expand Down Expand Up @@ -29,14 +30,16 @@ install:
- "%CMD_IN_ENV% python --version"
# Install the build and runtime dependencies of the project.
- "conda update -q --yes conda"
- "conda config --add channels menpo"
- "conda config --add channels obspy"
# Create a conda environment using the astropy bonus packages
- "conda create -q --yes -n test python=%PYTHON_VERSION%"
- "activate test"
# Install default dependencies
- "conda install -q --yes pip numpy scipy matplotlib=1.3.1 lxml sqlalchemy flake8 mock nose gdal decorator requests basemap pytest pyflakes=0.9.0"
- "conda install -q --yes pip numpy scipy opencv3 matplotlib obspy mock flake8 pytest pyflakes=0.9.0 cython h5py"
# additional dependecies
- "choco install opencv -version 2.4.9.20140518"
- "powershell copy-item C:\\OpenCV249\\opencv\\build\\python\\2.7\\x64\\cv2.pyd C:\\conda\\envs\\test\\lib\\site-packages\\."
# - "choco install opencv"
# - "powershell copy-item C:\\OpenCV\\opencv\\build\\python\\2.7\\x64\\cv2.pyd C:\\conda\\envs\\test\\lib\\site-packages\\."
- "pip install pyimgur"
- "pip install -U future"
- "pip install pytest-cov"
Expand All @@ -49,4 +52,4 @@ build: false

test_script:
- "%CMD_IN_ENV% python setup.py develop"
- "%CMD_IN_ENV% py.test"
- "%CMD_IN_ENV% py.test"
6 changes: 4 additions & 2 deletions eqcorrscan/__init__.py
Expand Up @@ -34,9 +34,11 @@
import importlib
import warnings

__all__ = ['core', 'utils', 'par']
__all__ = ['core', 'utils']


__version__ = '0.1.3'

__version__ = '0.1.2'

# Cope with changes to name-space to remove most of the camel-case
_import_map = {
Expand Down
3 changes: 2 additions & 1 deletion eqcorrscan/core/__init__.py
Expand Up @@ -28,7 +28,8 @@
python-pylab - used for plotting
"""

__all__ = ['template_gen', 'match_filter', 'bright_lights']
__all__ = ['template_gen', 'match_filter', 'bright_lights', 'lag_calc',
'subspace', 'subspace_statistic']

if __name__ == '__main__':
import doctest
Expand Down

0 comments on commit f63e5ff

Please sign in to comment.