weatherstorm / Sofaskin-CW9009

Sofaskin-CW9009 skin for Weewx is a modified version of the Sofaskin developed by Sven at https://neoground.com/portfolio/neowx/. He no longer supports the original skin. Please see the readme for dependency requirements to use this skin.
http://www.centuryfarmweather.com
MIT License
17 stars 11 forks source link

ET.sum.raw inconsistency #16

Closed harmlessdrudge closed 3 years ago

harmlessdrudge commented 3 years ago

Curious about the inconsistency between index/week/month.html.tmpl and year.html.tmpl with the former all listing ET values if > 1 and the latter doing so if == 0.0. Correct or an error? In neither case, ofc, is anything listed for me as it's not a variable reported by my hardware (Ecowitt) nor have I derived it, though I understand that's an option (am only just now looking at this-- https://github.com/weewx/weewx/issues/48 and https://github.com/weewx/weewx/issues/160 -- and other derived variables).

My weewx.conf file is set to prefer hardware for everything, including ET. Seems I could derive this one by choosing "software" but I'm not sure I'm inclined to bother as it seems there have been some issues with how it's been calculated in the past and I haven't found any clear guidance on it so far and I can see that it can be tweaked using parameters. It's also not something that matters to me quite as much as it might to someone needing to manage irrigation. Thoughts?

weatherstorm commented 3 years ago

Thanks for pointing this out as it would appear to be an error. It should only check if the ET has data.

It should be noted that you can still get ET data even if you don't have an evaporation sensor. Weewx will do the calculations based on this: "Get maximum and minimum temperatures and average radiation and wind speed for the indicated period then calculate the amount of evapotranspiration during the interval. Convert to US units if necessary since this service operates in US unit system."

My station has a radiation sensor so weewx can do the calculation. My ET is also set like yours to Prefer_Hardware but it still logs the ET calculation in my weewx database. It does this because prefer_hardware setting means use the hardware calculation first and if none is found then use software before reporting missing. So it's possible weewx is calculating ET for your station if your station collects all the required fields above. I agree with you that it's probably not that useful to most people. I didn't even know I had the data in my database until you asked me about it.

But the bottom line is that it should just be if ET.has.data. I will make the update and test it out. Thanks for pointing this out.

harmlessdrudge commented 3 years ago

OK, thanks for the clarification about Prefer_Hardware. I assumed null values in the absence of both a reading and a preference for software calculation but a default order makes more sense (I've never yet needed peruse the database; deferred until I get around to sending data to an SQL backend, if I ever do, but yes, it should be logging something as I also have a radiation sensor). I wonder what the defaults are for these parameters

et_period = 3600            # for evapotranspiration                
wind_height = 2.0           # for evapotranspiration                

I presume 3600 (seconds) and ...2 what? I guess it's meters (from http://www.fao.org/3/X0490E/x0490e07.htm) and that unless one has a specific need to alter them then they can be disregarded as already implicit.

weatherstorm commented 3 years ago

I would have to dig into it more but I think your right about the calculation. I noticed in my sqlite db they track, min, max, sum, count and wsum (which I assume is a weighted sum based on the count). But I don't know yet how it's being done or if there is control of the calculation.

I was playing around with it last night but weewx doesn't seem to be outputting the right numbers. Like I can't get the Highest ET in a year. I might need to specify some things in order to get it to work correctly.

I assume your correct that et_period =3600 is in seconds and wind_height = 2.0 is either meters or feet above ground. The calculation does have a conversion from meters to feet so if you are using the US system then it should convert to feet.

I believe the (#if $day.ET.has_data and $day.ET.sum.raw > 0.0) was the attempt to ignore ET all together. I noticed in the new skins that came with 4.0 they changed the line to this:

_#if $day.ET.hasdata and $day.ET.sum.raw is not None and $day.ET.sum.raw > 0.0

I probably should keep their convention going forward with the skin but I would still like to figure out the correct ET calculation. I will keep looking into it.

weatherstorm commented 3 years ago

After looking more into it, I believe the values the program calculates are correct but the daily numbers are very small. Weewx should format the ET variable with more decimal places. It should be something like %.5f instead of the standard %.2f they use for inches. Otherwise it just shows zero's for the max. I am almost wondering if it would be better to use sum to show the daily total of ET versus a 10 minute max.

harmlessdrudge commented 3 years ago

Hah, I had a quick look at the new skins too but mainly to see if I could see if > 1 or == 0 was used. Am pretty sure the 2nd parameter is 2m (it is in the FAO calculations, though reference to "or 3m" is also made; I presume what matters most is consistent use when comparing data over time). I output everything in international standard (SI) units but leave the database defaults. I don't follow what you mean by "the attempt to ignore ET" unless you mean ignore null values? I assume that's what the change in v4.0 is about. Yes, it's a fair point about the precision. I have yet to see anything but a zero value! :-)

weatherstorm commented 3 years ago

The values are very small overall. I did a graph of daily ET for a year along with the daily sum of ET for a year. I don't know that there is a ton of value in it but I have been able to make it work for me.

yearet

yearet1

harmlessdrudge commented 3 years ago

OK, thanks for sharing. I agree that there isn't much value in it for most.

It's an unrelated question but, FYI only, at some point I want to find out how to calculate the max nr of consecutive days for which a parameter has a value (temp above/below X, more than Y rainfall). I saw a template with a Records section that had first and last frost dates, longest nr of consecutive nights with frost. After that I think I'll have all the stats I can imagine ever wanting to know. (It was a WeeWX site with a Sofaskin derivative but it's gone now). I've bookmarked this, which is related (heat waves and cold waves) https://github.com/poblabs/weewx-belchertown/issues/119, and will explore further later.

weatherstorm commented 3 years ago

Yes! I myself have tried to figure out a solution for consecutive days of X parameter. I haven't spent much time on it but it maybe possible especially with Weewx 4.0.