README.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. *sonify*
  2. ========
  3. |docs_badge| |build_badge| |cov_badge| |black_badge| |isort_badge|
  4. *sonify* “squeezes” seismic or infrasound signals into audible frequencies and
  5. creates animated spectrograms to accompany the audio. Data are pulled from any
  6. of the `FDSN data centers
  7. <https://service.iris.edu/irisws/fedcatalog/1/datacenters?format=html>`__
  8. available through the Incorporated Research Institutions for Seismology (IRIS)
  9. Data Management Center (DMC) `fedcatalog
  10. <https://service.iris.edu/irisws/fedcatalog/docs/1/help/>`__ web service.
  11. |screenshot|
  12. *sonify* `won an Honorable Mention
  13. <https://jhepc.github.io/2020/entry_11/index.html>`__ in the 2020 SciPy `John
  14. Hunter Excellence in Plotting Contest (JHEPC) <https://jhepc.github.io/>`__.
  15. Quickstart
  16. ----------
  17. 1. Obtain
  18. .. code-block:: xml
  19. git clone https://github.com/liamtoney/sonify.git
  20. cd sonify
  21. 2. Create environment, install, and activate (`install conda
  22. <https://conda.io/projects/conda/en/latest/user-guide/install/index.html>`__
  23. first, if necessary)
  24. .. code-block:: xml
  25. conda env create
  26. conda activate sonify
  27. 3. Run using the Python interpreter
  28. .. code-block:: python
  29. python
  30. >>> from sonify import sonify
  31. or via the command-line interface
  32. .. code-block:: xml
  33. sonify --help
  34. Example
  35. -------
  36. To make a movie of the seismic signal generated by a massive avalanche
  37. occurring in Alaska on 21 June 2019, sped up by a factor of 200:
  38. .. code-block:: python
  39. from sonify import sonify
  40. from obspy import UTCDateTime
  41. sonify(
  42. network='AV',
  43. station='ILSW',
  44. channel='BHZ',
  45. starttime=UTCDateTime(2019, 6, 20, 23, 10),
  46. endtime=UTCDateTime(2019, 6, 21, 0, 30),
  47. freqmin=1,
  48. freqmax=23,
  49. speed_up_factor=200,
  50. fps=1, # Use fps=60 to ~recreate the JHEPC entry (slow to save!)
  51. spec_win_dur=8,
  52. db_lim=(-180, -130),
  53. )
  54. Or (equivalently), via the command-line interface:
  55. .. ~BEGIN~
  56. .. code-block:: xml
  57. sonify AV ILSW BHZ 2019-06-20T23:10 2019-06-21T00:30 --freqmin 1 --freqmax 23 --speed_up_factor 200 --fps 1 --spec_win_dur 8 --db_lim -180 -130
  58. .. ~END~
  59. The result is a 4K 1fps video file named ``AV_ILSW_BHZ_200x.mp4``. A screenshot
  60. of the movie is shown at the top of this README.
  61. Documentation
  62. -------------
  63. Application programming interface (API) documentation for the module is available
  64. `here <https://sonify.readthedocs.io/en/latest/sonify.html>`__. For command-line
  65. usage instructions, type ``sonify --help`` (the ``sonify`` conda environment must
  66. be active).
  67. .. |docs_badge| image:: https://readthedocs.org/projects/sonify/badge/?version=latest
  68. :alt: Documentation status
  69. :target: https://sonify.rtfd.io/
  70. .. |build_badge| image:: https://github.com/liamtoney/sonify/actions/workflows/build.yml/badge.svg
  71. :alt: Build status
  72. :target: https://github.com/liamtoney/sonify/actions/workflows/build.yml
  73. .. |cov_badge| image:: https://codecov.io/gh/liamtoney/sonify/branch/main/graph/badge.svg?token=3OIGM34OFL
  74. :alt: Test coverage
  75. :target: https://codecov.io/gh/liamtoney/sonify
  76. .. |black_badge| image:: https://img.shields.io/badge/code%20style-black-000000.svg
  77. :alt: Link to Black
  78. :target: https://black.readthedocs.io/en/stable/
  79. .. |isort_badge| image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
  80. :alt: Link to isort
  81. :target: https://pycqa.github.io/isort/
  82. .. |screenshot| image:: screenshot.png
  83. :alt: Screenshot of example
  84. :target: #example
  85. Contributing
  86. ------------
  87. If you notice a bug with *sonify* (or if you'd like to request/propose a new
  88. feature), please `create an issue on GitHub
  89. <https://github.com/liamtoney/sonify/issues/new>`__ (preferred) or email me at
  90. |liam@liam.earth|_. You are also welcome to create a `pull request
  91. <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>`__.
  92. Please don't allow `imposter syndrome
  93. <https://en.wikipedia.org/wiki/Impostor_syndrome>`__ to obstruct you from
  94. contributing your valuable ideas and skills to this project — **I'm happy to help
  95. you contribute in any way I can.**
  96. .. |liam@liam.earth| replace:: ``liam@liam.earth``
  97. .. _liam@liam.earth: mailto:liam@liam.earth