Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Plotting calculated values

Home Forums Mayfly Data Logger Plotting calculated values

Viewing 7 reply threads
  • Author
    Posts
    • #13326
      Matt Barney
      Participant

      How do I set up a calculated value to plot to my site at data.envirodiy.org? I’m using the example code here: https://github.com/EnviroDIY/ModularSensors/blob/master/examples/baro_rho_correction/baro_rho_correction.ino to do the calculation, set up the variable, units, etc., but I can’t seem to figure out how to set up the portal to accept the calculated data. How do you add a calculated value as a “sensor” to your site?

      Thanks,
      Matt

    • #13327
      Sara Damiano
      Moderator

      Select “All” as the manufacturer and “Calculated” as the sensor model.

    • #13356
      Matt Barney
      Participant

      Thank you Sara. I see that the list of calculated variables is curated, so this avenue may not be the best fit for my use case. In particular, what is a non-hacky way for me to display a sensor’s measurements in different units? I’m using the ModularSensors library. Would I need to customize the code for that sensor to do the units conversion?

      This is not a critical need for us, so I don’t want to ask you to spend any substantial time on it. I am curious whether there is an existing hook somewhere in the code for doing units conversion, or, if not, whether there is enough interest in creating one in the future.

      Best,
      Matt

    • #13360
      Sara Damiano
      Moderator

      Right now there’s no ability to do units conversions in either ModularSensors or on Monitor My Watershed. Your only option in ModularSensors would be to create a calculated variable that did the units conversion.

      On Monitor My Watershed, I think almost all of the temperature variables have the option of being in either C or F, but nearly everything else will only give you the option right now of the “default” unit any given sensor spits out. Those lists are curated, but it’s not difficult for us to add any new output variables/units you need. Let me know what you’d like to have added and I can do it. If the only “calculation” you’re doing is a unit conversion, then the output should still be tied to a specific sensor make/model. Once I add the extra unit, you’d be able to select that unit from the drop down in the same way you see the Celsius/Fahrenheit option now.

      The “all/calculated” was really put in place for values that are calculated using the outputs of more than one sensor – like that barometric correction that uses atmospheric pressure from one sensor, water pressure from another, and temperature from a third. It feels really “hacky” because the Monitor My Watershed portal is primarily intended for “level 0” (totally raw) data that hasn’t had any calculations or QC applied. But, if you want to have a new calculated option, just let me know what you need to have added and, within reason, I can put it in. Just be aware that inside the database, no matter how polished that calculation is, the data on MonitorMW is still tagged as “raw”.

    • #13368
      Matt Barney
      Participant

      Thanks Sara. I was plotting air temperature from the Maxim DS3231 and wanted to display it in F, but that option is not available that I can see. I hope I didn’t make it sound like I thought anything about the portal was hacky; my use of calculated variables to do a unit conversion was. 🙂

    • #13388
      Matt Barney
      Participant

      I’m unclear on what changing the units of a temperature variable on MMW does for me; it seems to label the data as degrees F, but the values are still in deg C, as it appears that the Decagon CTD-10 (in this case) can only report in deg C. Assuming that is the case, could we get a calculated variable set up on MMW for temperature in deg F? Our users are also wanting to see depth in inches, so I’d like to have a calculated variable set up for that as well, if possible.

      Thanks,
      Matt

    • #13389
      Sara Damiano
      Moderator

      I’m sorryfor the confusion. The unit selected on MonitorMW should be the unit you are sending data in. The MonitorMW data portal never does any calcu lation of any type on the posted data, including unit conversions. If you select different units from those units sent in your post request, the website will simply be wrong. If you modify an existing variable on MonitorMW to select different units, the label will change but the values will not. By “calculated variable” MonitorMW means “someone else calculated this and posted the results” not “this was calculated by MonitorMW.”

      You *can* create a calculated variable in ModularSensors where you give the equation that will convert C to F or mm to inches and then report that calculated value to MonitorMW. In that case, when you’re creating the variable on MonitorMW you would select your sensor make/model in the same way you normally would, but then select the alternate units (ie, F or inches, which I will add shortly).

    • #13403
      Matt Barney
      Participant

      Sweet – I’ve got it now. Thanks Sara!

Viewing 7 reply threads
  • You must be logged in to reply to this topic.