Difference between revisions of "Graphing"
Line 52: | Line 52: | ||
[[Air]] | [[Air]] | ||
fileName = c1-grid-air | fileName = c1-grid-air | ||
+ | title = "Whatever you like for a title" | ||
+ | caption = "Whatever you like for a caption, will show up below graphs but above legend" | ||
[[[Graphs]]] | [[[Graphs]]] | ||
[[[[AT]]]] | [[[[AT]]]] |
Latest revision as of 17:08, 7 October 2008
Contents
Overview
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.
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.
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.
Required Packages
Packages required in addition to those required for GP:
- ConfigObj
http://pypi.python.org/packages/2.5/C/ConfigObj
- MatPlotLib
http://pypi.python.org/pypi/matplotlib/0.91.4
- Numpy
http://pypi.python.org/pypi/numpy/1.1.1
All user-written files:
graph.py -- main program BaseGraph.py GWSFigures.py gpUtil.py graph_lib.py unit_conversion.py
Program Execution and Background
To run:
$ python graph.py [Options] [gp.py configuration file] [graph.py configuration file]
Such as: $ python graph.py -cd4 ./ADOT/dot.ini ./ADOT/graphs2.ini $ python graph.py -y4 ./ADOT/dot.ini ./ADOT/graphs2.ini $ python graph.py -d4 -X6 -Y4.5 ./ADOT/dot.ini ./ADOT/graphs2.ini
Command line parameters (case sensitive):
Command line options
- -c for current plus...
- -d# for days
- -m# for months
- -y# for years
Other Choices:
- -X for X dimension in pixels / 100 (6 is default = 600 pixels wide)
- -Y for Y dimension in pixels / 100 (4.5 is default = 450 pixels wide)
Sample contents of a graph.py configuration file
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.
[c1-grid] [[Air]] fileName = c1-grid-air title = "Whatever you like for a title" caption = "Whatever you like for a caption, will show up below graphs but above legend" [[[Graphs]]] [[[[AT]]]] graphType = T sensors = airTempAvg, lineColors = r [[[[Relative_Humidity]]]] graphType = RH sensors = relativeHumidityAvg, lineColors = b
fileName
Set this to be whatever you like. EEI example was like 'air' but including the station name wouldn't hurt.
graphType Choices
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).
T for a temperature plot, units = C or F; Degrees C on left Degrees F on right
TN Same as T, units = C or FN
WCC Same as T, units = C or F
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
WS for wind speed, units = m/s, MPH, or KNT
WD for wind direction, units = degrees
BP for pressure, units = milliBars
V for voltage, units = Volts
RH for relative humidity, units = Percent
P for precipitation, units = mm
NR for Net Radiation, units = W/m^2
RR for Reflected SW Radiation, units = W/m^2
IR for incoming SW Radiation, units = W/m^2
SD for snow depth, units = cm
VP for Vapor Pressure, units = kPa
sensors
The sensors variable can be a single value or a comma separated list of values to be shown on the graph. 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.
lineColors
As you might imagine these are the plot line colors. Choices are:
b -- Blue
r -- Red
c -- Cyan
y -- Yellow
k -- Black
g -- Green
m -- Magenta