Page 1 of 1

Heating Degree Days Graph

Posted: Sun Dec 19, 2010 3:04 pm
by skyewright
Hi,

I have been playing with the graphing facilities and have come up with a graph that plots monthly HDD15 (Heating Degree Days, for a base temp of 15°C) totals over 3 years, based on daily average temperatures.

Addition: The graph definitions were developed from the "_tempdays-1year" example that Boris kindly provides as standard. Thanks for the head start, Boris. :)

N.B. As we are close to the sea my lowest temp band is "-2°C_or_less", but the general idea can easily be extended, and I've included (but commeted out) what I hope are suitable colours (gradually getting bluer) for another 6 bands if desired.

The reason I placed the average temperature line first (i.e. sensor 0) was to make it easier to extend the graph to colder temperature bands, this does mean that the temp line is sometimes "behind" but transparency allows it to be visible enough for me at least.

Maybe other will find this useful or at least interesting.

Code: Select all

timeframe=3Y        # set total time frame to 3 year
zoom=1Y               # select actual year 
legendpos=left       # legend left to graph
legendwidth=120   # 120 px width
res=month1            # get data per month (in a daily mode as defined by daycount on sensor level)

gtitle=Heating_Degree_Days_(Base_15°C)     # name of graph
title=Heating_Degree_Days_(HDD15) 
gheight=600       # height in pixels of graph
gwidth=800         # width in pixels of graph
glunit=_°days       # unit of left y-axis
grunit=°C            # unit for right y-axis
grmin=-10           # min temp
grmax=25          # max temp
gtype=line          # type of graph
gtrim=1               # trim graph to data
gscroller=0        # use sensor 0 (temp) for display on scroller


# colors for sensors
# Warm to cold... 1 to 24
scolor1=FF0000
scolor2=FF0033
scolor3=FF0066
scolor4=CC0000

scolor5=FF3300
scolor6=FF6600
scolor7=FF9966
scolor8=FF9933

scolor9=FFCC66
scolor10=CC9933
scolor11=FFFF99
scolor12=CCFFCC

scolor13=CCFFCC
scolor14=99CCFF
scolor15=99CCCC
scolor16=6699CC

scolor17=0066CC
scolor18=3366FF
#scolor19=3366CC
#scolor20=336699

#scolor21=006699
#scolor22=003399
#scolor23=0033FF
#scolor24=0000FF

sid0=th0 ssmooth0=1 sname0=Ø_Temp syaxis0=r ssel0=temp scolor0=000000 swidth0=2

sid1=th0 sname1=15°C sfill1=80 sline1=0 sfactor1=1 sdaycount1=day.temp>=14.5&&day.temp<15.5 

sid2=th0 sstack2=1 sname2=14°C sfill2=80 sline2=0 sfactor2=2 sdaycount2=day.temp>=13.5&&day.temp<14.5

sid3=th0 sstack3=2 sname3=13°C sfill3=80 sline3=0 sfactor3=3 sdaycount3=day.temp>=12.5&&day.temp<13.5 

sid4=th0 sstack4=3 sname4=12°C sfill4=80 sline4=0 sfactor4=4 sdaycount4=day.temp>=11.5&&day.temp<12.5 

sid5=th0 sstack5=4 sname5=11°C sfill5=80 sline5=0 sfactor5=5 sdaycount5=day.temp>=10.5&&day.temp<11.5 

sid6=th0 sstack6=5 sname6=10°C sfill6=80 sline6=0 sfactor6=6 sdaycount6=day.temp>=9.5&&day.temp<10.5 

sid7=th0 sstack7=6 sname7=9°C sfill7=80 sline7=0 sfactor7=7 sdaycount7=day.temp>=8.5&&day.temp<9.5

sid8=th0 sstack8=7 sname8=8°C sfill8=80 sline8=0 sfactor8=8 sdaycount8=day.temp>=7.5&&day.temp<8.5 

sid9=th0 sstack9=8 sname9=7°C sfill9=80 sline9=0 sfactor9=9 sdaycount9=day.temp>=6.5&&day.temp<7.5 

sid10=th0 sstack10=9 sname10=6°C sfill10=80 sline10=0 sfactor10=10 sdaycount10=day.temp>=5.5&&day.temp<6.5 

sid11=th0 sstack11=10 sname11=5°C sfill11=80 sline11=0 sfactor11=11 sdaycount11=day.temp>=4.5&&day.temp<5.5 

sid12=th0 sstack12=11 sname12=4°C sfill12=80 sline12=0 sfactor12=12 sdaycount12=day.temp>=3.5&&day.temp<4.5

sid13=th0 sstack13=12 sname13=3°C sfill13=80 sline13=0 sfactor13=13 sdaycount13=day.temp>=2.5&&day.temp<3.5

sid14=th0 sstack14=13 sname14=2°C sfill14=80 sline14=0 sfactor14=14 sdaycount14=day.temp>=1.5&&day.temp<2.5

sid15=th0 sstack15=14 sname15=1°C sfill15=80 sline15=0 sfactor15=15 sdaycount15=day.temp>=0.5&&day.temp<1.5

sid16=th0 sstack16=15 sname16=0°C sfill16=80 sline16=0 sfactor16=16 sdaycount16=day.temp>=-0.5&&day.temp<0.5

sid17=th0 sstack17=16 sname17=-1°C sfill17=80 sline17=0 sfactor17=17 sdaycount17=day.temp>=-1.5&&day.temp<-0.5

sid18=th0 sstack18=17 sname18=-2°C_or_less sfill18=80 sline18=0 sfactor18=18 sdaycount18=day.temp<-1.5 
While developing the above I also found the following useful, it is similar but without the factors, so it shows the number of days in each band and was useful to reveal a couple of annomalies in my data where data was missing (the total number of days for each month should match the number of days in the month).

N.B. With this one, if you add extra colder bands, you'll also need to move (or remove) the average temperature line.

Code: Select all

timeframe=3Y        # set total time frame to 3 year
zoom=1Y               # select actual year 
legendpos=left       # legend left to graph
legendwidth=120   # 120 px width
res=month1            # get data per month (in a daily mode as defined by daycount on sensor level)

gtitle=Days_per_Temp_Zone     # name of graph
title=Days_per_Temp_Zone 
gheight=600       # height in pixels of graph
gwidth=800         # width in pixels of graph
glunit=_days       # unit of left y-axis
grunit=°C            # unit for right y-axis
grmin=-10           # min temp
grmax=25          # max temp
gtype=line          # type of graph
gtrim=1               # trim graph to data
gscroller=19        # use sensor 19 (temp) for display on scroller

# colors for sensors
# Warm to cold... 0 to 23
scolor0=FF0000
scolor1=FF0033
scolor2=FF0066
scolor3=CC0000

scolor4=FF3300
scolor5=FF6600
scolor6=FF9966
scolor7=FF9933

scolor8=FFCC66
scolor9=CC9933
scolor10=FFFF99
scolor11=CCFFCC

scolor12=CCFFCC
scolor13=99CCFF
scolor14=99CCCC
scolor15=6699CC

scolor16=0066CC
scolor17=3366FF
scolor18=3366CC
#scolor19=336699

#scolor20=006699
#scolor21=003399
#scolor22=0033FF
#scolor23=0000FF

sid0=th0 sname0=16°C_or_more sfill0=80 sline0=0 sdaycount0=day.temp>=15.5 

sid1=th0 sstack1=0 sname1=15°C sfill1=80 sline1=0 sdaycount1=day.temp>=14.5&&day.temp<15.5 

sid2=th0 sstack2=1 sname2=14°C sfill2=80 sline2=0 sdaycount2=day.temp>=13.5&&day.temp<14.5

sid3=th0 sstack3=2 sname3=13°C sfill3=80 sline3=0 sdaycount3=day.temp>=12.5&&day.temp<13.5 

sid4=th0 sstack4=3 sname4=12°C sfill4=80 sline4=0 sdaycount4=day.temp>=11.5&&day.temp<12.5 

sid5=th0 sstack5=4 sname5=11°C sfill5=80 sline5=0 sdaycount5=day.temp>=10.5&&day.temp<11.5 

sid6=th0 sstack6=5 sname6=10°C sfill6=80 sline6=0 sdaycount6=day.temp>=9.5&&day.temp<10.5 

sid7=th0 sstack7=6 sname7=9°C sfill7=80 sline7=0 sdaycount7=day.temp>=8.5&&day.temp<9.5

sid8=th0 sstack8=7 sname8=8°C sfill8=80 sline8=0 sdaycount8=day.temp>=7.5&&day.temp<8.5 

sid9=th0 sstack9=8 sname9=7°C sfill9=80 sline9=0 sdaycount9=day.temp>=6.5&&day.temp<7.5 

sid10=th0 sstack10=9 sname10=6°C sfill10=80 sline10=0 sdaycount10=day.temp>=5.5&&day.temp<6.5 

sid11=th0 sstack11=10 sname11=5°C sfill11=80 sline11=0 sdaycount11=day.temp>=4.5&&day.temp<5.5 

sid12=th0 sstack12=11 sname12=4°C sfill12=80 sline12=0 sdaycount12=day.temp>=3.5&&day.temp<4.5

sid13=th0 sstack13=12 sname13=3°C sfill13=80 sline13=0 sdaycount13=day.temp>=2.5&&day.temp<3.5

sid14=th0 sstack14=13 sname14=2°C sfill14=80 sline14=0 sdaycount14=day.temp>=1.5&&day.temp<2.5

sid15=th0 sstack15=14 sname15=1°C sfill15=80 sline15=0 sdaycount15=day.temp>=0.5&&day.temp<1.5

sid16=th0 sstack16=15 sname16=0°C sfill16=80 sline16=0 sdaycount16=day.temp>=-0.5&&day.temp<0.5

sid17=th0 sstack17=16 sname17=-1°C sfill17=80 sline17=0 sdaycount17=day.temp>=-1.5&&day.temp<-0.5

sid18=th0 sstack18=17 sname18=-2°C_or_less sfill18=80 sline18=0 sdaycount18=day.temp<-1.5 

sid19=th0 ssmooth19=1 sname19=Ø_Temp syaxis19=r ssel19=temp scolor19=000000 swidth19=2