Open sebastiandig opened 6 months ago
Located: Dissertation_code/analysis/example_load_ctd_oce
Also, I updated the ctd_load
function to also take a data.frame
with better names and adding units. This will also check if the column names exist by comparing the column names of the raw data to the expected parameters.
Another improvement is the event level information like cruise ID, station, etc are in the metadata instead of a layer in the CTD object. Modified the as.ctd()
function.
The original use will still work by giving a vector of column names.
@7yl4r
Location: Dissertation_code/R/ctd_load_wrapper.R
I modified the ctd_load
function to be two functions with one for a single station (ctd_load_station
) and another as a cruise (ctd_load_cruise
).
ctd_load_station
- takes a single set of station data and converts to CTD object. The minimum column names are:
ctd_load_cruise
- a wrapper function on ctd_load_station
where you would need the same column names as above plus an additional column for stations names specified by the station_col
argument. Optionally, you can add the cruise ID.
Hopefully, this makes it a little easier to give one CTD cast at a time or optionally more. I tested it on a "raw" CTD file and luckily still works.
I found the reason why you needed to do
cast <- ctd_FK[[i]][[1]]
with the added[[1]]
brace.In the process of converting the data into a CTD object, an additional step was added that may or may not be preferred. We can discuss which version would be more preferable.
The data was split like this
This creates a nested list of CTD station objects in the form:
The function takes care of the multiple stations using a loop which also creates a list. The reason why the list is nested is because of the creation of the list in the function while giving it a list. The original intent was to give it all cruise files and have a list of cruises with each cruise containing sites, but now it's a site nested within a list of sites.
There are two solutions:
Change
ctd_load
code