Closed crockpotveggies closed 4 years ago
One thing I'd like to add here is appending the station name to the incoming data. Does anyone know how to extract that information inside the python consumer?
One thing I'd like to add here is appending the station name to the incoming data. Does anyone know how to extract that information inside the python consumer?
Given that our UDP output doesn't include the station name, you should use the user's set station name in rsudp.raspberryshake.stn
Hmmm I would hesitate to combine RSAM with Alert because I think that might actually increase confusion. When I see "Alert" I immediately think the functionality should be isolated to alerts only, not an analysis. One possibility here is to rename the RSAM consumer to Statistics
and open the roadmap to expanding different types of analysis beyond RSAM (such as RSEM and RMS).
I think overall the architecture of rsudp could benefit from composability: being able to chain consumer outputs to each other. I don't necessarily agree with piping messages back to the producer but just my two cents. A future version might look like this:
Producer
-> StatisticsConsumer
-> Forward
-> Alert
-> AlertSound
-> Tweet
-> Telegram
In the meantime we could stick with a separate Statistics
consumer?
That's a really good point. I will do some thinking about reconstructing the flow so that the statistics flow down a separate path from the data. In that case they could even use different instances of the same forward module code. This is a possibility:
Producer
-> Consumer
-> Statistics
-> Forward
-> Alert
-> AlertSound
-> Tweet (still need image paths for social media dissemination)
-> Telegram (still need image paths for social media dissemination)
-> Data
-> Forward
-> Plot (still need some way of letting the plot know about alerts)
-> Write
This would require some significant changes, so might have to be put into the category of "future", so let's just work on putting out a separate RSAM module for now.
Sounds good, I'll get in some final changes. Can you give me instructions on how to add to the documentation?
Documentation is built using sphinx. To build the docs, you can do the following:
pip install sphinx
cd <rsudp_directory>/docsrc
make html
With make html
, docs will be built to `docsrc/_build/html' for local testing.
To build changes to the branch:
make github
git commit -a -m 'updating docs'
git push
With make github
, docs will be built and copied to the docs
directory.
@crockpotveggies It looks like you added documentation to your docstrings, do you want to build and push the docs before I merge, or would you prefer I merge and build myself?
@iannesbitt go ahead and build the docs on your side if possible, I won't be able to get to it for another few days thanks! :)
Wrote a module for RSAM real-time seismic amplitude measurement analysis. The module allows the user to calculate mean, median, min, and max values over a specified time window and optionally forward it to another destination via UDP.
Example from running tests:
The user can opt to forward RSAM in a lightweight format, JSON, or CSV.