EOGrady21 / vprr

Video Plankton Recorder Data Processing
https://eogrady21.github.io/vprr/
Other
2 stars 1 forks source link

Using vpr_plot_profile for CTD data (no ROI data) #14

Closed EOGrady21 closed 4 years ago

EOGrady21 commented 4 years ago

In analysis of COR2019002, I have come to a situtation where it would be useful to use the vpr_plot_profile() function to plot just CTD data, without a concentration profile.

I would like to add this functionality to vpr_plot_profile()

I started with a ctd data frame (saved as ctd_data files from VP workflow)

> names(vpr_ctd)
 [1] "time_ms"         "conductivity"   
 [3] "temperature"     "pressure"       
 [5] "salinity"        "fluor_ref"      
 [7] "fluorescence_mv" "turbidity_ref"  
 [9] "turbidity_mv"    "altitude_NA"    
[11] "day"             "hour"           
[13] "station" 

In order to get

vpr_plot_profile(vpr_ctd[vpr_ctd$station == 'W5',], taxa_to_plot = NULL)

to run I had to make the following adjustments to the CTD data frame

vpr_ctd$depth <- swDepth(vpr_ctd$pressure)
vpr_ctd$density <- swSigmaT(salinity = vpr_ctd$salinity, temperature = vpr_ctd$temperature, pressure = vpr_ctd$pressure)
vpr_ctd$conc_m3 <- NA
names(vpr_ctd)[7] <- 'fluorescence'

It plots below,

image

GOAL

Ideally, you would not have to modify the CTD data frame, except maybe to add depth and density if they were not previously calculated. There should also be an option in the function to not include the ROI pane of the final plot output.

EOGrady21 commented 4 years ago

New commit adds an argument to vpr_plot_profile which solves this issue!