LowellObservatory / NightWatch

A system to display a set of important information at an observatory.
2 stars 0 forks source link

Figure out how to plot weather data and other data using Bokeh. The plots do not need to be added to Django yet, "show(p)" at the end of the python routine will show the plot in a webpage. #4

Closed dyerlytle closed 5 years ago

astrobokonon commented 5 years ago

The following comments are weather station time series plots specific:

  1. Embed the WRS labview VI

    • I'm not a fan, so I'm not going to work on that.
  2. Get the data from the WRS broker topic

    • WRS topic is only populated when the other telescope stuff is up and running, so the data aren't available during the day or when the night is called early or cancelled. No big deal, but would be nice to have all the time.
  3. Get the data from the WRS subsystem directly

    • Currently possible using a dual hop setup on the internal network, working on making it a single hop.

3+N. Get the data from the WRS directly, and then push it out as a weather station that the whole internet could get to such as WeatherUnderground. @charlesvbw mentioned some quirks with this when they did the same for the Mars Hill station, but it was related to the Mars Hill numbers not matching other nearby stations and getting de-prioritized. Since the DCT is in the middle of nowhere we probably won't have that particular problem.

Working on the third option as part of an overhaul of the allsky web setup, but the 3+Nth option is interesting too.

astrobokonon commented 5 years ago

I've got a toy model that can grab information from my development influxdb database using read-only permissions so nothing can be screwed up, and then plot the resulting data using bokeh. I settled on a plot style (specified by a YAML file) that I think will work well initially and look nice - it's a mimic of the Grafana plot style that I've come to prefer.

image

The actual example is interactive, with the red line denoting the cursor position in time (X axis). I've still got work to do on formatting the X axis labels as well as the time in the tool tips on each time series. The latter is currently in seconds since UNIX epoch but I should be able to get that sorted out soon. If you click on a name in the legend, it also turns that plot (and associated tool tip) off.

These particular data are the temperature sensors from DeVeny, the CCD temperature (T1, green line, left axis) and the Aux/glycol temperature (T2, mustard line, right axis). I've got the WRS information from the broker stored and can easily plot that, it's just easier for me to develop/hack against a continuous stream of information so I used the temperature telemetry. I should have made the legend match the Y axis labels (or vice-versa) but this is all just an initial test for feasibility. There are other weird things going on in this plot too if you look close enough at it.

The database credentials are hard coded into my example right now, but once I abstract them into a config file I'll be able to post the actual code.

astrobokonon commented 5 years ago

image

Also note: tooltips function as shown in #14 image)

astrobokonon commented 5 years ago

image

Wind direction info could be added on the opposing Y axis if so desired or if we get clever.

astrobokonon commented 5 years ago

I'm content to close this now, since I have a working way of making the plots in Bokeh and it's now in the "smash-it-all-together" stage with the other stuff to get the alpha version out there.