Green Edge - Ice Camp
Load libraries
Plot parameters
depth_sampled <- c(1.5, 5, 10, 20, 30, 40, 60)
depth_color<-c("1.5"="#c6dbef","5"="#9ecae1", "10"="#6baed6", "20"="#4292c6", "30"="#2171b5", "40"="#08519c", "60"="#08306b")
depth_linetype<-c("1.5"=1,"5"=1, "10"=1, "20"=2, "30"=2, "40"=2, "60"=2)
depth_shape <-c("1.5"=15,"5"=15, "10"=16, "20"=16, "30"= 17, "40"=17, "60"=18)
scaling_factor=15
cell_label <- expression (paste("cell.",mL^-1))
pico_label <- expression (paste("Pico cell.",mL^-1))
nano_label <- expression (paste("Nano cell.",mL^-1))
cell_breaks=c(10, 100,1000,10000,100000)
cell_limits_phyto = c(10, 100000)
cell_limits_nano = c(10, 10000)
cell_limits_bact = c(100000, 1500000)
julian_day_limits = c(90, 200)
depth_min=0; depth_max=100 Read the data
Metadirectory directory is ../metadata/
Preprocess light data
ge_par_all <- read_csv("../metadata/PAR daily_par_cops_2015_2016.csv.gz")
print(summarytools::descr(ge_par_all, stats = c( "n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| year_utc | 108809.00 | 2015.33 | 0.47 | 2015.00 | 2016.00 |
| month_utc | 108809.00 | 5.45 | 0.84 | 4.00 | 7.00 |
| day_utc | 108809.00 | 14.69 | 8.46 | 1.00 | 31.00 |
| hour_utc | 108809.00 | 15.30 | 1.83 | 1.00 | 21.00 |
| minute_utc | 108809.00 | 29.23 | 16.89 | 0.00 | 59.00 |
| second_utc | 108809.00 | 29.62 | 16.04 | 0.00 | 59.00 |
| latitude_dec_degrees | 108809.00 | 67.48 | 0.00 | 67.48 | 67.48 |
| longitude_dec_degrees | 108809.00 | -63.79 | 0.00 | -63.79 | -63.79 |
| depth_edz_m | 108809.00 | 17.39 | 24.87 | 0.00 | 108.00 |
| par_0_fit_muein_m_2_s_1 | 84344.00 | 1395.10 | 300.85 | 56.55 | 2585.69 |
| par_0_fit_daily_ein_m_2_day_1 | 108809.00 | 48.65 | 9.60 | 22.41 | 64.76 |
| par_d_fit_muein_m_2_s_1 | 85213.00 | 10.82 | 37.13 | 0.00 | 819.97 |
| par_d_fit_percent_percent | 85213.00 | 0.84 | 2.61 | 0.00 | 46.64 |
| par_d_fit_daily_ein_m_2_day_1 | 85213.00 | 0.41 | 1.33 | 0.00 | 23.95 |
| par_d_noon1hloc_ein_m_2_1h_1 | 85213.00 | 0.94 | 2.99 | 0.00 | 54.14 |
| par_d_p1h_ein_m_2_1h_1 | 85213.00 | 0.04 | 0.12 | 0.00 | 2.23 |
| par_d_p3h_ein_m_2_3h_1 | 85213.00 | 0.11 | 0.34 | 0.00 | 6.21 |
| par_d_p24h_ein_m_2_day_1 | 85213.00 | 0.41 | 1.35 | 0.00 | 25.90 |
| par_d_p48h_ein_m_2_48h_1 | 83199.00 | 0.83 | 2.67 | 0.00 | 49.54 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
ge_par <- filter(ge_par_all, depth_edz_m %in% depth_sampled)
ge_par_mean <- ge_par %>% group_by(year_utc, month_utc, day_utc, depth_edz_m ) %>%
summarise(par_daily_mean = mean(par_d_fit_daily_ein_m_2_day_1, na.rm = TRUE)) %>%
mutate(date = make_date (year_utc, month_utc, day_utc),
depth_m = depth_edz_m,
depth_m_char = as.character(depth_edz_m))
print(summarytools::descr(ge_par_mean, stats = c( "n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| year_utc | 469.00 | 2015.42 | 0.49 | 2015.00 | 2016.00 |
| month_utc | 469.00 | 5.45 | 0.94 | 4.00 | 7.00 |
| day_utc | 469.00 | 14.52 | 8.42 | 1.00 | 31.00 |
| depth_edz_m | 469.00 | 23.79 | 19.54 | 1.50 | 60.00 |
| par_daily_mean | 464.00 | 0.38 | 1.20 | 0.00 | 10.83 |
| depth_m | 469.00 | 23.79 | 19.54 | 1.50 | 60.00 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Flow cytometry
ge_fcm <- read_excel("../metadata/GE_all_Cytometry version 1.5.xlsx",sheet = "All data") %>%
mutate(depth_m_char = as.character(depth_m),
date=as_date(date))
print(summarytools::descr(ge_fcm, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| year | 1615.00 | 2015.77 | 0.42 | 2015.00 | 2016.00 |
| julian_day | 679.00 | 152.92 | 24.49 | 91.00 | 200.00 |
| leg | 370.00 | 2.82 | 0.89 | 1.00 | 4.00 |
| lat_deg | 1615.00 | 67.11 | 6.33 | 18.00 | 70.00 |
| lat_min | 1615.00 | 26.68 | 14.56 | 0.00 | 59.00 |
| long_deg | 1615.00 | 60.82 | 2.49 | 52.00 | 66.00 |
| long_min | 1615.00 | 39.13 | 14.31 | 0.00 | 59.00 |
| ctd | 916.00 | 100.68 | 60.07 | 3.00 | 202.00 |
| depth_m | 1390.00 | 45.53 | 66.86 | 0.00 | 360.00 |
| fsw_added_mL | 186.00 | 5389.25 | 3118.68 | 1500.00 | 12400.00 |
| total_volume_after_melting_mL | 184.00 | 7361.27 | 4054.51 | 2735.00 | 17760.00 |
| Syn_mL | 935.00 | 130.13 | 2034.30 | 0.00 | 51241.94 |
| Pico_mL | 1598.00 | 15823.64 | 89272.69 | 0.00 | 1529723.96 |
| Nano_mL | 1597.00 | 8930.49 | 60550.17 | 0.00 | 1976145.83 |
| Crypto_mL | 1597.00 | 116.54 | 797.04 | 0.00 | 16111.11 |
| Crypto_FSC | 30.00 | 3155.20 | 3059.06 | 24.48 | 11527.57 |
| Crypto_SSC | 30.00 | 321.17 | 251.99 | 11.88 | 774.70 |
| Crypto_PE | 30.00 | 14.34 | 11.02 | 2.50 | 45.13 |
| Crypto_Chl | 30.00 | 2732.16 | 1327.47 | 528.25 | 5832.22 |
| HBact_mL | 658.00 | 290138.76 | 425925.88 | 0.00 | 4784150.00 |
| LBact_mL | 659.00 | 93461.01 | 103201.10 | 0.00 | 917476.04 |
| Bact_mL | 1532.00 | 486856.96 | 459401.57 | 1791.67 | 4784150.00 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Pigments
ge_hplc <- read_excel("../metadata/Pigments greenedge-ICECAMP2016_090517b.xlsx", sheet = "water", na=c("", "LOD")) %>%
mutate(depth_m_char = as.character(depth_m),
date=as_date(sampling_date))
print(summarytools::descr(ge_hplc, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| Latitude | 206.00 | 67.48 | 0.00 | 67.48 | 67.48 |
| Longitude | 206.00 | -63.79 | 0.00 | -63.79 | -63.79 |
| julian_day | 206.00 | 162.46 | 23.82 | 120.00 | 204.00 |
| depth_m | 206.00 | 16.72 | 18.27 | 0.50 | 75.00 |
| Filtered Vol (L) | 206.00 | 1.87 | 0.37 | 1.00 | 2.50 |
| Chlorophyll c3 | 206.00 | 0.02 | 0.02 | 0.00 | 0.14 |
| Chlc3-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Chlorophyll c2 | 206.00 | 0.08 | 0.12 | 0.00 | 0.70 |
| Chlc2-QA | 206.00 | 1.03 | 0.17 | 1.00 | 2.00 |
| Chlorophyll c1 | 206.00 | 0.02 | 0.02 | 0.00 | 0.12 |
| Chlc1-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Chlorophyllide a | 9.00 | 0.01 | 0.01 | 0.00 | 0.03 |
| Chlda-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Peridinin | 140.00 | 0.00 | 0.00 | 0.00 | 0.01 |
| Peri-QA | 206.00 | 1.03 | 0.17 | 1.00 | 2.00 |
| Phaeophorbid a | 205.00 | 0.04 | 0.04 | 0.00 | 0.22 |
| Phda-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Uriolide | 104.00 | 0.01 | 0.01 | 0.00 | 0.04 |
| Uriol-QA | 206.00 | 2.03 | 1.00 | 1.00 | 3.00 |
| 19'-Butanoyloxyfucoxanthin | 202.00 | 0.00 | 0.00 | 0.00 | 0.01 |
| But-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Fucoxanthin | 206.00 | 0.23 | 0.31 | 0.01 | 1.75 |
| Fuco-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Neoxanthin | 146.00 | 0.01 | 0.01 | 0.00 | 0.05 |
| Neo-QA | 206.00 | 1.03 | 0.18 | 1.00 | 2.00 |
| Prasinoxanthin | 159.00 | 0.02 | 0.03 | 0.00 | 0.15 |
| Pras-QA | 206.00 | 1.77 | 0.42 | 1.00 | 2.00 |
| Violaxanthin | 152.00 | 0.01 | 0.01 | 0.00 | 0.05 |
| Viola-QA | 206.00 | 1.04 | 0.19 | 1.00 | 2.00 |
| 19'-Hexanoyloxyfucoxanthin | 203.00 | 0.01 | 0.01 | 0.00 | 0.03 |
| Hex-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Micromonal | 108.00 | 0.01 | 0.01 | 0.00 | 0.03 |
| micral-QA | 206.00 | 2.05 | 1.00 | 1.00 | 3.00 |
| Diadinoxanthin | 206.00 | 0.03 | 0.04 | 0.00 | 0.25 |
| Diadino-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Antheraxanthin | 64.00 | 0.01 | 0.01 | 0.00 | 0.05 |
| Anthera-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Alloxanthin | 205.00 | 0.00 | 0.00 | 0.00 | 0.02 |
| Allo-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Diatoxanthin | 142.00 | 0.00 | 0.00 | 0.00 | 0.03 |
| Diato-QA | 206.00 | 1.01 | 0.12 | 1.00 | 2.00 |
| Zeaxanthin | 178.00 | 0.00 | 0.00 | 0.00 | 0.02 |
| Zea-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Lutein | 73.00 | 0.00 | 0.01 | 0.00 | 0.02 |
| Lut-QA | 206.00 | 1.02 | 0.15 | 1.00 | 2.00 |
| Bchla-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Chlorophyll b | 206.00 | 0.05 | 0.07 | 0.00 | 0.34 |
| Chlb-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| DVChla-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| chlorophyll_a | 206.00 | 0.65 | 0.90 | 0.02 | 5.13 |
| Chla-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Total Chlorophyll a | 206.00 | 0.65 | 0.90 | 0.02 | 5.13 |
| Tchla-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Phaeophytin a | 206.00 | 0.02 | 0.02 | 0.00 | 0.08 |
| Phytna-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Carotene-like (prasinophyte) | 44.00 | 0.01 | 0.01 | 0.00 | 0.03 |
| caro-like-QA | 206.00 | 1.43 | 0.82 | 1.00 | 3.00 |
| Sum Carotenes | 206.00 | 0.01 | 0.02 | 0.00 | 0.07 |
| Tcar-QA | 206.00 | 1.00 | 0.00 | 1.00 | 1.00 |
| Observations | 206.00 | 0.00 | 0.00 | 0.00 | 0.00 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Nutrients
ge_nutrients <- read_excel("../metadata/Nutrients Data_base_Ice_Camp_2016-nutrient_WC.xlsx", sheet = "nutrients", skip = 11) %>%
mutate(depth_m_char = as.character(depth_m),
date=as_date(date))
print(summarytools::descr(ge_nutrients, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| julian_day | 248.00 | 162.56 | 23.38 | 120.00 | 204.00 |
| depth_m | 247.00 | 36.14 | 67.31 | 0.50 | 350.00 |
| Si_GFF | 246.00 | 6.80 | 3.27 | 1.37 | 21.18 |
| Si_Swinnex | 214.00 | 6.68 | 3.34 | 1.05 | 21.12 |
| NO2_GFF | 246.00 | 0.10 | 0.06 | 0.00 | 0.27 |
| NO2_Swinnex | 216.00 | 0.09 | 0.06 | 0.01 | 0.51 |
| PO4_GFF | 246.00 | 0.85 | 0.18 | 0.21 | 1.42 |
| PO4_Swinnex | 214.00 | 0.84 | 0.19 | 0.21 | 1.44 |
| NO3_GFF | 245.00 | 4.67 | 3.18 | 0.00 | 17.23 |
| NO3_Swinnex | 214.00 | 4.48 | 3.18 | 0.00 | 17.12 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Ice Camp Water
Flow cytometry
Flow cytometry summary
ge_fcm_ic <- filter (ge_fcm, (operation=="Ice camp")
& (sample_type=="water")
& (depth_level != "underice")
& !(depth_m %in% c(0,8,14,18,65,100,200,350)))
print(summarytools::descr(ge_fcm_ic, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| year | 353.00 | 2015.47 | 0.50 | 2015.00 | 2016.00 |
| julian_day | 353.00 | 153.44 | 25.57 | 91.00 | 200.00 |
| leg | 188.00 | 2.80 | 0.91 | 1.00 | 4.00 |
| lat_deg | 353.00 | 67.00 | 0.00 | 67.00 | 67.00 |
| lat_min | 353.00 | 28.78 | 0.00 | 28.77 | 28.78 |
| long_deg | 353.00 | 63.00 | 0.00 | 63.00 | 63.00 |
| long_min | 353.00 | 47.39 | 0.01 | 47.37 | 47.40 |
| ctd | 0.00 | Inf | -Inf | ||
| depth_m | 353.00 | 19.76 | 18.62 | 1.50 | 60.00 |
| fsw_added_mL | 0.00 | Inf | -Inf | ||
| total_volume_after_melting_mL | 0.00 | Inf | -Inf | ||
| Syn_mL | 0.00 | Inf | -Inf | ||
| Pico_mL | 351.00 | 3813.26 | 8402.55 | 0.00 | 56386.00 |
| Nano_mL | 351.00 | 727.89 | 1216.64 | 17.00 | 6184.00 |
| Crypto_mL | 350.00 | 0.65 | 3.80 | 0.00 | 39.00 |
| Crypto_FSC | 18.00 | 2587.61 | 3157.74 | 24.48 | 11527.57 |
| Crypto_SSC | 18.00 | 278.82 | 277.26 | 11.88 | 774.70 |
| Crypto_PE | 18.00 | 15.98 | 13.32 | 2.50 | 45.13 |
| Crypto_Chl | 18.00 | 2431.32 | 1279.27 | 768.91 | 5832.22 |
| HBact_mL | 350.00 | 207034.23 | 113430.63 | 35619.00 | 980818.97 |
| LBact_mL | 350.00 | 98375.41 | 50835.77 | 0.00 | 311452.99 |
| Bact_mL | 350.00 | 305409.64 | 149700.07 | 63612.07 | 1180948.28 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Cell vs Date (Nano-eukaryotes)
cell_limits <- cell_limits_nano
for (one_year in c(2015,2016)) {
if (one_year == 2015) {xmin=as.Date("2015-04-01"); xmax=as.Date("2015-07-20")}
else {xmin=as.Date("2016-04-01"); xmax=as.Date("2016-07-20")}
plot1<-ggplot(filter(ge_fcm_ic,year==one_year),
aes(x=date, y=Nano_mL, shape=depth_m_char, linetype=depth_m_char, color=depth_m_char)) +
geom_line (size=0.8) + geom_point(size = 4) +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
legend.title=element_text(size=scaling_factor),
legend.key=element_blank(),
axis.title = element_text(size=scaling_factor),
legend.text=element_text(size=scaling_factor),
legend.key.height = unit(1, "cm"),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal") +
labs(x = "Date", y = cell_label, title = str_c("Nano-eukaryotes - ", one_year )) +
scale_x_date(limits=c(xmin,xmax), date_breaks = "1 month", date_minor_breaks = "1 week", date_labels = "%d/%m/%y") +
scale_y_log10(minor_breaks=waiver(), limits=cell_limits) +
annotation_logticks() +
scale_color_manual(values=depth_color) +
scale_shape_manual(values=depth_shape) +
scale_linetype_manual(values=depth_linetype)
print(plot1)
}Contour plot 2016
- Perform interpolation of the data
- Package :
fields - https://www.rdocumentation.org/packages/fields/versions/9.6/topics/Krig
- Two methods
- Krige
- TPS
- Package :
- Use the package
rasterto set a grid and interpolate over the grid
To be done…
* Restrict the raster to the sampled points (cf. fields).
Filter the flow cytometry data and prepare data for the fitting
ge_fcm_ic_pico <- ge_fcm_ic %>%
filter(!is.na(Pico_mL) & (year==2016) ) %>%
mutate(day_julian = yday(date))
print(summarytools::descr(ge_fcm_ic_pico, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| year | 165.00 | 2016.00 | 0.00 | 2016.00 | 2016.00 |
| julian_day | 165.00 | 162.33 | 22.30 | 125.00 | 200.00 |
| leg | 0.00 | Inf | -Inf | ||
| lat_deg | 165.00 | 67.00 | 0.00 | 67.00 | 67.00 |
| lat_min | 165.00 | 28.78 | 0.00 | 28.78 | 28.78 |
| long_deg | 165.00 | 63.00 | 0.00 | 63.00 | 63.00 |
| long_min | 165.00 | 47.37 | 0.00 | 47.37 | 47.37 |
| ctd | 0.00 | Inf | -Inf | ||
| depth_m | 165.00 | 17.75 | 16.39 | 1.50 | 60.00 |
| fsw_added_mL | 0.00 | Inf | -Inf | ||
| total_volume_after_melting_mL | 0.00 | Inf | -Inf | ||
| Syn_mL | 0.00 | Inf | -Inf | ||
| Pico_mL | 165.00 | 5987.30 | 10968.52 | 0.00 | 56386.00 |
| Nano_mL | 165.00 | 1028.97 | 1415.22 | 18.00 | 5351.00 |
| Crypto_mL | 165.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| Crypto_FSC | 0.00 | Inf | -Inf | ||
| Crypto_SSC | 0.00 | Inf | -Inf | ||
| Crypto_PE | 0.00 | Inf | -Inf | ||
| Crypto_Chl | 0.00 | Inf | -Inf | ||
| HBact_mL | 165.00 | 230488.91 | 145445.01 | 121770.00 | 980818.97 |
| LBact_mL | 165.00 | 127939.31 | 56251.47 | 56715.00 | 311452.99 |
| Bact_mL | 165.00 | 358428.22 | 183673.27 | 200811.00 | 1180948.28 |
| day_julian | 165.00 | 162.33 | 22.30 | 125.00 | 200.00 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Compute limits and set up raster grid
one_year <- 2016
if (one_year == 2016) {
xmin_gg=as.Date("2016-05-01")
xmax_gg=as.Date("2016-07-20")}
xmin <- min(ge_fcm_ic_pico$day_julian)- 2
xmax <- max(ge_fcm_ic_pico$day_julian) + 2
ymax <- 60 + 2
ymin <- 1.5 - 1.5
# Create binding polygon
x_coord <- c(xmin,
xmin,
176,
xmax,
xmax,
xmin)
y_coord <- c(ymin,
45,
ymax ,
ymax ,
ymin,
ymin)
polygon <- cbind(x_coord, y_coord)
polygon <- sp::Polygon(polygon)
polygons = sp::SpatialPolygons(list(sp::Polygons(list(polygon), "s1")))
# plot(polygons)
# Create grid
gridint <- 4 # Multiplyong factor to increase the resolution of the grid
gridx <- (xmax-xmin + 1)*gridint
gridy <- (ymax-ymin +1 )*gridint
grid <- raster::raster(nrows= gridy, ncols=gridx,
xmn=xmin,
xmx=xmax,
ymn=ymin, ymx=ymax)Krig fitting
- theta parameter allows to fit the degree of smoothing
Fits a surface to irregularly spaced data. The Kriging model assumes that the unknown function is a realization of a Gaussian random spatial processes. The assumed model is additive Y = P(x) + Z(X) + e, where P is a low order polynomial and Z is a mean zero, Gaussian stochastic process with a covariance that is unknown up to a scale constant. The main advantages of this function are the flexibility in specifying the covariance as an R language function and also the supporting functions plot, predict, predictSE, surface for subsequent analysis. Krig also supports a correlation model where the mean and marginal variances are supplied.
Warning: Grid searches over lambda (nugget and sill variances) with minima at the endpoints: (REML) Restricted maximum likelihood minimum at right endpoint lambda = 0.001249339 (eff. df= 156.75 )
# interpolate to the raster grid
grid_krig <- raster::interpolate(grid, fit_krig)
# Mask the grid
grid_krig <- raster::mask(x=grid_krig, mask=polygons)
# Plot the interpolation
raster::plot(grid_krig)# Transform to data frame for ggplot
val <- data.frame(Pico_mL_fit = raster::getValues(grid_krig))
xy <- as.data.frame(raster::xyFromCell(grid_krig,1:raster::ncell(grid_krig)))
grid_pico_krig <- bind_cols(xy,val) %>%
mutate(date=as_date(x, origin="2016-01-01"),
Pico_mL_fit = if_else(Pico_mL_fit <0,0,Pico_mL_fit) ) %>%
rename(depth_m=y) %>%
filter(!is.na(Pico_mL_fit))
print(summarytools::descr(grid_pico_krig, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| x | 73224.00 | 164.71 | 22.45 | 123.12 | 201.88 |
| depth_m | 73224.00 | 28.43 | 16.72 | 0.12 | 61.88 |
| Pico_mL_fit | 73224.00 | 4744.64 | 8136.13 | 0.00 | 55328.89 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
# Plot with ggplot
ggplot(grid_pico_krig, aes(x=date, y=depth_m)) +
geom_raster(mapping=aes(fill = Pico_mL_fit)) +
geom_contour(data = grid_pico_krig, mapping = aes(z=Pico_mL_fit),
breaks = c(2500,5000, 7500, seq(10000, 50000,10000))) +
# scale_fill_viridis_c(option="plasma", alpha=1) +
# scale_fill_gradient2(low = "blue", high = "red", midpoint=25000) +
scale_fill_distiller(palette = "Spectral") +
# scale_fill_distiller(type = "div", palette = "RdYlBu", direction = -1) +
# scale_fill_gradientn( colours = terrain.colors(15),
# breaks = c(100,1000, 10000, 20000)) +
scale_x_date(limits=c(xmin_gg,xmax_gg),
date_breaks = "1 month",
date_minor_breaks = "1 week",
date_labels = "%d/%m/%y") +
scale_y_reverse() +
geom_point(data=ge_fcm_ic_pico,
mapping=aes(x=date, y=depth_m), size=0.5, color="white" ) +
ggtitle(" Krig - Pico contours = 2500, 5000, 7500, 10000, 20000, 30000,40000, 50000") +
xlab("Date") + ylab("Depth (m)") +
theme(panel.border = element_rect(colour = "black") ) +
theme_bw(scaling_factor) TPS fitting
Thin plate spline regression
Fits a thin plate spline surface to irregularly spaced data. The smoothing parameter is chosen by generalized cross-validation. The assumed model is additive Y = f(X) +e where f(X) is a d dimensional surface. This function also works for just a single dimension and is a special case of a spatial process estimate (Kriging). A “fast” version of this function uses a compactly supported Wendland covariance and computes the estimate for a fixed smoothing parameter.
Warning: Grid searches over lambda (nugget and sill variances) with minima at the endpoints: (GCV) Generalized Cross-Validation minimum at right endpoint lambda = 2.474393e-06 (eff. df= 156.75 )
grid_tps <- raster::interpolate(grid, fit_tps)
# Mask the grid
grid_tps <- raster::mask(x=grid_tps, mask=polygons)
raster::plot(grid_tps)val <- data.frame(Pico_mL_fit = raster::getValues(grid_tps))
xy <- as.data.frame(raster::xyFromCell(grid_tps,1:raster::ncell(grid_tps)))
grid_pico_tps <- bind_cols(xy,val) %>%
mutate(date=as_date(x, origin="2016-01-01"),
Pico_mL_fit = if_else(Pico_mL_fit <0,0,Pico_mL_fit)) %>%
rename(depth_m=y)%>%
filter(!is.na(Pico_mL_fit))
print(summarytools::descr(grid_pico_tps, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| x | 73224.00 | 164.71 | 22.45 | 123.12 | 201.88 |
| depth_m | 73224.00 | 28.43 | 16.72 | 0.12 | 61.88 |
| Pico_mL_fit | 73224.00 | 4569.89 | 8483.37 | 0.00 | 56515.21 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
# , trans = "log10"
ggplot(grid_pico_tps, aes(x=date, y=depth_m)) +
geom_raster(mapping=aes(fill = Pico_mL_fit)) +
geom_contour(data = grid_pico_tps, mapping = aes(z=Pico_mL_fit),
breaks = c(2500,5000, 7500, seq(10000, 50000,10000))) +
# scale_fill_viridis_c(option="plasma", alpha=1) +
# scale_fill_gradient2(low = "blue", high = "red", midpoint=25000) +
scale_fill_distiller(palette = "Spectral") +
# scale_fill_distiller(type = "div", palette = "RdYlBu", direction = -1) +
# scale_fill_gradientn( colours = terrain.colors(15),
# breaks = c(100,1000, 10000, 20000)) +
scale_x_date(limits=c(xmin_gg,xmax_gg),
date_breaks = "1 month",
date_minor_breaks = "1 week",
date_labels = "%d/%m/%y") +
scale_y_reverse() +
geom_point(data=ge_fcm_ic_pico,
mapping=aes(x=date, y=depth_m), size=0.5, color="white" ) +
ggtitle(" TPS - Pico contours = 2500, 5000, 7500, 10000, 20000, 30000,40000, 50000")+
xlab("Date") + ylab("Depth (m)") +
theme(panel.border = element_rect(colour = "black") ) +
theme_bw(scaling_factor) PAR
PAR vs Date
par_limits = c(0.0004,11)
par_label <- expression(paste("Averaged daily PAR (Einst.",m^-2,".",d^-1,")"))
for (one_year in c(2015, 2016)) {
if (one_year == 2015) {xmin=as.Date("2015-04-01"); xmax=as.Date("2015-07-20")}
else {xmin=as.Date("2016-04-01"); xmax=as.Date("2016-07-20")}
plot1<-ggplot(ge_par_mean,
aes(x=date, y=par_daily_mean, shape=depth_m_char, linetype=depth_m_char, color=depth_m_char)) +
geom_line (size=0.8) + geom_point(size = 4) +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
legend.title=element_text(size=scaling_factor),
legend.key=element_blank(),
axis.title = element_text(size=scaling_factor),
legend.text=element_text(size=scaling_factor),
legend.key.height = unit(1, "cm"),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal"
) +
labs(x = "Date", y = par_label, title = one_year ) +
scale_x_date(limits=c(xmin,xmax), date_breaks = "1 month", date_minor_breaks = "1 week", date_labels = "%d/%m")+
scale_color_manual(values=depth_color) +
scale_shape_manual(values=depth_shape) +
scale_linetype_manual(values=depth_linetype) +
scale_y_continuous (minor_breaks=waiver(), limits=par_limits) +
scale_y_log10 (minor_breaks=waiver(), limits=par_limits) +
annotation_logticks()
print(plot1)
}PAR vs Pico
one_year <- 2016
ge_par_vs_cell <- left_join(ge_fcm_ic,ge_par_mean )
ge_par_vs_cell <- ge_par_vs_cell %>% filter ((year==one_year) & (depth_m = 5) )
plot1<-ggplot(ge_par_vs_cell,
aes(x=par_daily_mean, y=Pico_mL+Nano_mL, shape=depth_m_char, color=depth_m_char)) +
geom_point(size = 4) +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
legend.title=element_text(size=scaling_factor),
legend.key=element_blank(),
axis.title = element_text(size=scaling_factor),
legend.text=element_text(size=scaling_factor),
legend.key.height = unit(1, "cm"),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal"
) +
labs(x = par_label, y = cell_label, title = one_year ) +
scale_x_log10(limits=par_limits)+
scale_color_manual(values=depth_color) +
scale_shape_manual(values=depth_shape) +
scale_y_log10 (minor_breaks=waiver(), limits=cell_limits) +
annotation_logticks()
print(plot1)PAR , Pico and Nano on the same plot for Light stress
one_year <- 2016
ge_fcm_ic_LS <- ge_fcm_ic %>% filter ((year==one_year) & (depth_m == 1.5) )
ge_par_LS <- ge_par_mean %>% filter ((year_utc==one_year) & (depth_m == 1.5) )
x_limits = c(as.Date("2016-05-01"),as.Date("2016-07-20"))
y_limits = c(10, 100000)
y_label = expression(paste("cell.",mL^-1," or Mean daily PAR (Einst.",m^-2,".",d^-1,")*10,000"))
plot1<-ggplot(ge_fcm_ic_LS, aes(x=date)) +
geom_smooth (data=ge_par_LS, aes(x=date, y=par_daily_mean*10000), size=0.8, linetype=2, color="blue") +
geom_point(data=ge_par_LS, aes(x=date, y=par_daily_mean*10000),shape=17, size = 2, color="blue") +
geom_line (aes(y=Pico_mL), size=0.8, linetype=1, color="red") +
geom_point(aes(y=Pico_mL),shape=16, size = 4, color="red") +
geom_line (aes(y=Nano_mL), size=0.8, linetype=1, color="green") +
geom_point(aes(y=Nano_mL),shape=16, size = 4, color="green") +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
axis.title = element_text(size=scaling_factor),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal"
) +
labs(x = "Date", y = y_label, title = one_year ) +
scale_x_date(limits=x_limits, date_breaks = "1 month",
date_minor_breaks = "1 week", date_labels = "%d/%m")+
scale_y_log10 (minor_breaks=waiver(), limits=y_limits) +
annotation_logticks()
print(plot1)Chla vs Date
chla_limits = c(0.01,6)
chla_label <- expression (paste("HPLC chlorophyll ", italic('a '), mu, "g." ,L^-1))
ge_hplc_plot <- filter (ge_hplc, depth_m %in% c(1.5, 5, 10, 20, 40, 60))
for (one_year in c(2016)) {
if (one_year == 2015) {xmin=as.Date("2015-04-01"); xmax=as.Date("2015-07-20")}
else {xmin=as.Date("2016-04-01"); xmax=as.Date("2016-07-20")}
plot1<-ggplot(ge_hplc_plot,
aes(x=date, y=chlorophyll_a, shape=depth_m_char, linetype=depth_m_char, color=depth_m_char)) +
geom_line (size=0.8) + geom_point(size = 4) +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
legend.title=element_text(size=scaling_factor),
legend.key=element_blank(),
axis.title = element_text(size=scaling_factor),
legend.text=element_text(size=scaling_factor),
legend.key.height = unit(1, "cm"),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal"
) +
labs(x = "Date", y = chla_label, title = one_year ) +
scale_x_date(limits=c(xmin,xmax), date_breaks = "1 month", date_minor_breaks = "1 week", date_labels = "%d/%m") +
scale_y_log10(minor_breaks=waiver(), limits=chla_limits) +
annotation_logticks() +
scale_color_manual(values=depth_color) +
scale_shape_manual(values=depth_shape) +
scale_linetype_manual(values=depth_linetype)
print(plot1)
}Nutrients vs Julian day
N03_limits = c(0,15)
NO3_label <- expression (paste("NO3 ", mu, "M." ,L^-1))
y_limits <- N03_limits
ge_plot <- filter (ge_nutrients, depth_m %in% c(1.5, 5, 10, 20, 40, 60))
for (one_year in c(2016)) {
if (one_year == 2015) {xmin=as.Date("2015-04-01"); xmax=as.Date("2015-07-20")}
else {xmin=as.Date("2016-04-01"); xmax=as.Date("2016-07-20")}
plot1<-ggplot(ge_plot,
aes(x=date, y=NO3_GFF, shape=depth_m_char, linetype=depth_m_char, color=depth_m_char)) +
geom_line (size=0.8) + geom_point(size = 4) +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
legend.title=element_text(size=scaling_factor),
legend.key=element_blank(),
axis.title = element_text(size=scaling_factor),
legend.text=element_text(size=scaling_factor),
legend.key.height = unit(1, "cm"),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal"
) +
labs(x = "Date", y = y_label, title = one_year ) +
scale_x_date(limits=c(xmin,xmax), date_breaks = "1 month", date_minor_breaks = "1 week", date_labels = "%d/%m") +
scale_y_continuous(minor_breaks=waiver(), limits=y_limits) +
scale_color_manual(values=depth_color) +
scale_shape_manual(values=depth_shape) +
scale_linetype_manual(values=depth_linetype)
print(plot1)
} ggplot(ge_plot, aes(x=NO3_GFF, y=Si_GFF)) +
geom_point() +
geom_smooth(method="lm",show.legend = TRUE)(Intercept) Si_GFF -2.603110 1.101407
Ice Camp - Ice
Flow cytometry
Summary
ge_fcm_ic_ice <- filter (ge_fcm, (operation=="Ice camp")
& (sample_type=="ice"))
print(summarytools::descr(ge_fcm_ic_ice, stats = c("n.valid", "mean", "sd", "min", "max"), transpose = TRUE,
omit.headings = TRUE, style = "rmarkdown"), method="render")| N.Valid | Mean | Std.Dev | Min | Max | |
|---|---|---|---|---|---|
| year | 186.00 | 2015.30 | 0.46 | 2015.00 | 2016.00 |
| julian_day | 186.00 | 147.02 | 22.53 | 93.00 | 190.00 |
| leg | 130.00 | 2.72 | 0.83 | 1.00 | 4.00 |
| lat_deg | 186.00 | 67.00 | 0.00 | 67.00 | 67.00 |
| lat_min | 186.00 | 28.78 | 0.00 | 28.77 | 28.78 |
| long_deg | 186.00 | 63.00 | 0.00 | 63.00 | 63.00 |
| long_min | 186.00 | 47.39 | 0.01 | 47.37 | 47.40 |
| ctd | 0.00 | Inf | -Inf | ||
| depth_m | 0.00 | Inf | -Inf | ||
| fsw_added_mL | 186.00 | 5389.25 | 3118.68 | 1500.00 | 12400.00 |
| total_volume_after_melting_mL | 184.00 | 7361.27 | 4054.51 | 2735.00 | 17760.00 |
| Syn_mL | 0.00 | Inf | -Inf | ||
| Pico_mL | 186.00 | 608.72 | 2085.60 | 0.00 | 17916.22 |
| Nano_mL | 186.00 | 29696.27 | 41233.52 | 579.00 | 182466.00 |
| Crypto_mL | 186.00 | 68.84 | 749.54 | 0.00 | 9908.00 |
| Crypto_FSC | 4.00 | 4383.19 | 875.35 | 3396.43 | 5210.69 |
| Crypto_SSC | 4.00 | 522.30 | 93.84 | 391.54 | 603.31 |
| Crypto_PE | 4.00 | 7.08 | 1.26 | 5.71 | 8.31 |
| Crypto_Chl | 4.00 | 4106.10 | 1033.35 | 3008.54 | 5348.08 |
| HBact_mL | 183.00 | 527571.76 | 725262.25 | 0.00 | 4784150.00 |
| LBact_mL | 184.00 | 82956.73 | 156252.13 | 0.00 | 895789.00 |
| Bact_mL | 183.00 | 610981.80 | 699692.41 | 16932.91 | 4784150.00 |
Generated by summarytools 0.8.8 (R version 3.5.2)
2019-02-11
Cell vs Julian day
cell_limits_phyto = c(1000, 200000)
cell_limits_bact = c(10000, 5000000)
cell_limits <- cell_limits_bact
cell_limits <- cell_limits_phyto
for (one_year in c(2015,2016)) {
if (one_year == 2015) {xmin=as.Date("2015-04-01"); xmax=as.Date("2015-07-20")}
else {xmin=as.Date("2016-04-01"); xmax=as.Date("2016-07-20")}
plot1<-ggplot(filter(ge_fcm_ic_ice,year==one_year),
aes(x=date, y=Pico_mL + Nano_mL, shape=depth_level, linetype=depth_level, color=depth_level)) +
geom_line (size=0.8) + geom_point(size = 4) +
theme_bw(scaling_factor) +
theme(panel.border = element_rect(colour = "black"),
axis.line = element_line(colour = "black") ,
legend.title=element_text(size=scaling_factor),
legend.key=element_blank(),
axis.title = element_text(size=scaling_factor),
legend.text=element_text(size=scaling_factor),
legend.key.height = unit(1, "cm"),
axis.text = element_text(size=0.8*scaling_factor),
panel.background = element_rect(fill="white"),
legend.position = "top",
legend.box = "horizontal"
) +
labs(x = "Date", y = cell_label, title = one_year ) +
scale_x_date(limits=c(xmin,xmax), date_breaks = "1 month", date_minor_breaks = "1 week", date_labels = "%d/%m") +
scale_y_log10(minor_breaks=waiver(), limits=cell_limits) +
annotation_logticks()
print(plot1)
}