';?>

Soil Moisture And Temperature Graphs For Irrigation Block

   />Day / />Week / />Month / />Quarter / />Year
End Time Offset in Days: Plot Resolution(width in pixels): Back to Map "; $start=time(); #Unix Epoch time in seconds since 1970 $offsetStart=($interval+$offset*24)*3600;#seconds back in time $offsetEnd=$offset*24*3600 + 300;#seconds $end = $start - $offsetEnd; $startx = $start-$offsetStart; $plotAspectRatio = .232;# Plot Height/Width ratio $plotUndersizeFactor = .86; # Undersizing of plot gen relative to print window. Less=clearer text. $printWidth = $_GET['resolution'];#Actual size of image plotted on web page. $printHeight = $printWidth*$plotAspectRatio; $width = $plotUndersizeFactor*$printWidth;#size of graphic generated by RRDtool approx. $height = $plotUndersizeFactor*$printHeight;# RRDtool rounds up plot size based on data. $ERROR = ""; $RRDdir = "/usr/local/rrdtool-1.2.15/share/rrdtool/mkscode/"; $colors = array("ff0000","ffc500","ffff00","ff6000","ff4500","ffc0cb","ff00ff","008000","0000ff","800080","bf0000","bf6500","bfbf00","00c000","0000bf","400040","8f0000","8f3500","8f8f00","002000","00208f","a000a0","4f00b0","dfa500","ffbf00","008040","0020ff","80f080","ff0080","ffa500","df7f00","408080","2020af","801080","ff0000","ffa500","ffff20","006000","0000f0","802080"); #red to violet first 6 $SM12colors = array("87ceff","808080","779ea0","0000ff","4682b4","000090","8169e1","c7dedf","70fdd4","579ec0","0000df","4682d4","000050","4169e1"); $SM24colors = array("87ceff","808080","779ea0","0000ff","4682b4","000090","8169e1","c7dedf","70fdd4","579ec0","0000df","4682d4","000050","4169e1"); $SM36colors = array("87ceff","808080","779ea0","0000ff","4682b4","000090","8169e1","c7dedf","70fdd4","579ec0","0000df","4682d4","000050","4169e1"); $colorIndex = 0; $nodeid = 31; # Temporary $nodeidsAll = array(1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 17, 18, 20, 22, 23, 26, 27, 31, 32, 33, 34, 35, 36, 40, 42, 44, 45, 46, 47); #All nodes active, some dead, 1,2,14. 46,26 high drain. $nodeidsField = array(6,10,20,23,31,32,33,40,42,45); #All nodes with SM sensors $nodeidsNewHouse = array(5,22,31,35,40); #Old Garage, Pool house, Sitting Loft, Media Room, New Garage respectively $nodeidsCool = array(7,12,4,44); # Nodes monitoring cool temps, wine storage $nodeidsPA = array(70,71,72,73); #Nodes for monitoring wine temps in Palo Alto $nodeids916 = array(101,103,104,105,110,111,112,113); # 916MHz motes. $nodeids2400 = array(501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534); #all Iris Nodes $nodeidsIrrBlock1 = array(502,503,526); $nodeidsIrrBlock2 = array(504,505,533); $nodeidsIrrBlock3 = array(506,507,529,508); $nodeidsIrrBlock4 = array(509,510,511,512); $nodeidsAllSMs = array_merge($nodeidsIrrBlock1,$nodeidsIrrBlock2,$nodeidsIrrBlock3,$nodeidsIrrBlock4); $nodeidsAvocado = array(532); # block 8 $nodeidsStrauss = array(521,522,523,524,525); # block 7 $nodeidsKonrad = array(519,518,528,523,524,522,527,521); # block 6 $nodeidsDC = array(514,513);# block 5 $nodeidCistern = array(501); $nodeidSpare = array(515); #probably soon to be Irr Sys. Pressures Monitor $nodeidsIrrBlock = ''; $scDEF = ""; $scLINE = ""; $curveDEFs = array();# initialize arrays to null $curveCDEFs = array(); $curveLINEs = array(); $opts = array(); if ($irrBlockID==1){ $nodeidsIrrBlock=$nodeidsIrrBlock1; } if ($irrBlockID==2){ $nodeidsIrrBlock=$nodeidsIrrBlock2; } if ($irrBlockID==3){ $nodeidsIrrBlock=$nodeidsIrrBlock3; } if ($irrBlockID==4){ $nodeidsIrrBlock=$nodeidsIrrBlock4; } if ($irrBlockID==5){ $nodeidsIrrBlock=$nodeidsDC; } if ($irrBlockID==6){ $nodeidsIrrBlock=$nodeidsKonrad; } if ($irrBlockID==7){ $nodeidsIrrBlock=$nodeidsStrauss; } if ($irrBlockID==8){ $nodeidsIrrBlock=$nodeidsAvocado; } if ($irrBlockID==10){ $nodeidsIrrBlock=$nodeidsAllSMs; } #********************************************************************************** # Graph of Soil Moistures for selected Irr. Block at 12" depth $colorIndex = 0; foreach ($nodeidsIrrBlock as $nodeid) { $camParam = 'adc2'; #print "$nodeid $camParam \n
"; $curveDEFs[]="DEF:".$camParam.$nodeid."=".$RRDdir."RRD".$nodeid.".rrd:".$camParam.":LAST"; $curveCDEFs[]="CDEF:".$camParam.$nodeid."SM12=".$camParam.$nodeid.",0,600,LIMIT"; $curveLINEs[]="LINE3:".$camParam.$nodeid."SM12#".$SM12colors[$colorIndex].":Mote".$nodeid; $colorIndex = $colorIndex +1; } #end of foreach loop over nodeids #foreach ($curveDEFs as $scDEF){print "$scDEF\n";} #foreach ($curveCDEFs as $scCDEF){print "$scCDEF\n";} #foreach ($curveLINEs as $scLINE){print "$scLINE\n";} $firstopts = array( "--start", "$startx", "--end", "$end", "--title", "Soil Moisture at 12 in. depth ", "--vertical-label", "Centibar", "--interlace", "--imgformat","PNG", "--width=$width", "--height=$height"); #print "Got past firstopts array
"; $opts = array_merge($firstopts,$curveDEFs,$curveCDEFs,$curveLINEs); #foreach ($opts as $optx){print "$optx\n";} #print " Should have printed complete merged array by here\n"; $ret = rrd_graph("../html/Block".$irrBlockID.$camParam.".png", $opts, count($opts)); if( !is_array($ret) ) { $err = rrd_error(); echo "rrd_graph() ERROR: $err\n"; } print "

"; #********************************************************************************** # Graph of Soil Moistures for selected Irr. Block at 24" depth $curveDEFs=array(); $curveCDEFs=array(); $curveLINEs=array(); $colorIndex = 0; foreach ($nodeidsIrrBlock as $nodeid) { $camParam = 'adc4'; #print "$nodeid $camParam \n
"; $curveDEFs[]="DEF:".$camParam.$nodeid."=".$RRDdir."RRD".$nodeid.".rrd:".$camParam.":LAST"; $curveCDEFs[]="CDEF:".$camParam.$nodeid."SM24=".$camParam.$nodeid.",0,600,LIMIT"; $curveLINEs[]="LINE3:".$camParam.$nodeid."SM24#".$SM24colors[$colorIndex].":Mote".$nodeid; $colorIndex = $colorIndex +1; } #end of foreach loop over nodeids #foreach ($curveDEFs as $scDEF){print "$scDEF\n";} #foreach ($curveCDEFs as $scCDEF){print "$scDEF\n";} #foreach ($curveLINEs as $scLINE){print "$scLINE\n";} $firstopts = array( "--start", "$startx", "--end", "$end", "--title", "Soil Moisture at 24 in. depth ", "--vertical-label", "Centibar", "--interlace", "--imgformat","PNG", "--width=$width", "--height=$height"); $opts = array_merge($firstopts,$curveDEFs,$curveCDEFs,$curveLINEs); #foreach ($opts as $opt){print "$opt
";} $ret = rrd_graph("../html/Block".$irrBlockID.$camParam.".png", $opts, count($opts)); if( !is_array($ret) ) { $err = rrd_error(); echo "rrd_graph() ERROR: $err\n"; } print "

"; #********************************************************************************** # Graph of Soil Moistures for selected Irr. Block at 36" depth $curveDEFs=array(); $curveCDEFs=array(); $curveLINEs=array(); $colorIndex = 0; foreach ($nodeidsIrrBlock as $nodeid) { $camParam = 'adc6'; #print "$nodeid $camParam \n
"; $curveDEFs[]="DEF:".$camParam.$nodeid."=".$RRDdir."RRD".$nodeid.".rrd:".$camParam.":LAST"; $curveCDEFs[]="CDEF:".$camParam.$nodeid."SM36=".$camParam.$nodeid.",0,200,LIMIT"; $curveLINEs[]="LINE3:".$camParam.$nodeid."SM36#".$SM36colors[$colorIndex].":Mote".$nodeid; $colorIndex = $colorIndex +1; } #end of foreach loop over nodeids #foreach ($curveDEFs as $scDEF){print "$scDEF\n";} #foreach ($curveLINEs as $scLINE){print "$scLINE\n";} $firstopts = array( "--start", "$startx", "--end", "$end", "--title", "Soil Moisture at 36 in. depth ", "--vertical-label", "Centibar", "--interlace", "--imgformat","PNG", "--width=$width", "--height=$height"); $opts = array_merge($firstopts,$curveDEFs,$curveCDEFs,$curveLINEs); #foreach ($opts as $opt){print "$opt
";} $ret = rrd_graph("../html/Block".$irrBlockID.$camParam.".png", $opts, count($opts)); if( !is_array($ret) ) { $err = rrd_error(); echo "rrd_graph() ERROR: $err\n"; } print "

"; #********************************************************************************** # Graph of Soil Temp for selected Irr. Block at 12" depth $curveDEFs=array(); $curveCDEFs=array(); $curveLINEs=array(); $colorIndex = 0; foreach ($nodeidsIrrBlock as $nodeid) { $camParam = 'adc3'; #print "$nodeid $camParam \n
"; $curveDEFs[]="DEF:".$camParam.$nodeid."=".$RRDdir."RRD".$nodeid.".rrd:".$camParam.":LAST"; $curveCDEFs[]="CDEF:".$camParam.$nodeid."ST12=".$camParam.$nodeid.",1.8,*,32,+,10,212,LIMIT"; $curveLINEs[]="LINE3:".$camParam.$nodeid."ST12#".$colors[$colorIndex].":Mote".$nodeid; $colorIndex = $colorIndex +1; } #end of foreach loop over nodeids #foreach ($curveDEFs as $scDEF){print "$scDEF\n";} #foreach ($curveLINEs as $scLINE){print "$scLINE\n";} $firstopts = array( "--start", "$startx", "--end", "$end", "--title", "Soil Temp at 12 in. depth ", "--vertical-label", "Degrees Fahrenheit", "--interlace", "--imgformat","PNG", "--width=$width", "--height=$height"); $opts = array_merge($firstopts,$curveDEFs,$curveCDEFs,$curveLINEs); #foreach ($opts as $opt){print "$opt
";} $ret = rrd_graph("../html/Block".$irrBlockID.$camParam.".png", $opts, count($opts)); if( !is_array($ret) ) { $err = rrd_error(); echo "rrd_graph() ERROR: $err\n"; } print "

"; #********************************************************************************** # Graph of Ambient Temps for selected Irr. Block $curveDEFs=array(); $curveCDEFs=array(); $curveLINEs=array(); $colorIndex = 0; foreach ($nodeidsIrrBlock as $nodeid) { $camParam = 'temp'; #print "$nodeid $camParam \n
"; $curveDEFs[]="DEF:".$camParam.$nodeid."=".$RRDdir."RRD".$nodeid.".rrd:".$camParam.":LAST"; $curveCDEFs[]="CDEF:".$camParam.$nodeid."AT=".$camParam.$nodeid.",1.8,*,32,+,10,212,LIMIT"; $curveLINEs[]="LINE3:".$camParam.$nodeid."AT#".$colors[$colorIndex].":Mote".$nodeid; $colorIndex = $colorIndex +1; } #end of foreach loop over nodeids #foreach ($curveDEFs as $scDEF){print "$scDEF\n";} #foreach ($curveLINEs as $scLINE){print "$scLINE\n";} $firstopts = array( "--start", "$startx", "--end", "$end", "--title", "Temp Inside Mote Case", "--vertical-label", "Degrees Fahrenheit", "--interlace", "--imgformat","PNG", "--width=$width", "--height=$height"); $opts = array_merge($firstopts,$curveDEFs,$curveCDEFs,$curveLINEs); #foreach ($opts as $opt){print "$opt
";} $ret = rrd_graph("../html/Block".$irrBlockID.$camParam.".png", $opts, count($opts)); if( !is_array($ret) ) { $err = rrd_error(); echo "rrd_graph() ERROR: $err\n"; } print "

"; ?>

Leaf Water Potential Correlation


Camalie Networks

Written by Mark Holler 5/20/08 Send comments or bug reports to mholler@pacbell.net or call 650-799-6571 All rights reserved