<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ocotal.iarc.uaf.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=209.112.196.223&amp;*</id>
	<title>IARC 207 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://ocotal.iarc.uaf.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=209.112.196.223&amp;*"/>
	<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Special:Contributions/209.112.196.223"/>
	<updated>2026-05-12T22:06:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Graphing&amp;diff=850</id>
		<title>Graphing</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Graphing&amp;diff=850"/>
		<updated>2008-10-08T02:08:29Z</updated>

		<summary type="html">&lt;p&gt;209.112.196.223: /* Sample contents of a graph.py configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Graphing is the figure generating portion of the stuff from EEI.  This program is quite a bit more complicated than the html exporting utility.  The complication is that it uses all of the configuration information (contents of the .ini file and supporting files) used by [[GP]] plus a second  configuration file specific to this program. Sample contents and variables contained in it are outlined below.&lt;br /&gt;
&lt;br /&gt;
A side note, this seems to work marginally from windows and nicely from linux.  Not sure why exactly but plots came out consistently partially made on the windows computer.&lt;br /&gt;
&lt;br /&gt;
Another important note is the graph.py and it's associated files should be run from the same directory as gp.py  so that python can find all of the support files.&lt;br /&gt;
&lt;br /&gt;
==Required Packages==&lt;br /&gt;
Packages required in addition to those required for [[GP]]:&amp;lt;br&amp;gt;&lt;br /&gt;
* ConfigObj&amp;lt;br&amp;gt;&amp;lt;pre&amp;gt;http://pypi.python.org/packages/2.5/C/ConfigObj&amp;lt;/pre&amp;gt;&lt;br /&gt;
* MatPlotLib&amp;lt;br&amp;gt;&amp;lt;pre&amp;gt;http://pypi.python.org/pypi/matplotlib/0.91.4&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Numpy&amp;lt;br&amp;gt;&amp;lt;pre&amp;gt;http://pypi.python.org/pypi/numpy/1.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All user-written files:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
graph.py -- main program&lt;br /&gt;
BaseGraph.py &lt;br /&gt;
GWSFigures.py&lt;br /&gt;
gpUtil.py&lt;br /&gt;
graph_lib.py&lt;br /&gt;
unit_conversion.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Program Execution and Background==&lt;br /&gt;
To run:&lt;br /&gt;
 $ python graph.py [Options] [gp.py configuration file] [graph.py configuration file]&lt;br /&gt;
&lt;br /&gt;
 Such as:&lt;br /&gt;
 $ python graph.py -cd4 ./ADOT/dot.ini ./ADOT/graphs2.ini&lt;br /&gt;
 $ python graph.py -y4 ./ADOT/dot.ini ./ADOT/graphs2.ini&lt;br /&gt;
 $ python graph.py -d4 -X6 -Y4.5 ./ADOT/dot.ini ./ADOT/graphs2.ini&lt;br /&gt;
&lt;br /&gt;
Command line parameters (case sensitive):&lt;br /&gt;
# Options (see below)&lt;br /&gt;
# .ini file used by [[GP |gp.py]]&lt;br /&gt;
# .ini file used by [[Graphing | graph.py]]&lt;br /&gt;
&lt;br /&gt;
Command line options&lt;br /&gt;
* -c for current plus...&lt;br /&gt;
* -d# for days&lt;br /&gt;
* -m# for months&lt;br /&gt;
* -y# for years&lt;br /&gt;
Other Choices:&lt;br /&gt;
* -X for X dimension in pixels / 100 (6 is default = 600 pixels wide)&lt;br /&gt;
* -Y for Y dimension in pixels / 100 (4.5 is default = 450 pixels wide)&lt;br /&gt;
&lt;br /&gt;
==Sample contents of a graph.py configuration file==&lt;br /&gt;
Below is what you might find in a graph.py configuration file.  In a real file there would probably be several stations listed with several plots per station.  In this example there is just one station with two plots being created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[c1-grid]&lt;br /&gt;
	[[Air]]&lt;br /&gt;
		fileName = c1-grid-air&lt;br /&gt;
                title = &amp;quot;Whatever you like for a title&amp;quot;&lt;br /&gt;
                caption = &amp;quot;Whatever you like for a caption, will show up below graphs but above legend&amp;quot;&lt;br /&gt;
		[[[Graphs]]]&lt;br /&gt;
			[[[[AT]]]]&lt;br /&gt;
				graphType = T&lt;br /&gt;
				sensors = airTempAvg,&lt;br /&gt;
                                lineColors = r&lt;br /&gt;
			[[[[Relative_Humidity]]]]&lt;br /&gt;
				graphType = RH&lt;br /&gt;
				sensors = relativeHumidityAvg,&lt;br /&gt;
                                lineColors = b&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====fileName====&lt;br /&gt;
Set this to be whatever you like.  EEI example was like 'air' but including the station name wouldn't hurt.&lt;br /&gt;
&lt;br /&gt;
====graphType Choices====&lt;br /&gt;
Add your own in ''BaseGraph.py'' function ''setGraphType'' or select one of these pre-existing ones (identified only if I can figure out what it is).&amp;lt;br&amp;gt;&lt;br /&gt;
'''T''' for a temperature plot, units = C or F; Degrees C on left Degrees F on right&amp;lt;br&amp;gt;&lt;br /&gt;
'''TN''' Same as '''T''', units = C or FN&amp;lt;br&amp;gt;&lt;br /&gt;
'''WCC''' Same as '''T''', units = C or F &amp;lt;br&amp;gt;&lt;br /&gt;
'''WCF''' Similar to '''T''' but Degrees F are on the left and Degrees C are on the right to two decimal places, units = C or F &amp;lt;br&amp;gt;&lt;br /&gt;
'''WS''' for wind speed, units = m/s, MPH, or KNT&amp;lt;br&amp;gt;&lt;br /&gt;
'''WD''' for wind direction, units = degrees&amp;lt;br&amp;gt;&lt;br /&gt;
'''BP''' for pressure, units = milliBars&amp;lt;br&amp;gt;&lt;br /&gt;
'''V''' for voltage, units = Volts&amp;lt;br&amp;gt;&lt;br /&gt;
'''RH''' for relative humidity, units = Percent&amp;lt;br&amp;gt;&lt;br /&gt;
'''P''' for precipitation, units = mm&amp;lt;br&amp;gt;&lt;br /&gt;
'''NR''' for Net Radiation, units = W/m^2&amp;lt;br&amp;gt;&lt;br /&gt;
'''RR''' for Reflected SW Radiation, units = W/m^2&amp;lt;br&amp;gt;&lt;br /&gt;
'''IR''' for incoming SW Radiation, units = W/m^2&amp;lt;br&amp;gt;&lt;br /&gt;
'''SD''' for snow depth, units = cm&amp;lt;br&amp;gt;&lt;br /&gt;
'''VP''' for Vapor Pressure, units = kPa&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====sensors====&lt;br /&gt;
The ''sensors'' variable can be a single value or a comma separated list of values to be shown on the graph.&lt;br /&gt;
The names here are found in the files looking something like this:  '''TemplateMap-atlas3m.profile'''.  the '''atlas3m''' part is then specified in '''stationInfo.csv''' discussed in [[GP]].  The purpose of these template files is to convert the varied names of sensor columns into a common set for use in gp.py and graph.py.  '''The trailing comma is required to show the end of all sensor rows.'''&lt;br /&gt;
&lt;br /&gt;
====lineColors====&lt;br /&gt;
As you might imagine these are the plot line colors.  Choices are:&amp;lt;br&amp;gt;&lt;br /&gt;
'''b''' -- Blue&amp;lt;br&amp;gt;&lt;br /&gt;
'''r''' -- Red&amp;lt;br&amp;gt;&lt;br /&gt;
'''c''' -- Cyan&amp;lt;br&amp;gt;&lt;br /&gt;
'''y''' -- Yellow&amp;lt;br&amp;gt;&lt;br /&gt;
'''k''' -- Black&amp;lt;br&amp;gt;&lt;br /&gt;
'''g''' -- Green &amp;lt;br&amp;gt;&lt;br /&gt;
'''m''' -- Magenta&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>209.112.196.223</name></author>
		
	</entry>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=GP&amp;diff=829</id>
		<title>GP</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=GP&amp;diff=829"/>
		<updated>2008-09-10T03:05:47Z</updated>

		<summary type="html">&lt;p&gt;209.112.196.223: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the first utility program given to us by the programmers at EE Internet.  Turns out this program just does the html pages and not the graphs.  To run it you'll need to install two extra python packages:  Kid and Pytz.  Instruction for that are on the [[python]] page.  To run gp from the command line you give python the input script name and also the name/location of an initialization file:&lt;br /&gt;
 $ python gp.py ADOT/dot.ini&lt;br /&gt;
&lt;br /&gt;
This setup was modified by Bob after the materials we got from the EEI people.  For this run I copied everything off the EEI page and put it all into the directory &amp;lt;pre&amp;gt;/work/python/gws/gp&amp;lt;/pre&amp;gt;&lt;br /&gt;
Important directories you'll need full and be filling:&amp;lt;br&amp;gt;&lt;br /&gt;
This is where the gp.py created html will go.  On your first run directories will be created for each station.&lt;br /&gt;
 /work/python/gws/gp/ADOT/html  &lt;br /&gt;
This is where all of the source data files from loggernet are contained.  There is no directory structure here, everything is lumped into one directory.&lt;br /&gt;
 /work/python/gws/gp/ADOT/data&lt;br /&gt;
It appears this directory, although listed in the configuration file, is not currently used by gp.py.&lt;br /&gt;
 /work/python/gws/gp/ADOT/plots &lt;br /&gt;
&lt;br /&gt;
In addition, for the first run there is some code at the end of gp.py that tries to send an email.  I commented that section out (lines 314 to 358 in revision 143 of gp.py).&lt;br /&gt;
&lt;br /&gt;
Here's a working initialization file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Main]&lt;br /&gt;
networkName = ADOT&lt;br /&gt;
# Where the configuration files lie&lt;br /&gt;
configDir = /work/python/gws/gp/ADOT&lt;br /&gt;
# File with all the station information&lt;br /&gt;
stationInfoCsv = StationInfo.csv&lt;br /&gt;
# Directory containing the template files&lt;br /&gt;
templateDir = /work/python/gws/gp/ADOT&lt;br /&gt;
# The base dir for rendered files&lt;br /&gt;
outputDirBase = /work/python/gws/gp/ADOT/html&lt;br /&gt;
# Base URL of the data files (http://, ftp://, file:///home/data, etc)&lt;br /&gt;
#dataFileBaseURL = http://werc.engr.uaf.edu/~ken/nslope-adot/&lt;br /&gt;
# dataFileBaseURL = http://www.gwscientific.com/remote/adot/&lt;br /&gt;
dataFileBaseURL = file:///work/python/gws/gp/ADOT/data/&lt;br /&gt;
# Name of the diagnostics files&lt;br /&gt;
diagOutputName = adot-diag.html&lt;br /&gt;
# Are we generating the &amp;quot;stripped down&amp;quot; include files?&lt;br /&gt;
generateInclude = True&lt;br /&gt;
# Where are the graphs going?&lt;br /&gt;
graphOutputDirBase = /work/python/gws/gp/ADOT/plots&lt;br /&gt;
diagURL = http://www.eeinternet.com/dot/html/adot-diag.html&lt;br /&gt;
baseStationOrder = bullen,foothills&lt;br /&gt;
&lt;br /&gt;
[DataRecency]&lt;br /&gt;
threshold = 0.25&lt;br /&gt;
notifyEmail = fnkci@uaf.edu,jkugler@eeinternet.com&lt;br /&gt;
&lt;br /&gt;
[bullen]&lt;br /&gt;
baseStationName = Bullen Point Project&lt;br /&gt;
stationOrder = DBM1,DBM2,DBM3,DBM4,DBM5,DBM6,DBM7,DBM8,DBR1,DBR2,DBR3,DBR4,DBR5&lt;br /&gt;
&lt;br /&gt;
[foothills]&lt;br /&gt;
baseStationName = Kuparuk Foothills Project&lt;br /&gt;
stationOrder = DFM1,DFM2,DFM3,DFM4,DFM5,DFR1,DFR2,DFR3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A bit more on this gp business.  It appears to contain main() for this utility but the bulk of the work is done in gputil.py which contains object definitions for the system.  Everything is pretty much done through the objects.  The sneaky catch is that there's a filename hardcoded into the object, ''StationInfo.csv''.  ''StationInfo.csv'' basically contains the metadata for all these sites in csv format (header on the first line).  Cracks me up a bit since they're also using the kid module which I thought was for flexible XML use but whatever I guess.  So, you can get the feeling from reading the ADOT ''StationInfo.csv'' file below that all of this info gets used in various ways in the junk outputted to the html pages:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StationName,PakbusID,StationDescriptiveName,StationLocationDescription,Latitude,Longitude,MagneticDeclination(East),ElevationFt,ElevationM,DataFileDirectory,DataFileNameBase,DataFileSuffixes,OutputDir,TemplateMap&lt;br /&gt;
DBM1,201,Accomplishment Creek Met,&amp;quot;Accomplishment Ck, below lake at pass to Rubicon&amp;quot;,N 68 24.696,W 148 8.190,22.6,4833,1474.065,,DBM1_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM1,dot&lt;br /&gt;
DBM2,202,Ribdon Met,Upper Rubicon,N 68 38.548,W 147 21.107,23.1,4648,1417.64,,DBM2_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM2,dot&lt;br /&gt;
DBM3,203,Juniper Met,Upper Juniper Ck,N 69 4.570,W 146 30.294,23.8,4324,1318.82,,DBM3_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM3,dot&lt;br /&gt;
DBM4,204,Sag-Ivishak Met,&amp;quot;Close to snow survey site UP1, aka FT1&amp;quot;,N 69 12.933,W 148 33.116,22.9,1414,431.27,,DBM4_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM4,dot&lt;br /&gt;
DBM5,205,Upper Kad Met,Kadleroshilik uplands,N 69 32.968,W 147 56.505,23.5,686,209.23,,DBM5_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM5,dot&lt;br /&gt;
DBM6,206,Kavik Met,Kavik camp,N 69 40.402,W 146 54.034,24.1,649,197.945,,DBM6_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM6,dot&lt;br /&gt;
DBM7,207,Lower Kad Met,&amp;quot;Kadleroshilik River, near the old runway&amp;quot;,N 70 4.406,W 147 39.000,23.8,78,23.79,,DBM7_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM7,dot&lt;br /&gt;
DBM8,208,Bullen Met,South of Bullen Pt,N 70 4.792,W 146 49.166,24.3,86,26.23,,DBM8_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DBM8,dot&lt;br /&gt;
DBR1,211,TBD,TBD,,,,,,,DBR1_,&amp;quot;&amp;quot;,DBR1,dot&lt;br /&gt;
DBR2,212,Ribdon Rep,Somewhere around Lupine valley?,N 68 36.337,W 147 23.716,23.2,N/A,N/A,,DBR2_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DBR2,dot&lt;br /&gt;
DBR3,213,Pogopuk Rep,Between Gilead Ck and Niviak Pass,N 69 17.369,W 146 22.990,23.3,N/A,N/A,,DBR3_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DBR3,dot&lt;br /&gt;
DBR4,214,Kavik Rep,&amp;quot;South of Kavik Camp, next to winter trail&amp;quot;,N 69 37.893,W 146 52.889,23.4,1436,437.98,,DBR4_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DBR4,dot&lt;br /&gt;
DBR5,215,Franklin Bluffs Rep,&amp;quot;Franklin Bluffs, NE side&amp;quot;,N 69 48.633,W 148 19.540,23.1,875,266.875,,DBR5_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DBR5,dot&lt;br /&gt;
DFM1,601,South White Hills Met,WERC HV5 snowsurvey site,N 69 12.043,W 149 33.508,22.4,962,293.41,,DFM1_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DFM1,dot&lt;br /&gt;
DFM2,602,White Hills Met,WERC White Hills previous repeater site,N 69 29.187,W 149 49.284,22.5,,,,DFM2_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DFM2,dot&lt;br /&gt;
DFM3,603,North White Hills Met,Between lake and stream to NNE of White Hills,N 69 42.892,W 149 28.227,22.6,276,84.18,,DFM3_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DFM3,dot&lt;br /&gt;
DFM4,604,North West Kuparuk Met,WERC H03 snowsurvey site,N 69 56.851,W 149 55.014,22.7,406,123.83,,DFM4_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat,HrlySubs.dat&amp;quot;,DFM4,dot&lt;br /&gt;
DFM5,605,TBD,TBD,,,,,,,DFM5_,&amp;quot;&amp;quot;,DFM5,dot&lt;br /&gt;
DFR1,611,Kak Rep,Kakukturat Mtn,N 69 4.357,W 149 30.870,22.3,1667,508.435,,DFR1_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DFR1,dot&lt;br /&gt;
DFR2,612,Slope Mnt Rep,Slope Mtn Repeater Site (relocated to top),N 68 44.448,W 149 1.989,,3858,1176.69,,DFR2_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DFR2,dot&lt;br /&gt;
DFR3,613,Shell Pingo Rep,Shell Pingo Top,N 70 1.234,W 147 40.903,23.8,408,124.44,,DFR3_,&amp;quot;HrlyAtms.dat,HrlyDiag.dat&amp;quot;,DFR3,dot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
September 9 after work update&amp;lt;br&amp;gt;&lt;br /&gt;
Will continue fleshing this out but had some more thoughts to add.&lt;br /&gt;
So, there are generally five parts of input: &lt;br /&gt;
# the .ini, which controls general directory locations, stations to process, station groupings etc.&lt;br /&gt;
# stationinfo.csv which contains station specific information (including data input file names)&lt;br /&gt;
# the .dat files (listed in stationinfo.csv)&lt;br /&gt;
# the html templates.  The html templates are turned into regular html using the python package kid.&lt;br /&gt;
# another key file that basically contains aliases between variables common to each station which may have different names in the specific .dat  file (like different ways of identifying air temperature for example).&lt;br /&gt;
&lt;br /&gt;
So, changing the way plots are displays probably involves copying and then modifiying one of html templates.  This could also allow annotations to be included in a separate include for example.  Doing some early QA/QC stuff is even easier.  Just write a new script (or point to datasets QA/QCed from the O.O. based file system Ken's been working on) that does the qaqc on the data and puts it all into a new file that has a first level of processing done to it.  No need to change this program at all.  The things that would change would be the .ini and stationinfo file with the general gp.py framework remaining in place. &amp;lt;br&amp;gt;&lt;br /&gt;
So, for html changes (changing how figures are shown and adding annotation text) there will be at least a minimal amount of coding required to modify gp.py or gp_util.py but for data changes that can all be done through the .ini files.&amp;lt;br&amp;gt;&lt;br /&gt;
I guess additionally, to get older cr10x data to work with this system wouldn't be a giant deal.  The julian date &amp;amp; time would need to be changed into a regular format as the table based is and the arrays would each need to go into their own data file but otherwise, not to much required.&lt;/div&gt;</summary>
		<author><name>209.112.196.223</name></author>
		
	</entry>
</feed>