I introduced the Growing Degree Days (GDD) Base10 (°C) in weewx. To do 
that, I created a new template, NOAA-YYYY-MM_ampliado.txt.tmpl, to produce 
the MONTHLY CLIMATOLOGICAL EXTENDED SUMMARY NOAA file, based on the 
standard NOAA-YYYY-MM.txt.tmpl (MONTHLY CLIMATOLOGICAL SUMMARY).  As you 
can see, it contains several additional variables already available in 
weewx.

You can see the result in 
http://www3.uji.es/~pepe/weewx/NOAA/NOAA-2017-02_ampliado.txt

The modified code (*see bold characters*) in the 
NOAA-YYYY-MM_ampliado.txt.tmpl is:

…

                   TEMPERATURE ($unit.label.outTemp.strip()), RAIN 
($unit.label.rain.strip()), WIND SPEED ($unit.label.windSpeed.strip()), 
HUMIDITY ($unit.label.outHumidity.strip()), BAROMETER 
($unit.label.barometer.strip()), *Growing Degree Days/GDD Base10 
($unit.label.outTemp.strip())*

DAY   TEMP   HIGH   TIME    LOW   TIME   DAYS   DAYS   RAIN  SPEED   HIGH   
TIME    DIR  HUMID   HIGH   TIME    LOW   TIME  BAROM   HIGH   TIME    
LOW   TIME*    GDD*

-------------------------------------------------------------------------------------------------------------------------------------------------------------
*-------*

## jmcm mie 11 ene 2017 21:50:00 CET calculo el acumulado mensual GDD (suma 
te’rmica, ST)

*#set $monthGDD=0*

*##*

#for $day in $month.days

#if $day.barometer.count.raw

*#if $day.outTemp.avg.raw>10*

*        #if $day.outTemp.avg.raw<30*

*        #set $GDD=$day.outTemp.avg.raw-10*

*        #else*

*        #set $GDD=20*

*        #end if*

*#else*

*#set $GDD=0*

*#end if*

*#set $monthGDD=$monthGDD+$GDD*

##

$day.dateTime.format($D) $day.outTemp.avg.nolabel($Temp,$NONE) 
$day.outTemp.max.nolabel($Temp,$NONE) $day.outTemp.maxtime.format($Time) 
$day.outTemp.min.nolabel($Temp,$NONE) $day.outTemp.mintime.format($Time) 
$day.heatdeg.sum.nolabel($Te

mp,$NONE) $day.cooldeg.sum.nolabel($Temp,$NONE) 
$day.rain.sum.nolabel($Rain,$NONE) $day.wind.avg.nolabel($Wind,$NONE) 
$day.wind.max.nolabel($Wind,$NONE) $day.wind.maxtime.format($Time) 
$day.wind.vecdir.nolabel($Dir,$NONE) $day.outHumidit

y.avg.nolabel($Humid,$NONE) $day.outHumidity.max.nolabel($Humid,$NONE) 
$day.outHumidity.maxtime.format($Time) 
$day.outHumidity.min.nolabel($Humid,$NONE) 
$day.outHumidity.mintime.format($Time) 
$day.barometer.avg.nolabel($Barom,$NONE) $day

.barometer.max.nolabel($Barom,$NONE) $day.barometer.maxtime.format($Time) 
$day.barometer.min.nolabel($Barom,$NONE) 
$day.barometer.mintime.format($Time) *#echo ('%6.2f' % $GDD).replace('.', 
',')#*

#else

$day.dateTime.format($D)

#end if

#end for

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

    $month.outTemp.avg.nolabel($Temp,$NONE) 
$month.outTemp.max.nolabel($Temp,$NONE)    
$month.outTemp.maxtime.format($D) 
$month.outTemp.min.nolabel($Temp,$NONE)    
$month.outTemp.mintime.format($D) $month.heatdeg.sum.nolabel($Temp,$NONE)

 $month.cooldeg.sum.nolabel($Temp,$NONE) 
$month.rain.sum.nolabel($Rain,$NONE) $month.wind.avg.nolabel($Wind,$NONE) 
$month.wind.max.nolabel($Wind,$NONE)    $month.wind.maxtime.format($D) 
$month.wind.vecdir.nolabel($Dir) $month.outHumidity

.avg.nolabel($Humid,$NONE) $month.outHumidity.max.nolabel($Humid,$NONE)    
$month.outHumidity.maxtime.format($D) 
$month.outHumidity.min.nolabel($Humid,$NONE)    
$month.outHumidity.mintime.format($D) $month.barometer.avg.nolabel($Barom,$N

ONE) $month.barometer.max.nolabel($Barom,$NONE)    
$month.barometer.maxtime.format($D) 
$month.barometer.min.nolabel($Barom,$NONE)    
$month.barometer.mintime.format($D) *#echo ('%6.2f' % 
$monthGDD).replace('.', ',')#*


Hope that helps ;-)

-- 
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