Closed ColinTalbert closed 5 years ago
Hello Colin,
I very much support the USGS NABat effort, and am very happy to do everything I can to support collecting, aggregating, and reporting on bat acoustic datasets!
However, as you've suspected, the idea of visualizing acoustic data using Matplotlib is outside the scope of the guano-py
library for a few reasons:
The numpy
, scipy
, and matplotlib
stack are very heavyweight C-based dependencies. They may be available as compiled binaries for a few common platforms, but are otherwise very difficult to install. In contrast, guano-py
is intentionally a single, pure-Python file which may be installed and integrated on absolutely any platform where any Python implementation exists. That includes the mainline CPython, PyPy, Jython, micro-Python, etc.
Your visualization code actually has nothing to do with GUANO metadata; it renders generic full spectrum .WAV files. Note that GUANO metadata might be found in time-expanded .WAV files (which you could relatively-easily support), as well as Anabat-format zero-cross files (which would be an entirely separate implementation). guano-py
supports both these cases, as well as the ability to parse GUANO metadata not attached to any recording at all.
That said, I believe there's a need for an open source, extensible platform for bat acoustic visualization and analysis. This platform would not only need to support recordings with GUANO metadata, but proprietary metadata formats as well. Your nice-looking visualization could be the first step in that direction! I had similar goals with ZCANT, but focused specifically on combining the advantages of zero-cross analysis with full-spectrum data. It uses the same scientific Python stack that you're already working with, so might be of some interest to you: https://github.com/riggsd/zcant
Thanks for your note, as well as the example visualization code that will likely help future Internet searchers. Please let me know if I can assist in integrating any of these tools into the NABat effort!
Thanks for the comments and suggestions. I'm still new to this domain and trying to get up to speed with existing technologies and needs. I'd like to touch base with you on your thoughts for NABat but I'll do that in an email.
This might be well out of scope for the quano-py package but I'll share anyway. In working with bat wav files and introspecting them with guano-py I wanted to have some way to visualize their contents.
Would a plot function for a GuanoFile object be useful to others? I'm kinda thinking something like this:
`g = GuanoFile("bat.wav")
g.plot() ` Which would produce the following matplotlib figure:
This would require additional dependencies (these could be optional) such as matplotlib, numpy and scipy. As such the additional complexity might not be desirable. At any rate I'll share the code I came up with for this in case others find it useful. https://github.com/talbertc-usgs/Notebooks/blob/master/bats/VisualizingGuanoData.ipynb
I'd be happy to submit a pr for this. I'd also be happy to either start or contribute to a different package that had a collection of useful bat data utilities or applications.
Also, I'm relatively new to visualizing sound files and bat data, so suggestions on the plot are welcome.