This document describes the usage of pd.cgi
URL Format
lighthouse.tamucc.edu/pd/param1=value1¶m2=value2/param1=value3?param3=value4
Each slash after pd denotes a new "collection". Each subsequent collection after the first retains all previously defined values, except for those that are redefined. Any parameters after the question mark apply to all collections. In the example above:
collection 1
param1 = value1
param2 = value2
param3 = value4
collection 2
param1 = value3
param2 = value2
param3 = value4
Required Parameters
stnlist=
a list of stations
multiple values should be separated by commas or spaces
e.g. stnlist=001,002,003
AND
serlist=
a list of data series
multiple values should be separated by commas or spaces
e.g. serlist=pwl,wsd,wdr
OR
sslist=
a list of station-series pairs
multiple values should be separated by commas or spaces
e.g. sslist=001-pwl,002-wsd
OR
dspecs=
a list of data sources with named arguments including id, location, ser, and offset.
each DSpec is enclosed in parenthesis, multiple DSpecs are separated by commas or spaces
e.g., dspecs=(id=250,location=BobHallPier,ser=pwsd,offset=12),(id=254,location=BobHallPier,ser=pwsd,offset=12)
Optional Parameters
-action=
the format used to display the data
valid values are:
t - text rows (default)
c - columnar text output
g - graphical output
excel - generate an excel spreadsheet
png - png image
gif - gif image
qc - similar to g, but makes graphs hyperlinks to text row output with a special date format
ccwfo - special output for the NWS Corpus Christi Weather Forecasting Office
unit=
the system of units or specific unit to display data in
valid values are:
raw - the raw units that data are stored in (default)
metric - standard metric units (m,degC,m/s,millibars,pH,psu,micromhos,mg/L,%,volts,ntu,sec,degfromN,dB)
english - standard english units(ft,degF,mph,in Hg,pH,psu,micromhos,lb/ft^3,%,volts,ntu,sec,degfromN,dB)
marine - standard marine units(ft,degF,knots,in Hg,volts,sec)
m,cm,mm,km,in,ft - distance units
degF,degC,degK - temperature units
m/s,mm/s,km/h,mph,knots - velocity units
Pa,millibars,mm Hg,in Hg,psia - pressure units
pH - pH units
psu - practical salinity units
micromhos - conductivity units
mg/L,lb/ft^3 - density units
% - percentage units
volts - voltage units
ntu - nephelometric turbidity units
sec - time units
degfromN - direction units
dB - decibel units
when=
the date range in UTC for which to display data
default value: now,-7d
epoch=
the National Tidal Datum Epoch to use for referencing datums
datums are not available for all epochs for all stations
valid values are:
1983-2001 (default)
1990-1994
1960-1978
elev=
the datum to reference water level to
not all datums are available for all stations
valid values are:
stnd - station datum (default)
mhhw - mean higher high water
mhw - mean high water
mtl - mean tide level
msl - mean sea level
mlw - mean low water
mllw - mean lower low water
navd88 - North American Vertical Datum 1988
datefmt=
specifies the output date format
default value: %Y%j+%H%M
tz=
deprecated, use whentz= (below)
whentz=
specifies the timezone to use for output dates
this parameter only has an effect if it appears in the query string (after the ?)
example values are:
CST6CDT - Central time with daylight saving
EST5EDT - Eastern time with daylight saving
interval=
restrict the displayed data to an interval specified in seconds
example:
360 - show data every six minutes (default)
3600 - show data for the top of each hour
na=
the value to display when data is not available
default value: NA
rm=
the value to display when data has been removed
default value: RM
nohttp
do not output http headers
this parameter does not require a value
Graphical Formatting Parameters
legendxy=
specify where to position the legend
this can be specified as:
x,y coordinates (relative to upper left corner of the image)
margin (tmargin,bmargin,lmargin,rmargin)
the default position is the upper left corner of the plot area
shortlegend
use a short format for the legend
this parameter does not require a value
legendbox
place a box around the legend
this parameter does not require a value
nolegend
omit the legend
this parameter does not require a value
legendcols=
restrict the legend to a specified number of columns
default value: 1
legendrows=
restrict the legend to a specified number of rows
vline=
draw a vertical line at a specified date/time
example: vline=now
append "label" to override the default label
append %
style=
value% to override default styles (see
Styles)
example: vline=now"right now"%color=green size=5%
hline=
draw a horizontal line at a specified value (on the first y axis)
append "label" to specify a label
append %
style=
value% to override default styles (see
Styles)
example: hline=0"zero line"%color=black size=2%
title=
specify a title for the graph
titlejust=
specify how to justify the title
valid values are: center (default), left, right
palette=
specify an ordered palette of colors to use for graphing multiple series
multiple values should be separated by commas or spaces
default value is: red,green,blue,cyan,magenta
valid color values: (see
Colors)
color=
specify the color to use to plot the first series in a collection
default value comes from the palette
if the specified color has already been used, the next available color in the palette will be used instead
valid color values: (see
Colors)
joincols
join together all collections such that series of similar units are plotted on the same vertical axis
this parameter does not require a value
style=
specify the style to use for data plotting
valid values are:
line - connect data points with lines (default)
dot - display a single pixel dot for each data point
cross - display a crosshair for each data point
char - display a character for each data point (as specified by the "char" parameter)
char=
specify the character to use to represent each data point when style=char
default value: *
tmargin=
specify the height of the top margin in pixels
default value: 10
lmargin=
specify the width of the left margin in pixels
default value: 70
rmargin=
specify the width of the right margin in pixels
default value: 0
bmargin=
specify the height of the bottom margin in pixels
default value: 50
width=
specify the width of the image in pixels
default value: 600
height=
specify the height of the image in pixels
default value: 400
xjust=
specify how to justify the x axis label
valid values are: center (default), left, right
yjust=
specify how to justify the y axis label
valid values are: center (default), left, right
xlabel=
specify a label for the x axis
default value: Time ($tz)
where $tz is the time zone
ylabel=
specify a label for the y axis
default value: $unit
where $unit is the long name for the y axis units
series that are relative to a datum add: above $datum
where $datum is the long name of the datum
gridlines=
show gridlines for each axis
multiple values should be separated by commas
valid values are:
xmaj - show major x axis gridlines
xmin - show minor x axis gridlines
ymaj - show major y axis gridlines
ymin - show minor y axis gridlines
xscale=
specify the upper and lower bounds for the x axis
values should be specified in unix time (number of seconds elapsed since January 1, 1970 00:00:00 UTC)
values should be separated by a colon
asterisks can be used for automatic calculation of bounds based on the when parameter
default value: *:*
yscale=
specify the upper and lower bounds for the y axis
values should be separated by a colon
asterisks can be used for automatic calculation of bounds based on the data range
default value: *:*
noautomargin
disable automatic margin expansion
this parameter does not require a value
Excel Parameters
For excel output, each collection represents a new worksheet.
filename=
specify a filename to use for the excel file
default value: pd_$unixtime
where $unixtime is the unix timestamp for when the file is created
sheetname=
prefix to use for naming worksheets
uniqueness of sheet names is preserved by appending an incrementing number to duplicate names
default value: Sheet
Series Specific Parameters
nnwl
offset=
restrict prediction to a single offset
generally used for showing past performance
file=
specify file suffix to use when loading neural network definition files
default value: nndef
interp=
set the type of interpolation to use between predicted values
valid values are:
lin - use linear interpolation (default)
slwin - use a sliding window
none - don't interpolate (single point for each offset)
perswl
offset=
number of hours of offset between persistance model prediction and measured water level
only useful for showing past performance
default value: 0
Styles
color=
specify color
size=
specify font size
valid values:
1 - Tiny
2 - Small
3 - MediumBold
4 - Large
5 - Giant
Colors
black #000000
blue #0000ff
darkblue #00008b
cyan #00ffff
darkcyan #008b8b
gray25 #bfbfbf
gray33 #a8a8a8
gray50 #808080
gray66 #545454
gray75 #404040
green #008000
darkgreen #006400
lime #00ff00
magenta #ff00ff
darkmagenta #8b008b
orange #dd8800
pink #ff1493
purple #800080
red #ff0000
darkred #8b0000
white #ffffff
yellow #ffff00
darkyellow #8b8b00