Appendix B. Using Campbell Ingest Separate from an ISS Installation

The ISS ingestor for the Campbell serial data stream can be used separately from the ISS directory tree. First check it out from CVS and build it, something like this:

    
cvs co -d cam_ingest iss/src/ingest/cam_ingest
cd cam_ingest
cvs co -d util iss/src/util
cd util
zmkmf
make
cd ..
zmkmf
make EXTRA_LOAD_FLAGS='util/libiss.a' install

Here's a typical invocation for the ISS, taken from the /iss/etc/init.d/surface script:

    datafile=cr10data.txt
    fields=skip:pres:tdry:rh:wspd:wdir:year:jd:hhmm:secs:skip:vwspd:skip:wdev:skip:skip:vis:netrad:ir:skip:rain:batt:tbox

    cam_ingest -l /dev/ttyS0 -b 9600 -z surface_met -f "$fields" -d "$download" -t $datafile -w "$lat:$lon:$alt" -p'

Where surface_met is the name of the Zebra platform to which surface measurements will be stored. The ingestor keeps datafile updated with the latest values read from the Campbell for use by other software like the sounding system. The fields string contains the field names to assign to values in the order read from the Campbell. The site location is passed in the lat, lon, and alt parameters, where the units of altitude are meters above mean sea level. Finally, download is the filepath to the Campbell program which should be uploaded on startup.

On startup the ingestor opens the serial port, handshakes with the Campbell, uploads the program, and then continuously waits for data and writes it to netcdf files.

Here's an example platform definition for the Zebra datastore config file, ds.config.

platform surface
	organization	scalar
	filetype	netcdf
	daysplit
endplatform

Ordinarily cam_ingest expects to be run from another process which restarts it when it fails, since it just aborts on errors or timeouts. However, in general cam_ingest has been very reliable.