[V,HDR] = read_tdr10dd_csv(fname,maxsamps) % Matlab & Octave

Read a text file with comma-separated sensor data from a Wildlife Computers TDR10DD Daily Diary tag. These tags have a different data format than the Wildbytes Daily Diary tags. For these, use read_wbdd_txt. Sensor data files can be very large and a number of steps are taken here to maximize speed and avoid memory problems. This function is usable by itself but is more normally called by read_dd() which handles metadata and creates a NetCDF file.

Input var Description Default value
fname is the file name of the Daily Diary text file including the complete path name if the file is not in the current working directory or in a directory on the path. The .csv suffix is not needed. N/A
maxsamps is optional and is used to limit reading to a maximum number of samples per sensor. This is useful to read in a part of a very large file for testing. If maxsamps is not given, the entire file is read. N/A
Output var Description Units
V is a matrix of data read from the file. V has a line for each data line in the file and a column for each numeric data field in the input. Two kinds of fields in the CSV file are not imported: empty fields, i.e., fields that do not contain a header labeling the column, and Event fields (which are text fields describing householding actions in the tag). N/A
HDR is a cell array of strings containing the names of fields. The field names are taken from the first line of the CSV file and include units and axis where these are provided. HDR has the same number of cells as there are columns in V. N/A

Warning: Wildlife Computers TDR10DD Daily Diary tags can produce very large csv files which are slow to prrocess. This function is optimised for speed and memory use so will tolerate large files. But processing could be slow.

Date Software Applies to Error message Line Description Status
2017-08-06 Octave read_tdr10dd_csv error: datevec: DATE not parsed correctly with given format133OCTAVE does not handle fractional seconds with precisons >3. For example '19:04:00.8525 04-Sep-2011' will not parse, while '19:04:00.852 04-Sep-2011', '19:04:00.85 04-Sep-2011' and 19:04:00.8 04-Sep-2011 will parse correctly. This error also effects read_dd Reported

### Matlab & Octave

[V,HDR] = read_tdr10dd_csv('tdr10dd_test_segment',100)

Reads 100 samples from file cu11_247a_data.csv and returns the data and field information.