Explain how to read an ODV spreadsheet data file using Julia
In [47]:
include("./ODVspreadsheet.jl")
using Logging
using ODVspreadsheet
In [2]:
Logging.configure(level=WARNING);
In [32]:
datadir = "./";
ODVfile = joinpath(datadir, "BlackSea_2profiles.txt");
Check if the file exists:
In [33]:
if isfile(ODVfile)
info("Working on file $ODVfile")
else
err("File $ODVfile doesn't exist")
end
The function will return an object that stores all the information contained in the spreadsheet.
In [34]:
ODVdata = readODVspreadsheet(ODVfile);
The labels of the columns. Note that some columns have the same title (quality flags).
In [35]:
ODVdata.columnLabels
Out[35]:
The metadata relative to the collection:
In [36]:
ODVdata.metadata
Out[36]:
The profiles. Here we only have 2 profiles so it's ok to display their content. Otherwise it is preferable to select one profile.
In [37]:
ODVdata.profileList
Out[37]:
In [46]:
profile1 = ODVdata.profileList[1][end][1]
Out[46]:
If you want to access the temperature, you just need to know in which column it is stored.
It is easy if you use the columnLabels:
In [11]:
temperature = profile1[12]
Out[11]:
Currently all the data are read as strings, but it's easy to convert them to floats.
In [12]:
map(x->parse(Float64,x),temperature)
Out[12]:
In [24]:
length(ODVdata.metadata)
Out[24]:
In [ ]: