Actually, I think I may have told you a fib. Whilst it is true that 
StdWXCalculate will first apply a conversion to US units and then later a 
conversion back to the original unit system, such a 'double conversion' has 
no net effect on a temperature difference (converting a difference of say 
10C to F will give a value that is wrong (in this case 50F) but when this 
wrong value is converted back to C you get the original C value (again in 
this case 10C)). The 'double conversion' is not the source of the error but 
rather the final conversion is. You are using METRICWX units in your 
database so StdWXCalculate receives packets with temperature values in C. 
StdWXCalculate 
converts these to F (the first conversion to US units) and then does its 
calculations. So your calc_extraTemp1() method calculates extraTemp1 in F. 
When StdWXCalculate is finished calculating it converts the packet from US 
units 
back to METRICWX so your extraTemp1 is converted to C, but because extraTemp1 
is a temperature difference the resulting C value is incorrect. This is 
what you are seeing now, whilst there have been a number of changes to 
StdWXCalculate 
since 3.5.0 was released (March 2016) I don't believe any of these change 
would account for why your approach no longer works.

One good thing though, the realisation that the 'double conversion' has no 
net effect means that the StdCalibrate approach should work. I ran up a 
machine and loaded weeWX 3.5.0 with a METRICWX database and the StdCalibrate 
approach gave an extraTemp1 with the correct value and units. As long as 
you don't want to display extraTemp1 in F it should do what you want.

Gary

On Sunday, 12 March 2017 06:36:44 UTC+10, Karl Grant wrote:
>
> Thanks for your detailed reply. It was working in 3.5, though I didn't 
> document any other changes. 
> Now that I'm typing I remember sonething about using degree days as a unit 
> as that converts okay.
> Iif I get time I might look at creating a temperature difference group 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to