Read a Campbell Scientific TOA5 File Online — Four Header Lines and All
Read as delimited textNo dedicated reader yet, and the generic one already reads it: the timestamps, the columns and the NAN markers all come through. What it does not do is on this page too.
A TOA5 table is four lines of header and then data, which is one line more than most software expects and three more than a spreadsheet import wizard guesses. The result is usually a file whose first three rows of "data" are units and processing codes, and a timestamp column read as text. Here is what those four lines are for, and what you get if you drop the file in as it stands.
Drop it here
Open the resampler and drag the file onto it — as it came off the logger, header lines and all. It reads the file in this browser tab: nothing is uploaded, there is no account, and no request goes out while you work.
Open the file readerWhat the export looks like
"TOA5","RF407_CR1000","CR1000","69096","CR1000.Std.27.04","CPU:SkiSF_Met.CR1","46595","SkiSF_Met" "TIMESTAMP","RECORD","AirTF_Max","AirTF_Min","AirTF_Avg" "TS","RN","°F","°F","°F" "","","Max","Min","Avg" "2024-04-06 13:30:00",0,10.87,10.74,10.78 "2024-04-06 14:30:00",2,NAN,NAN,NAN
TOA5,CR1000,CR1000,1234,CR1000.Std.27.04,CPU:Met.CR1,46595,Table1,,,, TIMESTAMP,RECORD,AirTC_Avg,RH TS,RN,Deg C,% ,,Avg,Smp 11/11/2015 0:00,0,7.21,88.2
The awkward parts, and what happens to them
- Four header lines, where a CSV reader expects one.
- The table is found and the timestamps come through as instants rather than as text.
- NAN as the missing marker — a real table has thousands of them, one per sensor per outage.
- Read as missing. Not as zero, and not as the text "NAN", either of which puts a spike or a hole in every chart of the table.
- Field names like AirTF_Avg, with the aggregation baked into the name.
- Kept as they are, so the column you pick is the column the logger programme wrote.
- Excel round trips: quotes stripped, the environment line comma-padded, US short dates instead of ISO ones.
- Read anyway. The delimiter, the quoting and the date order are all worked out from the file.
- TMx and TMn columns, which hold the TIME a maximum occurred rather than a number.
- Dropped, because a column with no numbers in it is not a series. Recovering them as timestamps is a thing a dedicated reader would add.
Every line above is asserted by src/core/timeseries/__tests__/vendorFallback.test.ts, which runs on every change to this site’s code.
What has not been checked
- The file is read by the general-purpose reader, not by one written for Campbell. That means nothing keys on the TOA5 environment line, and the units on line 3 and the processing codes on line 4 are not attached to the channels they belong to.
- The close relatives of TOA5 — TOACI1, TOB1 and legacy array CSV — have not been tested here at all. TOB1 in particular has an eight-field first line like TOA5 and then binary data, so if you have one, expect nonsense rather than a clean refusal.
What the four header lines are
Line 1 is the environment line and always has eight fields: the literal TOA5, the station name, the logger model, the logger serial, the operating system version, the programme name, the programme signature and the table name. It is the line that identifies the file, and it is the one an Excel round trip pads with trailing commas.
Line 2 is the field names, with TIMESTAMP first and usually RECORD second — though roughly one file in a hundred has no RECORD column, so nothing should require it. Line 3 is the units and may be entirely empty. Line 4 is the processing code: Smp, Avg, Max, Min, Tot, Std and a handful of others, which is how you tell an average from an instantaneous sample when the field name does not say.
The honest state of support
There is no Campbell-specific reader here yet. What there is instead is a general reader that finds the table, reads the timestamps, keeps the measurement columns and understands NAN — checked against two verbatim TOA5 headers held as test fixtures, one canonical and one Excel-mangled. So a TOA5 table gives you a usable answer today.
When a dedicated reader lands, those same fixtures are what it has to beat, and the things it will add are the ones listed above: units and processing codes attached to their channels, TMx and TMn read as the times they are, and TOB1 refused rather than half-parsed.
Common questions
- Do I need to delete the header lines first?
- No. Drop the file in as it came off the logger. If you have already deleted them that is fine too — a table with one header row reads perfectly well.
- My file is tab-separated and the dates are day-first.
- Both happen, and both are worked out from the file rather than assumed. Where a date column genuinely gives no evidence of its order — every day of the month is twelve or lower — you are told that rather than left with a series that is silently wrong.
- Is anything sent to a server?
- No. The file is read in your browser tab. Nothing is uploaded, there is no account, and no request goes out while you work.