TTS Data Plot Version
4.0 (10/17/2007)
This program, formerly referred to as "Raw Plot" has now been dubbed
"TTS Data Plot" because it can now plot data in all of the following
formats
- appended TTS files (FLO, extension .flo): turbidity, stage, discharge, rainfall,
air temperature, water temperature
- raw Campbell files (extension .dat) in the TOACI1 and TOA5 table based formats
created by CRBasic data loggers (CR800/1000)
- old Campbell formats (extension .dat) from mixed array data data loggers
(CR510/10X)
Notes
- The revision number is in sequence with "Raw Plot" since the new
program is derived from the old one.
- The program is known to be compatible with R versions 2.20 through 2.60.
- Discharge can be plotted from appended files but not raw files.
- Simulation functions are included
here for TTS 5.0. It is no longer necessary to import and save them in your
R workspace.
- You can always run this code at the R command prompt by typing tts.gui().
- You may be asked whether to save the workspace when exiting R. Normally
you will answer no, except during the first session as documented
below. Answer yes only when you have intentionally changed
the code. If you use the workspace to save data, you will likely lose that
data when a new revision of TTS Data Plot is installed.
A labels.txt file is required in order to plot rainfall, water,
and air temperature from appended (FLO) files. This file identifies these optional
data fields to the plotting program. The labels.txt file is
also required for plots from mixed array files in order to identify the station
by its array ID. Files in the TOACI1 and TOA5 table based formats identify the
station and data variables in the header, thus do not require a labels.txt
file. However, the minimum stage cannot be shown on the plot without it -- minimum
stage is given as the fourth variable of labels.txt. Each line of labels.txt should contain the following
comma-delimited station information:
- A 3-digit station identifier that appears as the first value in mixed
array data records; this must be 000 for table-based data files.
- The
3-letter station name; this should match the station subfolder name
as well as the first 3 letters of the station name in the header of table
based data files.
- The data logger recording interval in minutes
- Minimum
stage for sampling
- For mixed array raw data files, include these standard variable names: array,year,date,time,dump,bottle,code1,code2,stg,turb
- For
table based raw data files, inlclude these standard variable names: timestamp,recnum,dump,bottle,code1,code2,stg,turb
- After
the standard variable names, include the names of any optional variables that are recorded in
the data files. Only the names wtemp, atemp, and rain
are currently recognized by the program
Here is an example of the contents of labels.txt:
000,alb,10,0.30,timestamp,recnum,dump,bottle,code1,code2,stg,turb,wtemp,atemp,rain
000,smo,10,0.20,timestamp,recnum,dump,bottle,code1,code2,stg,turb,wtemp
000,dfg,15,0.80,timestamp,recnum,dump,bottle,code1,code2,stg,turb
001,nfc,10,0.50,array,year,date,time,dump,bottle,code1,code2,stg,turb
002,xyz,10,0.22,array,year,date,time,dump,bottle,code1,code2,stg,turb
003,arf,10,0.20,array,year,date,time,dump,bottle,code1,code2,stg,turb,wtemp,atemp
016,xra,10,0.20,array,year,date,time,dump,bottle,code1,code2,stg,turb
104,por,10,0.20,array,year,date,time,dump,bottle,code1,code2,stg,turb
200,ftr,15,0.40,array,year,date,time,dump,bottle,code1,code2,stg,turb,wtemp,rain
201,ljc,10,0.28,array,year,date,time,dump,bottle,code1,code2,stg,turb
Installing TTS Data Plot version
4. 0
- Before downloading make sure your settings in Windows Explorer are as follows
under Tools ... Folder Options ... View:
- Checked: Show Hidden Files and Folders
- Unchecked: Hide File Extensions for Known File Types
- Download TTS Data Plot for R to
a permanent location on your PC by right-clicking the link and choosing Save
Link As (FireFox) or Save Target As (Internet Explorer).
In the Save dialog, make sure your browser does not alter the name
of .RData. There should be no characters before the dot.
If you have difficulty downloading, contact Jack Lewis (jlewis01@fs.fed.us)
for a copy by email.
- If you are already running Raw Plot 3.0 for R version 2.2.0 or later:
- Replace your existing .RData (for Raw Plot 3.0) with
the new one (TTS Data Plot 4.0).
- Your old shortcut should open the new program
- If R has not yet been installed:
- Install R 2.x.x or newer from
the CRAN web site
or a mirror near you. Click R binaries ... <your platform> ... base.
If you are using Windows, download and install R-2.x.x-win32.exe. Accept the
default choices.
- Create labels.txt, if needed, in the
same location where you filed .RData
- Modify a copy of the new R Desktop shortcut. Do not use a shortcut for R
1.3.0.
- The “Start In” location listed in the properties should
match the location of .RData on your PC.
- The "Target" will be R program version 2.x.x, i.e. the Target
of the shortcut created when R was installed.
- Recommended: expand the default memory allocation by using the max-mem-size
option, e.g.
- Target: "C:\Program Files\R\R-2.x.x\bin\Rgui.exe" --max-mem-size=1024
- IMPORTANT: The first time you run the new code, follow
these steps:
- Start R via the shortcut, then press ESC when you are prompted to enter
'r' or 'a'.
- If you have just installed R:
- From the Packages menu, choose Install Packages... select a mirror site...
select chron... click OK
- From the Packages menu, choose Load Package... select chron... click
OK
- Set the default locations for raw data files;
- At the command prompt, type fix(rawplot.gui),
- This opens the function rawplot.gui in a text editor.
- In the first line, change the default path to the folder
on your system where raw files will be stored. Use forward slashes to
delimit subfolders. All raw files to be plotted must reside in one folder
(this is meant for field use).
- Save and exit the text editor
- Set the default locations for appended data files;
- At the command prompt, type fix(floplot.gui),
- This opens the function floplot.gui in a text editor.
- In the first line, change the default path to the folder
on your system where appended files will be stored. The appended FLO files
should be located in 3-letter station subfolders at this location. Use
forward slashes to delimit subfolders.
- Save and exit the text editor
- Quit and Save Workspace, by typing q()
at the command prompt or by clicking the X in the upper right-hand corner
of the R window. Do not attempt to quit R
from the File menu as there is a bug that may cause R (at least versions 2.2x)
to crash.