Chapter 8 Journal

Daily lab notes

library(ggplot2)
library(tidyverse)
## ── Attaching packages ──────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ tibble  2.1.3     ✓ dplyr   0.8.3
## ✓ tidyr   1.0.0     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.4.0
## ✓ purrr   0.3.3
## ── Conflicts ─────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
## 
##     date
library(sp)
library(leaflet)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(scales)
## 
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
## 
##     discard
## The following object is masked from 'package:readr':
## 
##     col_factor
library(ggpubr)
## Loading required package: magrittr
## 
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
## 
##     set_names
## The following object is masked from 'package:tidyr':
## 
##     extract

8.1 4-12-2018

8.1.1 ekoseminar

Urban ecosystems are undergoing evolution at a much faster pace than one would imagine. Thinking about mutation which introduce allele frequency key to heritable diversity ?

8.1.2 meeting with jhrl

Certain species do flower early - confirmed by JHRL. The poster we presented does make sense.

8.1.3 ekoclimate

The energy budget of the area increases if the type of the cover changes, i.e if it changes from deciduous forest to crop/grassland then the net Long Wave radiation(flux?) increases. Long wave is the one that is reflected, so the area with a grass will absorb more heat through the day , and emilt radiation during the night? (More cooling ?). So, should we see more diurnal variation in crop/grasslands than forests ?. How should one charaterize the total energy flux on grasslands vs forests?

Shortware is the incoming radiation - i.e having a shorter wavelength, and when is reflected, it becomes long wave radiation. The longwave radiation emitted out is calculated by multipying Stephan Boltzman constant multiplied by epsilion(emissivity) and Temperature^4(Temperature of the object).

8.1.4 trenchR

Thermal conductance wrt to animals define the amount of heat which can escape out of animals. It depends on the difference between the animal and the outside temperature and you multipy by the thickness(lambda) and a proportion of the surface area(true area exposed to solar radiation).

Surace area to calculate the exposure is related to the exposed area - tricky as animals come in all shapes, mostly cylindrical with a sphere head if land based.

8.2 4-13-2018

8.3 4-20-2008

Heat transfer coefficient for Lizards. It is linear with windspeeed, and slope changes when the lizard is parallel or transverse

8.4 4-23-2008

Get diurnal variation across 5 sites at Mt Rainier

#Load a file
Paradise_2017<- read.csv('./data/ParadiseWind_5380_feet_2017.csv')
CampMuir_2017<- read.csv('./data/CampMuir_10110_feet_2017.csv')
Sunriseupper_2017<- read.csv('./data/SunriseUpper_6880_feet_2017.csv')

Paradise_2017$date <- as.Date(Paradise_2017$Date.Time..PST., "%Y-%m-%d")
Paradise_2017$datect <-as.POSIXct(Paradise_2017$Date.Time..PST., "%Y-%m-%d %H:%M",tz = "America/Los_Angeles")
#MtRainier_AE10A1_1718$timect <- as.POSIXct(MtRainier_AE10A1_1718$datetime, format="%m/%d/%y #%I:%M:%S %p",tz="America/Los_Angeles")
Paradise_2017$hr <-strftime(Paradise_2017$Date.Time..PST.,'%H')
Paradise_2017$min <-strftime(Paradise_2017$Date.Time..PST.,'%M')
Paradise_2017$month <- strftime(Paradise_2017$Date.Time..PST.,'%m')
Paradise_2017$monthasn <- as.numeric(Paradise_2017$month)
Paradise_2017$day <- day(Paradise_2017$datect)
Paradise_2017$year <- year(Paradise_2017$datect)
Paradise_2017$hour <- hour(Paradise_2017$datect)
CampMuir_2017$date <- as.Date(CampMuir_2017$Date.Time..PST., "%Y-%m-%d")
CampMuir_2017$hr <-strftime(CampMuir_2017$Date.Time..PST.,'%H')
CampMuir_2017$min <-strftime(CampMuir_2017$Date.Time..PST.,'%M')
CampMuir_2017$month <-strftime(CampMuir_2017$Date.Time..PST.,'%m')
Sunriseupper_2017$date <- as.Date(Sunriseupper_2017$Date.Time..PST., "%Y-%m-%d")
Sunriseupper_2017$hr <-strftime(Sunriseupper_2017$Date.Time..PST.,'%H')
Sunriseupper_2017$min <-strftime(Sunriseupper_2017$Date.Time..PST.,'%M')
Sunriseupper_2017$month <- strftime(Sunriseupper_2017$Date.Time..PST.,'%m')


str(Paradise_2017)
## 'data.frame':    8760 obs. of  16 variables:
##  $ Date.Time..PST.         : Factor w/ 8760 levels "2017-01-01 00:00",..: 8760 8759 8758 8757 8756 8755 8754 8753 8752 8751 ...
##  $ Battery.Voltage..v.     : num  13 13 12.4 12.9 12.9 ...
##  $ Wind.Speed.Minimum..mph.: num  0 0 0 0.71 1.42 2.13 0 0 0 0.71 ...
##  $ Wind.Speed.Average..mph.: num  1.68 1.68 1.6 2.23 2.76 ...
##  $ Wind.Speed.Maximum..mph.: num  3.55 3.55 3.55 3.55 3.55 4.26 3.55 3.55 4.26 6.39 ...
##  $ Wind.Direction..deg..   : num  21.04 6.89 19.41 26.65 16.74 ...
##  $ Solar.Pyranometer..W.m2.: num  0 0 0 0 0 ...
##  $ date                    : Date, format: "2017-12-31" "2017-12-31" ...
##  $ datect                  : POSIXct, format: "2017-12-31 23:00:00" "2017-12-31 22:00:00" ...
##  $ hr                      : chr  "00" "00" "00" "00" ...
##  $ min                     : chr  "00" "00" "00" "00" ...
##  $ month                   : chr  "12" "12" "12" "12" ...
##  $ monthasn                : num  12 12 12 12 12 12 12 12 12 12 ...
##  $ day                     : int  31 31 31 31 31 31 31 31 31 31 ...
##  $ year                    : num  2017 2017 2017 2017 2017 ...
##  $ hour                    : int  23 22 21 20 19 18 17 16 15 14 ...
Paradise_2017 %>% ggplot(aes(date,Solar.Pyranometer..W.m2.)) +geom_point() +  stat_smooth(se = TRUE) + ggtitle("Solar Radiation at Paradise(5380 ft)")+ xlab("Date") + ylab("Solar Irradiance(W/m^2)")
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

CampMuir_2017 %>% ggplot(aes(date,Solar.Pyranometer..W.m2.)) + geom_point() +  stat_smooth(se = TRUE) + ggtitle("Solar Radiation at CampMuir(10110 ft)")+ xlab("Date") + ylab("Solar Irradiance(W/m^2)")
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

Sunriseupper_2017 %>% ggplot(aes(date,Solar.Pyranometer..W.m2.)) + geom_point() +  stat_smooth(se = TRUE) + ggtitle("Solar Radiation at Sunrise-Upper(6880 ft)")+ xlab("Date") + ylab("Solar Irradiance(W/m^2)")
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

Feedback

Better to do it houry so that daily patterns do confound it. So, now we have hourly solar radiation across all the sites.

## 4-28-2008

#

ggplot(Paradise_2017, aes(hr,Solar.Pyranometer..W.m2.))+
  stat_boxplot( aes(hr,Solar.Pyranometer..W.m2.), 
    geom='errorbar', linetype=1, width=0.5)+  #whiskers
  geom_boxplot( aes(hr,Solar.Pyranometer..W.m2.),outlier.shape=1) +    
  stat_summary(fun.y=mean, geom="point", size=2) + 
  stat_summary(fun.data = mean_se, geom = "errorbar")

 annotate("text",x=20,y=55,label="wassup!" , family="xkcd"
           )
## mapping: x = ~x, y = ~y 
## geom_text: na.rm = FALSE
## stat_identity: na.rm = FALSE
## position_identity
## 4-28-2008

#
ggplot(CampMuir_2017, aes(hr,Solar.Pyranometer..W.m2.))+
  stat_boxplot( aes(hr,Solar.Pyranometer..W.m2.), 
    geom='errorbar', linetype=1, width=0.5)+  #whiskers
  geom_boxplot( aes(hr,Solar.Pyranometer..W.m2.),outlier.shape=1) +    
  stat_summary(fun.y=mean, geom="point", size=2) + 
  stat_summary(fun.data = mean_se, geom = "errorbar")

It does confirm that higher the sites, the solar radiation is slightly higher.

8.5 4-29-2008

Lets assume that solar radiation is infact more relevant at higher elevations, so snowmelt would be at a faster rate at higher elevations. Is snowmelt even at all the elevations ? Intuitively no as we often see that peaks hold-on to snow longer. (Just aside discussion).

Here, the goal is to see if there is a difference in radiation recieved at the sites. Reasoning being if the solar radiation recorded is different, that would mean differemt growing degree days. Lets look for June, July and August(JJA Summer). Summer solstice - June 21st.

## 4-29-2008
library(gridExtra)
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
#



g1 <- Paradise_2017 %>%  filter(month %in% c('06','07','08')) %>% ggplot( aes(hr,Solar.Pyranometer..W.m2.)) + geom_boxplot() +
    stat_summary(colour = "red",size=0.5) + theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Hour") + ggtitle("Paradise(5k ft) ")


g2 <- CampMuir_2017 %>%  filter(month %in% c('06','07','08')) %>% ggplot( aes(hr,Solar.Pyranometer..W.m2.)) + geom_boxplot() +
    stat_summary(colour = "red",size=0.5) + theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Hour") + ggtitle("Camp Muir(10k ft) ")


grid.arrange(g1, g2,ncol=2, top = "JJA - Mean Hourly Solar Radiation at 2 elevations")
## No summary function supplied, defaulting to `mean_se()
## No summary function supplied, defaulting to `mean_se()

## 4-29-2008
library(gridExtra)
#



g3 <- Paradise_2017 %>%  filter(month %in% c('06')) %>% ggplot( aes(hr,Solar.Pyranometer..W.m2.)) + geom_boxplot() +
    theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Hour") + ggtitle("Paradise(5k ft) ")


g4 <- CampMuir_2017 %>%  filter(month %in% c('06')) %>% ggplot( aes(hr,Solar.Pyranometer..W.m2.)) + geom_boxplot() +
   theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Hour") + ggtitle("Camp Muir(10k ft) ")


grid.arrange(g3, g4,ncol=2, top = "June - Max Hourly Solar Radiation at 2 elevations")

#ggplotly()

Lets check the daily max for each day in summer(JJA)

## 4-29-2008
library(gridExtra)
#



g5 <- Paradise_2017 %>%  filter(month %in% c('06','07','08')) %>% dplyr::group_by(date) %>%
  dplyr::summarise(maxSol = max(Solar.Pyranometer..W.m2.)) %>%
  ggplot( aes(date,maxSol)) + geom_point() + geom_line() +
    theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Date") + ggtitle("Paradise(5k ft) ")


g6 <- CampMuir_2017 %>%  filter(month %in% c('06','07','08')) %>% dplyr::group_by(date) %>%
  dplyr::summarise(maxSol = max(Solar.Pyranometer..W.m2.)) %>%
  ggplot( aes(date,maxSol)) + geom_point() +  geom_line() +
    theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Date") + ggtitle("Camp Muir(10k ft) ")


grid.arrange(g5, g6,ncol=2, top = "JJA - Daily Max Solar Radiation at 2 elevations")

#ggplotly()

Compare wind and solar at two sites

## 4-29-2008
library(gridExtra)
#



g5 <- Paradise_2017 %>%  filter(month %in% c('06','07','08')) %>% dplyr::group_by(date) %>%
  dplyr::summarise(maxSol = max(Solar.Pyranometer..W.m2.),maxWind = max(Wind.Speed.Average..mph.)) %>%
  ggplot() + geom_line(aes(date,log(maxSol),color='log Solar(W/m^2)') ) + geom_line(aes(date,maxWind,color='Wind(m/h)')) +
    theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Date") + ylab("") + ggtitle("Paradise(5k ft) ") + scale_color_discrete(name="Variable")


g6 <- CampMuir_2017 %>%  filter(month %in% c('06','07','08')) %>% dplyr::group_by(date) %>%
  dplyr::summarise(maxSol = max(Solar.Pyranometer..W.m2.),maxWind = max(Wind.Speed.Average..mph.)) %>%
  ggplot() + geom_line(aes(date,log(maxSol),color='log Solar(W/m^2)') ) + geom_line(aes(date,maxWind,color='Wind(m/h)')) +
    theme_classic() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) +     xlab("Date") + ylab("") + ggtitle("Camp Muir(10k ft) ") + scale_color_discrete(name="Variable")


grid.arrange(g5, g6,ncol=2, top = "JJA - Daily Max Solar and Max Wind(Avg)  at 2 elevations")

#ggplotly()

8.6 5-21-2018

Wrangle the microclimate data

## 5-21-2018
mclim_2018<- read.csv('./data/DATALOG.5.15.2018.csv')

#ggplotly()

Look at the data

## 5-21-2018
str(mclim_2018)
## 'data.frame':    326489 obs. of  4 variables:
##  $ X2018.5.8.16.35.01: Factor w/ 73277 levels "2018/5/10 0:00:03",..: 60336 60336 60336 60336 60336 60337 60338 60338 60338 60338 ...
##  $ X28CF6F0400008059 : Factor w/ 6 levels "287F5B04000080C5",..: 1 5 6 4 3 2 1 5 6 4 ...
##  $ X14.31            : num  14.8 14.4 14.8 14.3 14.1 ...
##  $ X4.14             : num  4.14 4.14 4.14 4.14 4.14 4.14 4.14 4.14 4.14 4.14 ...
names(mclim_2018) <- c('time','nodeid','temp','batt')
mclim_2018$time <- as.POSIXct(mclim_2018$time, "%Y/%m/%d %H:%M:%S")

Add Hour, month and day

## 5-21-2018
mclim_2018$hr <- hour(mclim_2018$time)
mclim_2018$day <- day(mclim_2018$time)
mclim_2018$month<- month(mclim_2018$time)

Basic plot (May 10th)

## 5-21-2018
mclim_2018 %>% filter(day(time) %in% '10') %>%
ggplot( aes(time,temp,color = nodeid)) + geom_line() + theme_minimal()

#ggplotly()

Whole week

## 5-21-2018
mclim_2018 %>% 
ggplot( aes(time,temp,color = nodeid)) + geom_line()

#ggplotly()

Add heights (Roghly .25 m apart)

mclim_2018$height <- 0

mclim_2018[mclim_2018$nodeid=='28FF80E24316043F' ,]$height <- 0.25
mclim_2018[mclim_2018$nodeid=='28FF7331441603A7' ,]$height <- 0.5
mclim_2018[mclim_2018$nodeid=='287F5B04000080C5' ,]$height <- 0.75
mclim_2018[mclim_2018$nodeid=='28FFB1C2501604A8' ,]$height <- 1
mclim_2018[mclim_2018$nodeid=='28CF6F0400008059' ,]$height <-1.25
mclim_2018[mclim_2018$nodeid=='28FF5B69501604F2' ,]$height <- 1.5

Basic plot (May 10th) - By height

## 5-21-2018
mclim_2018 %>% filter(day(time) %in% '10') %>%
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal()

#ggplotly()

Add simulated wind profile

mclim_2018$ws <- 0
mclim_2018[mclim_2018$nodeid=='287F5B04000080C5',]$ws <- 4.34
mclim_2018[mclim_2018$nodeid=='28FF80E24316043F' ,]$ws <- 2.02
mclim_2018[mclim_2018$nodeid=='28FFB1C2501604A8' ,]$ws <- 5.20
mclim_2018[mclim_2018$nodeid=='28FF7331441603A7' ,]$ws <- 3.45
mclim_2018[mclim_2018$nodeid=='28FF5B69501604F2' ,]$ws <- 7.56
mclim_2018[mclim_2018$nodeid=='28CF6F0400008059' ,]$ws <-6.54

Redo the plot by height

## 5-21-2018
mclim_2018 %>% filter(day(time) %in% '10', height %in% c(0.25,1)) %>%
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal()

Redo the plot by height for Wind Speed

## 5-21-2018
mclim_2018 %>% filter(day(time) %in% '10', height %in% c(0.25,0.5,0.75,1)) %>%
ggplot( aes(time,ws,color = factor(height))) + geom_line() + theme_minimal()

Calculate (Wind speed at any height = U_star/K*log(Z/Z0))

Calculate zero plane displcement

#TODO - Do by each hour
zeroDM<- lm(log(mclim_2018$height) ~ mclim_2018$ws)
zD <- exp(zeroDM$coeff[1])
#.16

Calculate roughness and Z*

#With zero plane dispacement
sRM<- lm(mclim_2018$ws ~ log(mclim_2018$height-zD))

srIntercept <- sRM$coeff[1]
srSlope <- sRM$coeff[2]

K=0.4 # Von Karman constant

z0<-  exp(-srIntercept/srSlope) #0.04
U_star<-  srSlope*K

Repeat this for each site ## 7-21-2018

#With zero plane dispacement
library(rgdal) #this package is necessary to import the .asc file in R.
## rgdal: version: 1.4-4, (SVN revision 833)
##  Geospatial Data Abstraction Library extensions to R successfully loaded
##  Loaded GDAL runtime: GDAL 2.1.3, released 2017/20/01
##  Path to GDAL shared files: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rgdal/gdal
##  GDAL binary built with GEOS: FALSE 
##  Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
##  Path to PROJ.4 shared files: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rgdal/proj
##  Linking to sp version: 1.3-1
library(rasterVis) #this package has the function which allows the 3D plotting.
## Loading required package: raster
## 
## Attaching package: 'raster'
## The following object is masked from 'package:ggpubr':
## 
##     rotate
## The following object is masked from 'package:magrittr':
## 
##     extract
## The following object is masked from 'package:plotly':
## 
##     select
## The following object is masked from 'package:dplyr':
## 
##     select
## The following object is masked from 'package:tidyr':
## 
##     extract
## Loading required package: lattice
## Loading required package: latticeExtra
## Loading required package: RColorBrewer
## 
## Attaching package: 'latticeExtra'
## The following object is masked from 'package:ggplot2':
## 
##     layer
#set the path where the file is, and import it into R.
r= raster(paste("./data/rainier_2012_dtm_5_hs.tif", sep=""))

#visualize the raster in 3D
plot(r,lit=TRUE)

Combining multiple rasters into one single file.

fs <- list.files(path="./data", pattern = "rainier_2007_*", full.names = TRUE)
library(raster)

r1 <- raster(fs[1])
r2 <- raster(fs[2])
r3 <- raster(fs[3])
r4 <- raster(fs[4])
r5 <- raster(fs[5])
r6 <- raster(fs[6])
r7 <- raster(fs[7])
r8 <- raster(fs[8])
r9 <- raster(fs[9])
r10 <- raster(fs[10])
r11 <- raster(fs[11])
r12 <- raster(fs[12])
r13 <- raster(fs[13])
r14 <- raster(fs[14])
r15 <- raster(fs[15])
r16 <- raster(fs[16])
r17 <- raster(fs[17])

# if you have a list of Raster objects, you can use do.call
x <- list(r1, r2, r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17)
names(x)[1:2] <- c('x', 'y')
x$fun <- mean
x$na.rm <- TRUE

#y <- do.call(mosaic, x)

#writeRaster(y, "./data/combined_mtr.TIF")

##7-25-2018

Check the diurnal variation for summer, using Paradise as a proxy

Paradise_2017 %>% group_by(date,month,hr) %>% ggplot(aes(month,Solar.Pyranometer..W.m2.)) + geom_point() 

#.16

Use SNOTEL data from Paradise(Latitude: 46.78 Longitude: -121.74)

Check the diurnal variation for summer, using Paradise as a proxy

Paradise_Snotel_2013<- read.csv('./data/679_STAND_WATERYEAR=2013.csv')
Paradise_Snotel_2013$date <- as.Date(Paradise_Snotel_2013$Date, "%Y-%m-%d")
Paradise_Snotel_2013$month <- strftime(Paradise_Snotel_2013$Date,'%m')

Paradise_Snotel_2012<- read.csv('./data/679_STAND_WATERYEAR=2012.csv')
Paradise_Snotel_2012$date <- as.Date(Paradise_Snotel_2012$Date, "%Y-%m-%d")
Paradise_Snotel_2012$month <- strftime(Paradise_Snotel_2012$Date,'%m')

Paradise_Snotel_2011<- read.csv('./data/679_STAND_WATERYEAR=2011.csv')
Paradise_Snotel_2011$date <- as.Date(Paradise_Snotel_2011$Date, "%Y-%m-%d")
Paradise_Snotel_2011$month <- strftime(Paradise_Snotel_2011$Date,'%m')

Paradise_Snotel_2013 %>% group_by(date,month) %>% mutate(diva=TMAX.D.1..degC.-TMIN.D.1..degC.)%>% ggplot() + geom_line(aes(date,TMIN.D.1..degC.,colour='min'))  +geom_line(aes(date,TMAX.D.1..degC.,colour='max')) +geom_line(aes(date,diva,colour='diurnal variation'))+ theme_minimal()

#.16

Only Summer

Paradise_Snotel_2013 %>% group_by(date,month) %>% filter(as.numeric(month) %in% c(6,7,8)) %>% mutate(diva=TMAX.D.1..degC.-TMIN.D.1..degC.)%>% ggplot() + geom_line(aes(date,TMIN.D.1..degC.,colour='min'))  +geom_line(aes(date,TMAX.D.1..degC.,colour='max'))+geom_line(aes(date,TAVG.D.1..degC.,colour='avg')) +geom_line(aes(date,diva,colour='diurnal variation'))+ theme_minimal() +xlab("Date") + ylab("") + ggtitle("Snotel Paradise - Water year 2013 ") + scale_color_discrete(name="Metric")

#.16

For 2012

Paradise_Snotel_2012 %>% group_by(date,month) %>% filter(as.numeric(month) %in% c(6,7,8) & TMIN.D.1..degC. != -99.9) %>% mutate(diva=TMAX.D.1..degC.-TMIN.D.1..degC.)%>% ggplot() + geom_line(aes(date,TMIN.D.1..degC.,colour='min'))  +geom_line(aes(date,TMAX.D.1..degC.,colour='max'))+geom_line(aes(date,TAVG.D.1..degC.,colour='avg')) +geom_line(aes(date,diva,colour='diurnal variation'))+ theme_minimal() +xlab("Date") + ylab("") + ggtitle("Snotel Paradise - Water year 2012 ") + scale_color_discrete(name="Metric")

#.16

For 2011

Paradise_Snotel_2011 %>% group_by(date,month) %>% filter(as.numeric(month) %in% c(6,7,8)) %>% mutate(diva=TMAX.D.1..degC.-TMIN.D.1..degC.)%>% ggplot() + geom_line(aes(date,TMIN.D.1..degC.,colour='min'))  +geom_line(aes(date,TMAX.D.1..degC.,colour='max'))+geom_line(aes(date,TAVG.D.1..degC.,colour='avg')) +geom_line(aes(date,diva,colour='diurnal variation'))+ theme_minimal() +xlab("Date") + ylab("") + ggtitle("Snotel Paradise - Water year 2011 ") + scale_color_discrete(name="Metric")

#.16

8.7 7-26-2018

Lets look at the diurnal variation for three months, need to switch to NWAC as Snotel does not provide hourly breakdown

Paradise_5400_2017<- read.csv('./data/Paradise_5400_feet_2017.csv')
Paradise_5400_2016<- read.csv('./data/Paradise_5400_feet_2016.csv')
Paradise_5400_2015<- read.csv('./data/Paradise_5400_feet_2015.csv')

Paradise_5400_2017$date <- as.Date(Paradise_5400_2017$Date.Time..PST., "%Y-%m-%d")
Paradise_5400_2017$datetime <- as.Date(Paradise_5400_2017$Date.Time..PST., "%Y-%m-%d %H:%M")
library(lubridate)
library(gridExtra)
Paradise_5400_2017$hr <-lubridate::hour(lubridate::as_datetime(Paradise_5400_2017$Date.Time..PST.))
Paradise_5400_2017$year <-lubridate::year(lubridate::as_datetime(Paradise_5400_2017$Date.Time..PST.))
Paradise_5400_2017$mnth <-lubridate::month(lubridate::as_datetime(Paradise_5400_2017$Date.Time..PST.))
Paradise_5400_2017$min <-lubridate::minute(lubridate::as_datetime(Paradise_5400_2017$Date.Time..PST.))
Paradise_5400_2017$month <- strftime(Paradise_5400_2017$Date.Time..PST.,'%m')
Paradise_5400_2017$day <-strftime(Paradise_5400_2017$Date.Time..PST.,'%d')

Paradise9<- Paradise_5400_2017 %>% group_by(date,month,day,hr) %>% filter(as.numeric(month) %in% c(7,8,9) & as.numeric(day) %in% c(9) ) %>%  ggplot() +  geom_line(aes(as.numeric(hr),Temperature..deg.F.,group=month,color=month)) + theme_minimal() +xlab("Hour") + ylab("Temperature") + ggtitle("Paradise 5400 NWAC - Calendar year 2017  - 9th day") + scale_color_discrete(name="Month")
Paradise16<- Paradise_5400_2017 %>% group_by(date,month,day,hr) %>% filter(as.numeric(month) %in% c(7,8,9) & as.numeric(day) %in% c(16) ) %>%  ggplot() +  geom_line(aes(as.numeric(hr),Temperature..deg.F.,group=month,color=month)) + theme_minimal() +xlab("Hour") + ylab("Temperature") + ggtitle("Paradise 5400 NWAC - Calendar year 2017  - 16th day") + scale_color_discrete(name="Month")
Paradise23<- Paradise_5400_2017 %>% group_by(date,month,day,hr) %>% filter(as.numeric(month) %in% c(7,8,9) & as.numeric(day) %in% c(23) ) %>%  ggplot() +  geom_line(aes(as.numeric(hr),Temperature..deg.F.,group=month,color=month)) + theme_minimal() +xlab("Hour") + ylab("Temperature") + ggtitle("Paradise 5400 NWAC - Calendar year 2017  - 23rd day") + scale_color_discrete(name="Month")

grid.arrange(Paradise9,Paradise16,Paradise23)

Days overlapping eath other

Paradise_5400_2017 %>% group_by(date,month,day,hr) %>% filter(as.numeric(month) %in% c(7,8,9) & as.numeric(day) %in% c(15,16,17,18,19,20) ) %>%  ggplot() +  geom_point(aes(as.numeric(hr),Temperature..deg.F.,shape=day,group=7,color=month)) + theme_minimal() +xlab("Hour") + ylab("Temperature") + ggtitle("Paradise 5400 NWAC - Calendar year 2017  - Days(15-20) ") + scale_color_discrete(name="Month")

Removing symbols, each line representing different day of the month

Paradise_5400_2017 %>% group_by(date,month,day,hr) %>% filter(as.numeric(month) %in% c(7,8,9) & as.numeric(day) %in% c(15,16,17,18,19,20) ) %>% ggplot(aes(x = hr, y = Temperature..deg.F.,color=month)) + geom_line(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("15")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("15")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("15")  ))  +
geom_line(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("16")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("16")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("16")  ))  +
geom_line(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("17")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("17")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("17")  ))  +  
geom_line(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("18")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("18")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("18")  ))  +  
geom_line(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("19")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("19")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("19")  ))  + 
geom_line(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("20")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("20")  ))+ geom_line(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("20")  ))  +    
theme_minimal() + xlab("Hour") + ylab("Temperature") + ggtitle("Paradise 5400 NWAC - Calendar year 2017  - Days(15-18) ") + scale_color_discrete(name="Month")+geom_jitter()

Removing symbols, point plot

Paradise_5400_2017 %>% group_by(date,month,day,hr) %>% filter(as.numeric(month) %in% c(7,8,9) & as.numeric(day) %in% c(15,16,17,18,19,20) ) %>% ggplot(aes(x = hr, y = Temperature..deg.F.,color=month)) + geom_point(data = subset(Paradise_5400_2017,month %in% c("07") & day %in% c("15","16","17","18","19","20")))+ geom_point(data = subset(Paradise_5400_2017,month %in% c("08") & day %in% c("15","16","17","18","19","20")  ))+ geom_point(data = subset(Paradise_5400_2017,month %in% c("09") & day %in% c("15","16","17","18","19","20")  ))  +theme_minimal() +xlab("Hour") + ylab("Temperature") + ggtitle("Paradise 5400 NWAC - Calendar year 2017  - Days(15-18) ") + scale_color_discrete(name="Month")

8.8 8-7-2018

One of the arguments in the boundary layer relevance is that at different heights temperature profile varies. So, the vertically the temperature variation differs, and that is bound to influence physiology of organisms living in that strata.

To highlight the point, we could look at microclimate profiled data

Canopy and surface 3 cm vs 103cm

Load the required files

decombined <- read.csv('./data/decombined-1981.csv')
library(dplyr)
decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(01) & day(datec) > 12 & day(datec) < 20 )  %>%
  dplyr::group_by(month,day,hr) %>% dplyr::summarise(meanST = mean(Tsurface),meanCT = mean(TAH)) %>%
  dplyr::group_by(hr) %>% dplyr::summarise(meanST = mean(meanST),meanCT = mean(meanCT)) %>%
  ggplot() +
  geom_line(aes(hr,meanST-273.5,color='Surface'),se=F)+ geom_line(aes(hr,meanCT-273.5,color='Canopy'),se=F)+
  scale_colour_manual("Temperature at", breaks = c("Surface", "Canopy"), values = c("blue","red")) +
  theme_minimal() + ggtitle("Variation in temperature at different heights")  + xlab("Hour") +
  ylab("Temperature(C)") + labs(colour = "Hour",
                                subtitle="Microclimate impacts at two different heights",caption="Data Source : http://www.microclim.org") 

Seasonal temperatures at two heights

library(dplyr)
decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(06,07,08) )  %>%
  dplyr::group_by(month,day,hr) %>% dplyr::summarise(meanST = mean(Tsurface),meanCT = mean(TAH)) %>%
  group_by(hr) %>% dplyr::summarise(meanST = mean(meanST),meanCT = mean(meanCT)) %>%
  ggplot() +
  geom_line(aes(hr,meanST-273.5,color='Surface'),se=F)+ geom_line(aes(hr,meanCT-273.5,color='Canopy'),se=F)+
  scale_colour_manual("Temperature at", breaks = c("Surface", "Canopy"), values = c("blue","red")) +
  theme_minimal() + ggtitle("Seasonal variation in temperature at different heights")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="Microclimate differences at two different heights",caption="Data Source : http://www.microclim.org") 

Seasonal difference during peak solar time is phonenomenal, there is almost 10 degree difference.

8.9 8-17-2018

Feedback - Ideal would be to show multiple days plotted on the hourly x-axis to show the variation.

Typical weekly summer variation

decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(01) & day(datec) > 12 & day(datec) < 20 )  %>%
  group_by(month,day,hr)  %>%
  ggplot() +
  geom_line(aes(hr,Tsurface-273.5,group=day,color='Surface'),se=F)+ geom_line(aes(hr,TAH-273.5,group=day ,color='Canopy'),se=F)+
  scale_colour_manual("Temperature at", breaks = c("Surface", "Canopy"), values = c("blue","red")) +
  theme_minimal() + ggtitle("Variation in temperature at two different heights")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1/13/81 - 1/19/81",caption="Data Source : http://www.microclim.org") 

Seasonal temperatures at two heights

decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(06,07,08) )  %>%
  group_by(month,day,hr)  %>%
   ggplot() +
  geom_line(aes(hr,Tsurface-273.5,group=day,color='Surface'),se=F)+ geom_line(aes(hr,TAH-273.5,group=day,color='Canopy'),se=F)+
  scale_colour_manual("Temperature at", breaks = c("Surface", "Canopy"), values = c("blue","red")) +
  theme_minimal() + ggtitle("Seasonal variation in temperature at different heights")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="Microclimate differences at two different heights",caption="Data Source : http://www.microclim.org") 

8.10 8-23-2018

Objectives for the day was to have a functional code for CN(Complete Node) and TN(Temperature only node).

KX and AX are here to help me out, just awesome!

We installed one CN with Anemometers, and tested it. The code needed some work, but we were able to bring-up one with four anemometers.

We had three objectives as we were putting the nodes up.

** Have a reliable real-time clock ** Mount the solar radiation sensor on a firm base(there is a bubble to help stablize) ** Have a status indicator to check the activity

8.11 8-24-2018

Few issues overnight.

DS1802B runs on 1-Wire, and on the same bus you can use umpteen number of them. By design, it should have worked, but we had problems with connecting more than four

8.12 9-23-2018

Analysis of data from the first field experiment. Mt Rainier deployment in the forest canopies.

av06_mm <- read_csv('./data/DATALOG-av06-cn.csv')
## Parsed with column specification:
## cols(
##   date = col_character(),
##   temp1 = col_double(),
##   temp2 = col_double(),
##   temp3 = col_double(),
##   temp4 = col_double(),
##   windspeed1 = col_double(),
##   windspeed2 = col_double(),
##   windspeed3 = col_double(),
##   windspeed4 = col_double(),
##   winddirection1 = col_double(),
##   winddirection2 = col_double(),
##   winddirection3 = col_double(),
##   winddirection4 = col_double(),
##   solar = col_double(),
##   battery = col_double()
## )
str(av06_mm)
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 6252 obs. of  15 variables:
##  $ date          : chr  "9/2/18 9:44:7" "9/2/18 9:47:9" "9/2/18 9:50:11" "9/2/18 9:53:12" ...
##  $ temp1         : num  20.9 20.9 20.8 20.8 20.7 ...
##  $ temp2         : num  21.1 21.1 21.1 21.1 20.9 ...
##  $ temp3         : num  21.5 21.4 21.1 21.2 21.2 ...
##  $ temp4         : num  20.8 20.8 20.8 20.8 20.8 ...
##  $ windspeed1    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ windspeed2    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ windspeed3    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ windspeed4    : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ winddirection1: num  1007 1009 1006 1010 1012 ...
##  $ winddirection2: num  953 953 955 953 957 958 953 959 957 959 ...
##  $ winddirection3: num  1004 1007 1004 1007 1008 ...
##  $ winddirection4: num  979 975 976 974 977 976 979 974 973 973 ...
##  $ solar         : num  1022 1022 1021 1022 1023 ...
##  $ battery       : num  4.18 4.18 4.18 4.18 4.18 4.18 4.18 4.18 4.18 4.18 ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   date = col_character(),
##   ..   temp1 = col_double(),
##   ..   temp2 = col_double(),
##   ..   temp3 = col_double(),
##   ..   temp4 = col_double(),
##   ..   windspeed1 = col_double(),
##   ..   windspeed2 = col_double(),
##   ..   windspeed3 = col_double(),
##   ..   windspeed4 = col_double(),
##   ..   winddirection1 = col_double(),
##   ..   winddirection2 = col_double(),
##   ..   winddirection3 = col_double(),
##   ..   winddirection4 = col_double(),
##   ..   solar = col_double(),
##   ..   battery = col_double()
##   .. )

Plot four temperatures

tp <- av06_mm %>% dplyr::mutate(row_no= row_number()) %>% ggplot() +
  geom_line(aes(row_no,temp1,color='red')) + 
  geom_line(aes(row_no,temp2,color='blue')) +
  geom_line(aes(row_no,temp3,color='green')) +
  geom_line(aes(row_no,temp4,color='purple'))

Plot four wind

av06_mm %>% dplyr::mutate(row_no= row_number()) %>% ggplot() +
  geom_point(aes(row_no,windspeed1,color='windspeed1')) + 
  geom_point(aes(row_no,windspeed2,color='windspeed2')) +
  geom_point(aes(row_no,windspeed3,color='windspeed3')) +
  geom_point(aes(row_no,windspeed4,color='windspeed4'))

#ggplotly()

Plot solar

av06_mm %>% dplyr::mutate(row_no= row_number()) %>% ggplot() +
  geom_line(aes(row_no,solar,color='solar')) 

#ggplotly()

Hourly temperature and precipitation (Pardise 5800) (vs Longmire station which is 2760 ft)

#Load a file
Paradise_2018<- read.csv('./data/Paradise_5400_feet_2018.csv')


Paradise_2018$date <- as.Date(Paradise_2018$Date.Time..PST., "%Y-%m-%d")
Paradise_2018$hr <-strftime(Paradise_2018$Date.Time..PST.,'%H')
Paradise_2018$min <-strftime(Paradise_2018$Date.Time..PST.,'%M')
Paradise_2018$month <- strftime(Paradise_2018$Date.Time..PST.,'%m')
Paradise_2018$Temperature..deg.C. <- (Paradise_2018$Temperature..deg.F. - 32) * (5/9)

Paradise_2018 %>% filter(month %in% c("09")) %>% ggplot(aes(date,Temperature..deg.C.)) +geom_point() + ggtitle("NWAC Temperature at Paradise(5400 ft)")+ xlab("Date") + ylab("Temp(Deg C)")

Extracting diurnal pattern for a day

Plot four wind along with other parameters

dp1<- av06_mm %>%  dplyr::mutate(row_no= row_number()) %>%  filter(row_no > 2292 & row_no < 2714) %>% ggplot() +
  geom_point(aes(row_no,windspeed1,color='windspeed1')) + 
  geom_point(aes(row_no,windspeed2,color='windspeed2')) +
  geom_point(aes(row_no,windspeed3,color='windspeed3')) +
  geom_point(aes(row_no,windspeed4,color='windspeed4')) +
  geom_line(aes(row_no,log10(temp4),color='temp 4')) +
  geom_line(aes(row_no,log10(temp3),color='temp 3')) +
  geom_line(aes(row_no,log10(temp2),color='temp 2')) +
  geom_line(aes(row_no,log10(temp1),color='temp 1')) +
   geom_line(aes(row_no,log10(solar),color='solar')) 

Trying smoothing to see the pattern

sp<- av06_mm %>%  dplyr::mutate(row_no= row_number()) %>%  filter(row_no > 2292 & row_no < 2714) %>% ggplot() +
  geom_point(aes(row_no,windspeed1,color='windspeed1')) + geom_smooth(aes(row_no,windspeed1),method='lm', se = FALSE)  +
  geom_point(aes(row_no,windspeed2,color='windspeed2')) + geom_smooth(aes(row_no,windspeed2),method='lm', se = FALSE)   +
  geom_smooth(aes(row_no,windspeed3,color='windspeed3')) + geom_smooth(aes(row_no,windspeed3),method='lm', se = FALSE)  +
  geom_smooth(aes(row_no,windspeed4,color='windspeed4')) + geom_smooth(aes(row_no,windspeed4),method='lm', se = FALSE)  + 
  theme_classic()
#ggplotly(sp)
#api_create(sp, filename = "wind-profile-smoothed")

8.13 10-1-2018

With respect to microclimate measurements, forest canopy seems to be quite choppy(wind). Intuition says that there is so much buffering that a strong wind that has originated elsewhere when makes into canopies dissipates much quicker.

Feedback: a) not descernible wind profile, so quite hard to interpolate. b) temperature seems to be too low c) the temperatures at different heights should track each other.

8.14 Next steps

– Extract similiar segments and compare – How would a diurnation curve look like in the canopies at different heights ? – In open, my understanding so far, the temp closer to ground is warmer(much ?) in early hours of the day, but as the day warms, it flips i.e. the temp closer to ground is not that warm compared to higher heights(vertically). The air is much warmer at higher heights around solar max. Is this true ? Verify. Now, there could be exceptions, like inversion or cold air pooling.

8.15 10-2-2018

Microclim manuscript update.

Feedback : a) Show 2-3 days instead of whole week. b) The raster plot - it is still not clear on what is the difference ? c) remove the seasonal plot as daily variation should be sufficient.

Reflection:

8.16 10-17-2018

Feedback - Ideal would be to show multiple days plotted on the hourly x-axis to show the variation.

Typical weekly summer variation

decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(01) & day(datec) > 15 & day(datec) < 19)  %>%
  group_by(month,day,hr)  %>%
  ggplot() +
  geom_line(aes(hr,Tsurface-273.5,group=day,color=as.factor(day),linetype = 'Surface'),se=F)+     geom_line(aes(hr,TAH-273.5,group=day ,color=as.factor(day),linetype = 'Canopy'),se=F)+
  scale_colour_manual("Temperature on day", breaks = c("16", "17","18"), values = c("blue","red","green")) +
   scale_linetype_manual("Height",values=c("Surface"=2,"Canopy"=1)) +
  theme_minimal() + ggtitle("Variation in temperature at two different heights")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1/16/81 - 1/18/81",caption="Data Source : http://www.microclim.org") 

8.17 Open to-dos

– Take out the grid

Taking a shot at seasonal aspect of microclimate.

decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(06,07,08) )  %>%
  group_by(month,day,hr) %>% summarise(minST = min(Tsurface),minCT = min(TAH),maxST = max(Tsurface),maxCT = max(TAH)) %>%
  group_by(hr) %>% summarise(minST = mean(minST),minCT = mean(minCT),maxST = mean(maxST),maxCT = mean(maxCT)) %>%
  ggplot() +
  geom_line(aes(hr,minST-273.5,color='Surface Min'),linetype=1,se=F)+ geom_line(aes(hr,minCT-273.5,color='Canopy Min'),se=F)+
    geom_line(aes(hr,maxST-273.5,color='Surface Max'),se=F)+ geom_line(aes(hr,maxCT-273.5,color='Canopy Max'),se=F)+
  scale_colour_manual("Temperature at", breaks = c("Surface Min", "Canopy Min","Surface Max", "Canopy Max"), values = c("blue","red","green","pink")) +
  theme_minimal() + ggtitle("Summer trend of minimum temperature at different heights")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="Microclimate differences at two different heights",caption="Data Source : http://www.microclim.org") 

8.18 10-04-2018

Plot solar

av06_mm %>% mutate(row_no= row_number(),solarinunits= solar*1.76) %>% ggplot() +
  geom_line(aes(row_no,solarinunits,color='solar')) 

ggplotly()

8.19 11-04-2018

Analysis of first set of data from the field.

Need to look at the hourly variation, we expect the ground to be cooler depending on the time of the day.

Lets look at one site

library(lubridate)
library(tidyverse)
mclim_AE10_TN01_2018<- read.csv('./data/DATALOG-AE10-TN01.CSV')
names(mclim_AE10_TN01_2018) <- c('time','nodeid','temp','batt')
mclim_AE10_TN01_2018$time <- as.POSIXct(mclim_AE10_TN01_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AE10_TN01_2018$hr <- hour(mclim_AE10_TN01_2018$time)
mclim_AE10_TN01_2018$minute<- minute(mclim_AE10_TN01_2018$time)
mclim_AE10_TN01_2018$day <- day(mclim_AE10_TN01_2018$time)
mclim_AE10_TN01_2018$month<- month(mclim_AE10_TN01_2018$time)

#Roughly one feet apart
mclim_AE10_TN01_2018$height <- 0

mclim_AE10_TN01_2018[mclim_AE10_TN01_2018$nodeid=='28244877910B0291' ,]$height <- 0.3
mclim_AE10_TN01_2018[mclim_AE10_TN01_2018$nodeid=='28A225779104022C' ,]$height <- 0.9
mclim_AE10_TN01_2018[mclim_AE10_TN01_2018$nodeid=='281D877791100268' ,]$height <- 0.6
mclim_AE10_TN01_2018[mclim_AE10_TN01_2018$nodeid=='282324779104023C' ,]$height <- 1.2

## Day plot , Representive day
mclim_AE10_TN01_2018 %>% filter(day(time) %in% '14' & !nodeid %in% c('282324779104023C')) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AE10 - Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

Do detailed variation

## Day plot , Representive day
mclim_AE10_TN01_2018 %>% filter(day(time) %in% '14' & !nodeid %in% c('282324779104023C')) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AE10 - Open - TN01")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

By minute

labelsx <- c( "0","12", "24", "36", "48" ,
             "1","12", "24", "36", "48",  "2" , "12", "24", "36", "48",
             "3", "12", "24", "36", "48",  "4",  "12", "24", "36", "48",
             "5", "12", "24", "36", "48",  "6",  "12", "24", "36", "48",
             "7", "12", "24", "36", "48", "8", "12", "24", "36", "48",
             "9", "12", "24", "36", "48", "10",  "12", "24", "36", "48",
             "11", "12", "24", "36", "48", "12",  "12", "24", "36", "48",
             "13", "12", "24", "36", "48", "14",  "12", "24", "36", "48",
             "15", "12", "24", "36", "48", "16",  "12", "24", "36", "48",
             "17", "12", "24", "36", "48", "18",  "12", "24", "36", "48",
             "19", "12", "24", "36", "48", "20",  "12", "24", "36", "48",
             "21", "12", "24", "36", "48", "22",  "12", "24", "36", "48",
             "23",  "12", "24", "36", "48")
## Day plot , Representive day
mclim_AE10_TN01_2018 %>% 
    filter(day(time) %in% '14' & !height %in% c(1.2)  )  %>%
  group_by(height,hr,minute) %>%
  summarise(tempatmin = mean(temp)) %>%
    group_by(b = gl(ceiling(n()/4), 4, n())) %>%
group_by(height,hr,b) %>%
   summarize(heights = levels(as.factor(height)), meantemp = mean(tempatmin),
             sd = sd(tempatmin)) %>%
  mutate(newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
  group_by(height) %>%
  mutate(index=1:n()) %>%
   ggplot() +
   geom_line(aes(index,meantemp,col=as.factor(height))) +
   #geom_line(data=paradise[paradise$day==14,], aes(hour,temp,col='Reference')) +
    labs(x="Hour", y="Temperature (°C)", tag="(g)",colour = "Height (m)") +
   theme_minimal() +
  scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelsx) +
   theme( panel.grid.major = element_blank(),

        legend.position = c(.2,.9),
         legend.title=element_text(size=9),
         legend.text=element_text(size=8),
         legend.background = element_rect(color = "grey90",
                                          size = .5, linetype = "dashed"),
         axis.text.x=element_text(angle=90, hjust=0)) +
   theme(strip.text.x = element_text(face="bold", size=4)) +
   theme(strip.text.y = element_text(face="bold", size=8))

Lets look at a closed site

mclim_AE10_TN02_2018<- read.csv('./data/DATALOG-AE10-TN02.CSV')
names(mclim_AE10_TN02_2018) <- c('time','nodeid','temp','batt')
mclim_AE10_TN02_2018$time <- as.POSIXct(mclim_AE10_TN02_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AE10_TN02_2018$hr <- hour(mclim_AE10_TN02_2018$time)
mclim_AE10_TN02_2018$minute <- minute(mclim_AE10_TN02_2018$time)
mclim_AE10_TN02_2018$day <- day(mclim_AE10_TN02_2018$time)
mclim_AE10_TN02_2018$month<- month(mclim_AE10_TN02_2018$time)

#Roughly one feet apart
mclim_AE10_TN02_2018$height <- 0

mclim_AE10_TN02_2018[mclim_AE10_TN02_2018$nodeid=='2862367791040281' ,]$height <- 1.2
mclim_AE10_TN02_2018[mclim_AE10_TN02_2018$nodeid=='286E9D77910802F2' ,]$height <- 0.6
mclim_AE10_TN02_2018[mclim_AE10_TN02_2018$nodeid=='28A91B7791060263' ,]$height <- 0.3
mclim_AE10_TN02_2018[mclim_AE10_TN02_2018$nodeid=='280704779106023F' ,]$height <- 0.9

## Day plot , Representive day
mclim_AE10_TN02_2018 %>% filter(day(time) %in% '14' ) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AE10 - Closed - TN02")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/14/2018",caption="Data Source : http://nanoclimate.org") 

Lets look at another site

mclim_AE10_TN03_2018<- read.csv('./data/DATALOG-AE10-TN03.CSV')
names(mclim_AE10_TN03_2018) <- c('time','nodeid','temp','batt')
mclim_AE10_TN03_2018$time <- as.POSIXct(mclim_AE10_TN03_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AE10_TN03_2018$hr <- hour(mclim_AE10_TN03_2018$time)
mclim_AE10_TN03_2018$day <- day(mclim_AE10_TN03_2018$time)
mclim_AE10_TN03_2018$month<- month(mclim_AE10_TN03_2018$time)
mclim_AE10_TN03_2018$minute<- minute(mclim_AE10_TN03_2018$time)
#Roughly one feet apart
mclim_AE10_TN03_2018$height <- 0

mclim_AE10_TN03_2018[mclim_AE10_TN03_2018$nodeid=='28BF3D77910B0267' ,]$height <- 1.2
mclim_AE10_TN03_2018[mclim_AE10_TN03_2018$nodeid=='28CCF877910A0292' ,]$height <- 0.6
mclim_AE10_TN03_2018[mclim_AE10_TN03_2018$nodeid=='283C8E7791080280' ,]$height <- 0.3
mclim_AE10_TN03_2018[mclim_AE10_TN03_2018$nodeid=='28E210779104020F' ,]$height <- 0.9

## Day plot , Representive day
mclim_AE10_TN03_2018 %>% filter(day(time) %in% '14' ) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AE10 - Closed - TN03")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/14/2018",caption="Data Source : http://nanoclimate.org") 

Lets look at the Anemometer site

mclim_AE10_CN01_2018<-read_csv('./data/DATALOG-AE10-CN01.CSV')
## Parsed with column specification:
## cols(
##   date = col_character(),
##   temp1 = col_double(),
##   temp2 = col_double(),
##   temp3 = col_double(),
##   temp4 = col_double(),
##   windspeed1 = col_double(),
##   windspeed2 = col_double(),
##   windspeed3 = col_double(),
##   windspeed4 = col_double(),
##   winddirection1 = col_double(),
##   winddirection2 = col_double(),
##   winddirection3 = col_double(),
##   winddirection4 = col_double(),
##   solar = col_double(),
##   battery = col_double()
## )
#mclim_AE10_CN01_2018<- read.csv('./data/DATALOG-AE10-CN01.CSV',stringsAsFactors = T)
names(mclim_AE10_CN01_2018)
##  [1] "date"           "temp1"          "temp2"          "temp3"         
##  [5] "temp4"          "windspeed1"     "windspeed2"     "windspeed3"    
##  [9] "windspeed4"     "winddirection1" "winddirection2" "winddirection3"
## [13] "winddirection4" "solar"          "battery"
mclim_AE10_CN01_2018$time <- as_datetime(mclim_AE10_CN01_2018$date, format="%m/%d/%y %H:%M:%S",tz="America/Los_Angeles")

mclim_AE10_CN01_2018$time <-as.POSIXct(mclim_AE10_CN01_2018$time)
#Add hour month and day
## 11-05-2018
mclim_AE10_CN01_2018$hr <- hour(mclim_AE10_CN01_2018$time)
mclim_AE10_CN01_2018$day <- day(mclim_AE10_CN01_2018$time)
mclim_AE10_CN01_2018$month<- month(mclim_AE10_CN01_2018$time)

#Roughly one feet apart
mclim_AE10_CN01_2018$height <- 0

#therm1,28782877910A0217 - 0.6
#therm2,284CCE7791090235 - 1.2  
#therm3,286C7A7791080217 - 0.9 
#therm4,280A2577910A020D - 0.3

# mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='2862367791040281' ,]$height <- 1.2
# mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='286E9D77910802F2' ,]$height <- 0.6
# mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='28A91B7791060263' ,]$height <- 0.3
# mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='280704779106023F' ,]$height <- 0.9

## Day plot , Representive day
mclim_AE10_CN01_2018 %>% filter(month %in% c(9) & day(time) %in% '14' ) %>% 
ggplot() + geom_line( aes(time,temp1,color = '0.6')) +
   geom_line( aes(time,temp2,color = '1.2')) +
   geom_line( aes(time,temp3,color = '0.9')) +
   geom_line( aes(time,temp4,color = '0.3')) +
   theme_classic()   +
ggtitle("Variation in temperature at AE10 w/Wind - Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/14/2018",caption="Data Source : http://nanoclimate.org") 

By day with wind

mclim_AE10_CN01_2018 %>% filter(month %in% c(9) ) %>% 
ggplot() + geom_line( aes(time,temp1,color = '0.6')) +
   geom_line( aes(time,temp2,color = '1.2')) +
   geom_line( aes(time,temp3,color = '0.9')) +
   geom_line( aes(time,temp4,color = '0.3')) +
  theme_minimal() +
ggtitle("Variation in temperature at AE10 w/Wind - Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="Microclimate profiles",caption="Data Source : http://nanoclimate.org") 

By day with wind

mclim_AE10_TN01_2018 %>% filter(!nodeid %in% c('282324779104023C') & temp >0 ) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AE10 - Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="Microclimate profiles",caption="Data Source : http://nanoclimate.org") 

Wind ptrofiles

mclim_AE10_CN01_2018<-read_csv('./data/DATALOG-AE10-CN01.CSV')
## Parsed with column specification:
## cols(
##   date = col_character(),
##   temp1 = col_double(),
##   temp2 = col_double(),
##   temp3 = col_double(),
##   temp4 = col_double(),
##   windspeed1 = col_double(),
##   windspeed2 = col_double(),
##   windspeed3 = col_double(),
##   windspeed4 = col_double(),
##   winddirection1 = col_double(),
##   winddirection2 = col_double(),
##   winddirection3 = col_double(),
##   winddirection4 = col_double(),
##   solar = col_double(),
##   battery = col_double()
## )
#mclim_AE10_CN01_2018<- read.csv('./data/DATALOG-AE10-CN01.CSV',stringsAsFactors = T)
names(mclim_AE10_CN01_2018)
##  [1] "date"           "temp1"          "temp2"          "temp3"         
##  [5] "temp4"          "windspeed1"     "windspeed2"     "windspeed3"    
##  [9] "windspeed4"     "winddirection1" "winddirection2" "winddirection3"
## [13] "winddirection4" "solar"          "battery"
mclim_AE10_CN01_2018$time <- as_datetime(mclim_AE10_CN01_2018$date, format="%m/%d/%y %H:%M:%S",tz="America/Los_Angeles")

mclim_AE10_CN01_2018$time <-as.POSIXct(mclim_AE10_CN01_2018$time)
#Add hour month and day
## 11-05-2018
mclim_AE10_CN01_2018$hr <- hour(mclim_AE10_CN01_2018$time)
mclim_AE10_CN01_2018$minute <- minute(mclim_AE10_CN01_2018$time)
mclim_AE10_CN01_2018$day <- day(mclim_AE10_CN01_2018$time)
mclim_AE10_CN01_2018$month<- month(mclim_AE10_CN01_2018$time)

#Roughly one feet apart
mclim_AE10_CN01_2018$height <- 0

#therm1,28782877910A0217 - 0.6
#therm2,284CCE7791090235 - 1.2  
#therm3,286C7A7791080217 - 0.9 
#therm4,280A2577910A020D - 0.3

 # mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='2862367791040281' ,]$height <- 1.2
 # mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='286E9D77910802F2' ,]$height <- 0.6
 # mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='28A91B7791060263' ,]$height <- 0.3
 # mclim_AE10_CN01_2018[mclim_AE10_CN01_2018$nodeid=='280704779106023F' ,]$height <- 0.9

## Day plot , Representive day
mclim_AE10_CN01_2018 %>% filter(month %in% c(9) & day(time) %in% '14'  & hr %in% c(13,14,15,16,17,18,19)) %>% 
ggplot() + geom_line( aes(time,windspeed1,color = '0.6')) +
   geom_line( aes(time,windspeed2,color = '1.2')) +
   geom_line( aes(time,windspeed3,color = '0.9')) +
   geom_line( aes(time,windspeed4,color = '0.3')) +
  theme_minimal() +
ggtitle("Variation in wind at AE10 w/Wind - Open")  + xlab("Date") +
  ylab("Wind (km/hr)") + labs(colour = "Height(m)",
                                subtitle="9/14/2018",caption="Data Source : http://nanoclimate.org") 

mclim_AE10_CN01_2018 %>% filter (month %in% c(9) ) %>% group_by(month,day) %>%
   summarize(maxtemp = max(temp1),mintemp = min(temp1)) %>% ggplot() + geom_line(aes(day,maxtemp,col='red')) + 
  geom_line(aes(as.numeric(day),mintemp,col='blue')) + 
   theme_classic() + labs(x="Day", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 - 2018/9 ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Temperature', 
         values =c('red'='red','blue'='blue'), labels = c('Max','Min'))

Diel

mclim_AE10_CN01_2018 %>% filter (month %in% c(9) ) %>% group_by(month,day) %>%
   summarize(maxtemp = max(temp1),mintemp = min(temp1)) %>% ggplot() + 
  geom_line(aes(as.numeric(day),maxtemp-mintemp,col='red')) + 
   theme_classic() + labs(x="Day", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 - 2018/9 ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Diel variation', 
         values =c('red'='red'), labels = c('Diurnal'))

Diel by hour

mclim_AE10_CN01_2018 %>% filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>% group_by(month,day,hr) %>%
   summarize(meantemp1 = mean(temp1),meantemp2 = mean(temp2),meantemp3 = mean(temp3),meantemp4 = mean(temp4)) %>% 
  group_by(hr) %>% 
  ggplot() + 
  geom_smooth(aes(as.numeric(hr),meantemp1,col='red'),se = F) + 
  geom_smooth(aes(as.numeric(hr),meantemp2,col='blue'),se = F) + 
  geom_smooth(aes(as.numeric(hr),meantemp3,col='green'),se = F) + 
  geom_smooth(aes(as.numeric(hr),meantemp4,col='purple'),se = F) + 
   theme_classic() + labs(x="Hour", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 - 2018/9 ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights', 
         values =c('red'='red','blue'='blue','green'='green','purple'='purple'), labels = c('1.2','.9','.6','.3'))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Diel does not make sense

mclim_AE10_CN01_2018 %>% filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>% group_by(month,day,hr,minute) %>%
  summarise(m1= mean(temp1),m2= mean(temp2),m3= mean(temp3),m4= mean(temp4)) %>%
   mutate(dh1 = mean(min(m1) - max(m1)) ,dh2 = mean(min(m2) - max(m2)),dh3 = mean(min(m3) - max(m3)),dh4 = mean(min(m4) - max(m4))) %>% 
  group_by(hr) %>% 
  ggplot() + 
  geom_smooth(aes(as.numeric(hr),dh1,col='red'),se = F) + 
  geom_smooth(aes(as.numeric(hr),dh2,col='blue'),se = F) + 
  geom_smooth(aes(as.numeric(hr),dh3,col='green'),se = F) + 
  geom_smooth(aes(as.numeric(hr),dh4,col='purple'),se = F) + 
   theme_classic() + labs(x="Hour", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 - 2018/9 ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights', 
         values =c('red'='red','blue'='blue','green'='green','purple'='purple'), labels = c('1.2','.9','.6','.3'))
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

Diel does not make sense

mclim_AE10_CN01_2018 %>% filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%   
  group_by(month,day,hr) %>%
  summarise(m1= mean(temp1),m2= mean(temp2),m3= mean(temp3),m4= mean(temp4)) %>%
  group_by(hr) %>% 
  summarise(m1= mean(m1),m2= mean(m2),m3= mean(m3),m4= mean(m4)) %>%
  ggplot() + 
  geom_line(aes(as.numeric(hr),m1,col='1')) + 
  geom_line(aes(as.numeric(hr),m2,col='2')) + 
  geom_line(aes(as.numeric(hr),m3,col='3')) + 
  geom_line(aes(as.numeric(hr),m4,col='4')) + 
   theme_classic() + labs(x="Hour", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 - September 2018 ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +  
    scale_colour_manual(name = 'Diurnal variation at heights (m)', 
         values =c('1'='red','2'='blue','3'='green','4'='purple'), labels = c('1.2','.9','.6','.3'))

Lapse rate calculator

https://www.shodor.org/os411/courses/_master/tools/calculators/lapserate/

8.20 11-19-2018

Few days in September (Late September)

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 20 & day < 24)  %>%
    group_by(month,day,hr) %>%
    summarise(m1= mean(temp1),m2= mean(temp2),m3= mean(temp3),m4= mean(temp4)) %>%
  group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,m1,group=day,color=as.factor(day),linetype = '0.3'),se=F)+      
  geom_line(aes(hr,m4,group=day ,color=as.factor(day),linetype = '1.2'),se=F)+
  scale_colour_manual("Temperature on day", breaks = c("21", "22","23"), values = c("blue","red","green")) +
   scale_linetype_manual("Height(m)",values=c("0.3"=2,"1.2"=1)) +
  theme_classic()  + ggtitle("Variation in temperature at two different heights at AE10")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/21/18 - 9/23/19",caption="Data Source : http://www.nanoclimate.org") 

Early in the month

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 11 & day < 15)  %>%
    group_by(month,day,hr) %>%
    summarise(m1= mean(temp1),m2= mean(temp2),m3= mean(temp3),m4= mean(temp4)) %>%
  group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,m1,group=day,color=as.factor(day),linetype = '0.3'),se=F)+ 
  geom_line(aes(hr,m4,group=day ,color=as.factor(day),linetype = '1.2'),se=F)+
  scale_colour_manual("Temperature on day", breaks = c("12", "13","14"), values = c("blue","red","green")) +
   scale_linetype_manual("Height(m)",values=c("0.3"=2,"1.2"=1)) +
  theme_classic()  + ggtitle("Variation in temperature at two different heights at AE10")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/12/18 - 9/14/19",caption="Data Source : http://www.nanoclimate.org") 

Minute resolution

Early in the month

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 11 & day < 15)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp1),m2= mean(temp2),m3= mean(temp3),m4= mean(temp4)) %>%
  group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,m1,group=day,color=as.factor(day),linetype = '0.3'),se=F)+ 
  geom_line(aes(hr,m4,group=day ,color=as.factor(day),linetype = '1.2'),se=F)+
  scale_colour_manual("Temperature on day", breaks = c("12", "13","14"), values = c("blue","red","green")) +
   scale_linetype_manual("Height(m)",values=c("0.3"=2,"1.2"=1)) +
  theme_classic()  + ggtitle("Variation in temperature at two different heights at AE10")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/12/18 - 9/14/19",caption="Data Source : http://www.nanoclimate.org") 

Minute resolution

Early in the month

mclim_AE10_CN01_2018$segment <- 0
mclim_AE10_CN01_2018[!is.na(mclim_AE10_CN01_2018$minute) & mclim_AE10_CN01_2018$minute >0 & mclim_AE10_CN01_2018$minute <=15  ,]$segment <- 1
mclim_AE10_CN01_2018[!is.na(mclim_AE10_CN01_2018$minute) & mclim_AE10_CN01_2018$minute >15 & mclim_AE10_CN01_2018$minute <=30  ,]$segment <- 2
mclim_AE10_CN01_2018[!is.na(mclim_AE10_CN01_2018$minute) & mclim_AE10_CN01_2018$minute >30 & mclim_AE10_CN01_2018$minute <=45  ,]$segment <- 3
mclim_AE10_CN01_2018[!is.na(mclim_AE10_CN01_2018$minute) & mclim_AE10_CN01_2018$minute >45 & mclim_AE10_CN01_2018$minute <=60  ,]$segment <- 4

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 11 & day < 15)  %>%
    group_by(month,day,hr,segment) %>%
    summarise(m1= mean(temp1),m2= mean(temp2),m3= mean(temp3),m4= mean(temp4)) %>%
  group_by(day,hr) %>% 
  summarise(m1= mean(m1),m2= mean(m2),m3= mean(m3),m4= mean(m4)) %>%
  ggplot() +
  geom_line(aes(hr,m1,group=day,color=as.factor(day),linetype = '0.3'),se=F)+ 
  geom_line(aes(hr,m4,group=day ,color=as.factor(day),linetype = '1.2'),se=F)+
  scale_colour_manual("Temperature on day", breaks = c("12", "13","14"), values = c("blue","red","green")) +
   scale_linetype_manual("Height(m)",values=c("0.3"=2,"1.2"=1)) +
  theme_classic()  + ggtitle("Variation in temperature at two different heights at AE10")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/12/18 - 9/14/19",caption="Data Source : http://www.nanoclimate.org") 

Microclim(Without the grid) - Take off title - Remove grid - Remove caption - Remove temperature on a day legend

decombined %>% filter(year(datec) %in% c(1981) & month(datec) %in% c(01) & day(datec) > 15 & day(datec) < 19)  %>%
  group_by(month,day,hr)  %>%
  ggplot() +
  geom_line(aes(hr,Tsurface-273.5,group=day,color=as.factor(day),linetype = '0'),se=F)+     geom_line(aes(hr,TAH-273.5,group=day ,color=as.factor(day),linetype = '1.3'),se=F)+
  scale_colour_manual("Temperature on day", breaks = c("16", "17","18"), values = c("blue","red","green"),guide = FALSE) +
   scale_linetype_manual("Height(m)",values=c("0"=2,"1.3"=1)) +
  theme_classic() + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour") 

## 12-02-2018

8.21 12-17-2018

Comparison to LaCrosse Weather Station

mclim_AE16_CN01_Calib<-read_csv('./data/AE16CN-Calbration.CSV')
## Parsed with column specification:
## cols(
##   date = col_character(),
##   temp1 = col_double(),
##   temp2 = col_double(),
##   temp3 = col_double(),
##   temp4 = col_double(),
##   windspeed1 = col_double(),
##   windspeed2 = col_double(),
##   windspeed3 = col_double(),
##   windspeed4 = col_double(),
##   winddirection1 = col_double(),
##   winddirection2 = col_double(),
##   winddirection3 = col_double(),
##   winddirection4 = col_double(),
##   solar = col_double(),
##   battery = col_double()
## )
names(mclim_AE16_CN01_Calib)
##  [1] "date"           "temp1"          "temp2"          "temp3"         
##  [5] "temp4"          "windspeed1"     "windspeed2"     "windspeed3"    
##  [9] "windspeed4"     "winddirection1" "winddirection2" "winddirection3"
## [13] "winddirection4" "solar"          "battery"
mclim_AE16_CN01_Calib$time <- as_datetime(mclim_AE16_CN01_Calib$date, format="%m/%d/%y %H:%M:%S",tz="America/Los_Angeles")

mclim_AE16_CN01_Calib$time <-as.POSIXct(mclim_AE16_CN01_Calib$time)
#Add hour month and day
## 11-05-2018
mclim_AE16_CN01_Calib$hr <- hour(mclim_AE16_CN01_Calib$time)
mclim_AE16_CN01_Calib$minute <- minute(mclim_AE16_CN01_Calib$time)
mclim_AE16_CN01_Calib$day <- day(mclim_AE16_CN01_Calib$time)
mclim_AE16_CN01_Calib$month<- month(mclim_AE16_CN01_Calib$time)

Read in LaCrosse

library(weathermetrics)
LaCrosse_Calib<-read_csv('./data/LaCrosse_20181116-20181215.csv')
## Parsed with column specification:
## cols(
##   Time = col_datetime(format = ""),
##   HeatIndex_F = col_double(),
##   `Humidity RH%` = col_double(),
##   Temperature_F = col_double()
## )
names(LaCrosse_Calib)
## [1] "Time"          "HeatIndex_F"   "Humidity RH%"  "Temperature_F"
LaCrosse_Calib$Temperature_C<- weathermetrics::fahrenheit.to.celsius(LaCrosse_Calib$Temperature_F)
#LaCrosse_Calib$dtime <- as_datetime(LaCrosse_Calib$Time, format="%Y-%m-%d %H:%M:%S",tz="America/Los_Angeles")

#LaCrosse_Calib$dtime <-as.POSIXct(LaCrosse_Calib$Time)
#Add hour month and day
## 11-05-2018
LaCrosse_Calib$hr <- hour(LaCrosse_Calib$Time)
LaCrosse_Calib$minute <- minute(LaCrosse_Calib$Time)
LaCrosse_Calib$day <- day(LaCrosse_Calib$Time)
LaCrosse_Calib$month<- month(LaCrosse_Calib$Time)

Raw plots

mclim_AE16_CN01_Calib %>% filter(day > 4) %>%
  ggplot() + 
  geom_line(aes(time,temp1,col='A')) + 
  geom_line(aes(time,temp2,col='B')) + 
  geom_line(data=LaCrosse_Calib, aes(Time,Temperature_C,col='C')) + 
 
   theme_classic() + labs(x="Date", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 Validation ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights', 
         values =c('A'='red','B'='blue','C'='green'), labels = c('1.2','.9',"Reference"))

Hourly

8.22 12-21-2018

Plot three elevations at Mt Rainier

MtRainier_Local <- read_csv('./data/mt-rainier_temperature_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `deg F - 5400' - Paradise` = col_double(),
##   `deg F - 6410' - Sunrise Base` = col_double(),
##   `deg F - 6880' - Sunrise Upper` = col_double(),
##   `deg F - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Local) <- c('datetime','Paradise_5400','Sunrise_6410','Sunrise_6880','CampMuir_10110')

MtRainier_Local$hr <- hour(MtRainier_Local$datetime)
MtRainier_Local$minute <- minute(MtRainier_Local$datetime)
MtRainier_Local$day <- day(MtRainier_Local$datetime)
MtRainier_Local$month<- month(MtRainier_Local$datetime)
MtRainier_Local$year<- year(MtRainier_Local$datetime)

MtRainier_Local %>% filter(month == 9 & year== 2018 ) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='5400')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='6410')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='6880')) + 
 
   theme_classic() + labs(x="Date", y="Temperature(°C) ",subtitle="Microclimate station -  AE10 Validation ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights', 
         values =c('5400'='red','6410'='blue','6880'='green'), labels = c('5400','6410',"6880"))

Read and plot the points

#With zero plane dispacement
library(leaflet)

Nodes <- read_csv('./data/Nodes-Table 1.csv')
## Parsed with column specification:
## cols(
##   X1 = col_logical(),
##   NodeId = col_character(),
##   Lat = col_double(),
##   Long = col_double(),
##   Type = col_character(),
##   Canopy = col_character(),
##   `Live Date(GMT)` = col_character(),
##   Notes = col_character()
## )
Nodes %>% leaflet() %>%
      fitBounds(~min(Long), ~min(Lat), ~max(Long), ~max(Lat)) %>%
      addProviderTiles(providers$Esri.WorldTopoMap,
                       options = providerTileOptions(noWrap = TRUE)
      ) %>%
      addMarkers(~Long,~Lat,popup = ~as.character(NodeId), label = ~as.character(NodeId)) %>%
      addCircleMarkers(-121.73,46.79,color = "red")
      #addCircles(~lon,~lat,color = ~pal(estElevation)) %>%
      #addLegend(pal = pal, values = ~estElevation) 

## Get long and lat from your data.frame. Make sure that the order is in lon/lat.

xy <- Nodes[,c('Long','Lat')]

spdf <- SpatialPointsDataFrame(coords = xy, data = Nodes,
                               proj4string = CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"))
prj_dd <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
library(elevatr)
df_elev_epqs <- get_elev_point(spdf, prj = prj_dd, src = "epqs")
## Note: Elevation units are in &units=Meters 
## Note:. The coordinate reference system is:
##  +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0

Plot the nodes on high resolution DEM

#With zero plane dispacement
library(rgdal) #this package is necessary to import the .asc file in R.
library(rasterVis) #this package has the function which allows the 3D plotting.

#set the path where the file is, and import it into R.
r= raster(paste("./data/rainier_2007_dtm_12.tif", sep=""))

#visualize the raster in 3D
plot(r,lit=TRUE)

8.23 1-3-2019

Checking a sample day at Mt Rainier, testing the hypothesis that temperature decreases by elevation. We are going to look at sample day of September 12th 2018, we see for for couple of hours temperature shows inversion. Now, unstable of the boundary layer means mixing, usually results from the wind.

MtRainier_Local <- read_csv('./data/mt-rainier_temperature_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `deg F - 5400' - Paradise` = col_double(),
##   `deg F - 6410' - Sunrise Base` = col_double(),
##   `deg F - 6880' - Sunrise Upper` = col_double(),
##   `deg F - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Local) <- c('datetime','Paradise_5400','Sunrise_6410','Sunrise_6880','CampMuir_10110')

MtRainier_Local$hr <- hour(MtRainier_Local$datetime)
MtRainier_Local$minute <- minute(MtRainier_Local$datetime)
MtRainier_Local$day <- day(MtRainier_Local$datetime)
MtRainier_Local$month<- month(MtRainier_Local$datetime)
MtRainier_Local$year<- year(MtRainier_Local$datetime)

MtRainier_Local %>% filter(month == 9 & year== 2018 & day == 12) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='1645')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='1953')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='2097')) +
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),col='3081')) + 
 
theme_classic() + labs(x="Date", y="Temperature(°C) ",subtitle="Met stations -  Mt Rainier ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4'), labels = c('1645','1953',"2097","3081")) +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  

Lets lookjust for September

MtRainier_Local <- read_csv('./data/mt-rainier_temperature_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `deg F - 5400' - Paradise` = col_double(),
##   `deg F - 6410' - Sunrise Base` = col_double(),
##   `deg F - 6880' - Sunrise Upper` = col_double(),
##   `deg F - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Local) <- c('datetime','Paradise_5400','Sunrise_6410','Sunrise_6880','CampMuir_10110')

MtRainier_Local$hr <- hour(MtRainier_Local$datetime)
MtRainier_Local$minute <- minute(MtRainier_Local$datetime)
MtRainier_Local$day <- day(MtRainier_Local$datetime)
MtRainier_Local$month<- month(MtRainier_Local$datetime)
MtRainier_Local$year<- year(MtRainier_Local$datetime)

MtRainier_Local %>% filter(month == 9 & year== 2018 ) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='1645')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='1953')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='2097')) +
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),col='3081')) + 
 
theme_classic() + labs(x="Date", y="Temperature(°C) ",subtitle="Met stations -  Mt Rainier Hourly readings (2018) ",                                                                                                   caption="Data Source : http://nwac.us") + 
   scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4'), labels = c('1645','1953',"2097","3081")) +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  

See if it is true for the whole year,looks like Summer is bit jumbled

MtRainier_Local <- read_csv('./data/mt-rainier_temperature_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `deg F - 5400' - Paradise` = col_double(),
##   `deg F - 6410' - Sunrise Base` = col_double(),
##   `deg F - 6880' - Sunrise Upper` = col_double(),
##   `deg F - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Local) <- c('datetime','Paradise_5400','Sunrise_6410','Sunrise_6880','CampMuir_10110')

MtRainier_Local$hr <- hour(MtRainier_Local$datetime)
MtRainier_Local$minute <- minute(MtRainier_Local$datetime)
MtRainier_Local$day <- day(MtRainier_Local$datetime)
MtRainier_Local$month<- month(MtRainier_Local$datetime)
MtRainier_Local$year<- year(MtRainier_Local$datetime)

MtRainier_Local %>% filter( year== 2018) %>%
  ggplot() + 
  geom_smooth(method = "loess",aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),colour='1645'),se=TRUE) + 
  geom_smooth(method = "loess",aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),colour='1953'),se=TRUE) + 
  geom_smooth(method = "loess",aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),colour='2097'),se=TRUE) +
  geom_smooth(method = "loess",aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),colour='3081'),se=TRUE) + 
 
theme_classic() + labs(x="Date", y="Temperature(°C) ",subtitle="Met stations -  Mt Rainier ",                                                                                                   caption="Data Source : http://nwac.us") + 

    scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4'), labels = c('1645','1953',"2097","3081")) +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  

Mapping solar radiation for the same three heights.Its generally truethat higher the elevation,more solar insolation,but must not bethe case in all as

MtRainier_Solar <- read_csv('./data/mt-rainier_solar_pyranometer_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `W/m2 - 5380' - Paradise Wind` = col_double(),
##   `W/m2 - 6880' - Sunrise Upper` = col_double(),
##   `W/m2 - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Solar) <- c('datetime','Paradise_5400','Sunrise_6880','CampMuir_10110')

MtRainier_Solar$hr <- hour(MtRainier_Solar$datetime)
MtRainier_Solar$minute <- minute(MtRainier_Solar$datetime)
MtRainier_Solar$day <- day(MtRainier_Solar$datetime)
MtRainier_Solar$month<- month(MtRainier_Solar$datetime)
MtRainier_Solar$year<- year(MtRainier_Solar$datetime)

MtRainier_Solar %>% filter(month == 9 & year== 2018 & day == 10) %>%
  ggplot() + 
  geom_line(aes(datetime,Paradise_5400,col='1645')) + 
  geom_line(aes(datetime,Sunrise_6880,col='2097')) + 
  geom_line(aes(datetime,CampMuir_10110,col='3081')) + 
 
   theme_classic() + labs(x="Date", y="Solar radiation(W/m2) ",subtitle="Met stations -  Mt Rainier  Solar ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

Lets look for whole of September

MtRainier_Solar <- read_csv('./data/mt-rainier_solar_pyranometer_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `W/m2 - 5380' - Paradise Wind` = col_double(),
##   `W/m2 - 6880' - Sunrise Upper` = col_double(),
##   `W/m2 - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Solar) <- c('datetime','Paradise_5400','Sunrise_6880','CampMuir_10110')

MtRainier_Solar$hr <- hour(MtRainier_Solar$datetime)
MtRainier_Solar$minute <- minute(MtRainier_Solar$datetime)
MtRainier_Solar$day <- day(MtRainier_Solar$datetime)
MtRainier_Solar$month<- month(MtRainier_Solar$datetime)
MtRainier_Solar$year<- year(MtRainier_Solar$datetime)

MtRainier_Solar %>% filter(month == 9 & year== 2018 ) %>%
  ggplot() + 
  geom_line(aes(datetime,Paradise_5400,col='1645')) + 
  geom_line(aes(datetime,Sunrise_6880,col='2097')) + 
  geom_line(aes(datetime,CampMuir_10110,col='3081')) + 
 
   theme_classic() + labs(x="Date", y="Solar radiation(W/m2) ",subtitle="Met stations -  Mt Rainier  Solar ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

Highest elevation crowding,lets take it out

MtRainier_Solar <- read_csv('./data/mt-rainier_solar_pyranometer_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `W/m2 - 5380' - Paradise Wind` = col_double(),
##   `W/m2 - 6880' - Sunrise Upper` = col_double(),
##   `W/m2 - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Solar) <- c('datetime','Paradise_5400','Sunrise_6880','CampMuir_10110')

MtRainier_Solar$hr <- hour(MtRainier_Solar$datetime)
MtRainier_Solar$minute <- minute(MtRainier_Solar$datetime)
MtRainier_Solar$day <- day(MtRainier_Solar$datetime)
MtRainier_Solar$month<- month(MtRainier_Solar$datetime)
MtRainier_Solar$year<- year(MtRainier_Solar$datetime)

MtRainier_Solar %>% filter(month == 9 & year== 2018 ) %>%
  ggplot() + 
  geom_line(aes(datetime,Paradise_5400,col='1645')) + 
  geom_line(aes(datetime,Sunrise_6880,col='2097')) +
 
   theme_classic() + labs(x="Date", y="Solar radiation(W/m2) ",subtitle="Met stations -  Mt Rainier  Solar ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

Day in, selective days, again the solar insolation although highest at higher elevastions, not really a function of elevation

MtRainier_Solar <- read_csv('./data/mt-rainier_solar_pyranometer_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `W/m2 - 5380' - Paradise Wind` = col_double(),
##   `W/m2 - 6880' - Sunrise Upper` = col_double(),
##   `W/m2 - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Solar) <- c('datetime','Paradise_5400','Sunrise_6880','CampMuir_10110')

MtRainier_Solar$hr <- hour(MtRainier_Solar$datetime)
MtRainier_Solar$minute <- minute(MtRainier_Solar$datetime)
MtRainier_Solar$day <- day(MtRainier_Solar$datetime)
MtRainier_Solar$month<- month(MtRainier_Solar$datetime)
MtRainier_Solar$year<- year(MtRainier_Solar$datetime)

MtRainier_Solar %>% filter(month == 9 & year== 2018 & day %in% c(10,11,12,13,14) ) %>%
  ggplot() + 
  geom_line(aes(datetime,Paradise_5400,col='1645')) + 
  geom_line(aes(datetime,Sunrise_6880,col='2097')) +
  geom_line(aes(datetime,CampMuir_10110,col='3081')) + 
 
   theme_classic() + labs(x="Date", y="Solar radiation(W/m2) ",subtitle="Met stations -  Mt Rainier  Solar  - 2018",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

Lets read in A1 temps , plotting only September 2016

MtRainier_AE10A1_1617 <- read_csv('./data/AE10-A1-061616-062717.csv')
## Parsed with column specification:
## cols(
##   `#` = col_double(),
##   `Date Time, GMT-07:00` = col_character(),
##   `Temp, °C (LGR S/N: 10620921, SEN S/N: 10620921)` = col_double(),
##   `Coupler Attached (LGR S/N: 10620921)` = col_logical(),
##   `Host Connected (LGR S/N: 10620921)` = col_logical(),
##   `Coupler Detached (LGR S/N: 10620921)` = col_logical(),
##   `Stopped (LGR S/N: 10620921)` = col_logical(),
##   `End Of File (LGR S/N: 10620921)` = col_logical()
## )
colnames(MtRainier_AE10A1_1617) <- c('#','datetime','Temp','CoupAttach','HostConn','CoupDeAttach','Stopped','eof')

MtRainier_AE10A1_1617$timect <- as.POSIXct(MtRainier_AE10A1_1617$datetime, format="%m/%d/%y %I:%M:%S %p",tz="America/Los_Angeles")

MtRainier_AE10A1_1617$hr <- hour(MtRainier_AE10A1_1617$timect)
MtRainier_AE10A1_1617$minute <- minute(MtRainier_AE10A1_1617$timect)
MtRainier_AE10A1_1617$day <- day(MtRainier_AE10A1_1617$timect)
MtRainier_AE10A1_1617$month<- month(MtRainier_AE10A1_1617$timect)
MtRainier_AE10A1_1617$year<- year(MtRainier_AE10A1_1617$timect)

MtRainier_AE10A1_1617 %>% 
  filter(month == 9 & year== 2016 & day %in% c(10,11,12,13,14) ) %>%
  ggplot() + 
  geom_point(aes(timect,Temp,col='A1')) +
   geom_line(aes(timect,Temp)) +
 
   theme_classic() + labs(x="Date", y="Temperature(°C)  ",subtitle="Air hobo AE10 A1 -  Mt Rainie -Recorded every 2 hours (2016) ",                                                                                                   caption="Data Source : JHRL") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

Lets read in A1 temps , plotting only September 2017

MtRainier_AE10A1_1718 <- read_csv('./data/AE10-A1-062817-072818.csv')
## Parsed with column specification:
## cols(
##   `#` = col_double(),
##   `Date Time, GMT-07:00` = col_character(),
##   `Temp, °C (LGR S/N: 10620922, SEN S/N: 10620922)` = col_double(),
##   `Coupler Attached (LGR S/N: 10620922)` = col_logical(),
##   `Host Connected (LGR S/N: 10620922)` = col_logical(),
##   `Stopped (LGR S/N: 10620922)` = col_logical(),
##   `End Of File (LGR S/N: 10620922)` = col_logical()
## )
colnames(MtRainier_AE10A1_1718) <- c('#','datetime','Temp','CoupAttach','HostConn','Stopped','eof')



MtRainier_AE10A1_1718$timect <- as.POSIXct(MtRainier_AE10A1_1718$datetime, format="%m/%d/%y %I:%M:%S %p",tz="America/Los_Angeles")
#MtRainier_AE10A1_1718$timect <- as.POSIXct(MtRainier_AE10A1_1718$datetime, format="%m/%d/%y %I:%M:%S %p",tz="America/Los_Angeles")

MtRainier_AE10A1_1718$hr <- hour(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$minute <- minute(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$day <- day(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$month<- month(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$year<- year(MtRainier_AE10A1_1718$timect)

MtRainier_AE10A1_1718 %>% 
  filter(month == 9 & year== 2017 & day %in% c(10,11,12,13,14) ) %>%
  ggplot() + 
  geom_point(aes(timect,Temp,col='A1')) +
   geom_line(aes(timect,Temp)) +
 
   theme_classic() + labs(x="Date", y="Temperature(°C)  ",subtitle="Air hobo AE10 A1 -  Mt Rainie -Recorded every 2 hours (2017) ",                                                                                                   caption="Data Source : JHRL") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

How does Sept compare to Paradise (2017)

# read in Paradise

MtRainier_Local_2017<- read_csv('./data/mt-rainier_temperature_2017.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `deg F - 5400' - Paradise` = col_double(),
##   `deg F - 6410' - Sunrise Base` = col_double(),
##   `deg F - 6880' - Sunrise Upper` = col_double(),
##   `deg F - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Local_2017) <- c('datetime','Paradise_5400','Sunrise_6410','Sunrise_6880','CampMuir_10110')

MtRainier_Local_2017$hr <- hour(MtRainier_Local_2017$datetime)
MtRainier_Local_2017$minute <- minute(MtRainier_Local_2017$datetime)
MtRainier_Local_2017$day <- day(MtRainier_Local_2017$datetime)
MtRainier_Local_2017$month<- month(MtRainier_Local_2017$datetime)
MtRainier_Local_2017$year<- year(MtRainier_Local_2017$datetime)

MtRainier_Local_2017 %>% filter(month == 9 & year== 2017 ) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='1645')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='1953')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='2097')) +
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),col='3081')) + 
 
theme_classic() + labs(x="Date", y="Temperature(°C) ",subtitle="Met stations -  Mt Rainier Hourly readings (2017) ",                                                                                                   caption="Data Source : http://nwac.us") + 
   scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4'), labels = c('1645','1953',"2097","3081")) +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed") 

MtRainier_AE10A1_1718 <- read_csv('./data/AE10-A1-062817-072818.csv')
## Parsed with column specification:
## cols(
##   `#` = col_double(),
##   `Date Time, GMT-07:00` = col_character(),
##   `Temp, °C (LGR S/N: 10620922, SEN S/N: 10620922)` = col_double(),
##   `Coupler Attached (LGR S/N: 10620922)` = col_logical(),
##   `Host Connected (LGR S/N: 10620922)` = col_logical(),
##   `Stopped (LGR S/N: 10620922)` = col_logical(),
##   `End Of File (LGR S/N: 10620922)` = col_logical()
## )
colnames(MtRainier_AE10A1_1718) <- c('#','datetime','Temp','CoupAttach','HostConn','Stopped','eof')



MtRainier_AE10A1_1718$timect <- as.POSIXct(MtRainier_AE10A1_1718$datetime, format="%m/%d/%y %I:%M:%S %p",tz="America/Los_Angeles")

MtRainier_AE10A1_1718$hr <- hour(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$minute <- minute(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$day <- day(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$month<- month(MtRainier_AE10A1_1718$timect)
MtRainier_AE10A1_1718$year<- year(MtRainier_AE10A1_1718$timect)

MtRainier_AE10A1_1718 %>% 
  filter(month == 9 & year== 2017  ) %>%
  ggplot() + 
  geom_point(aes(timect,Temp,col='A1')) +
   geom_line(aes(timect,Temp)) +
 
   theme_classic() + labs(x="Date", y="Temperature(°C)  ",subtitle="Air hobo AE10 A1 -  Mt Rainie -Recorded every 2 hours (2017) ",                                                                                                   caption="Data Source : JHRL") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('red','blue','green'), labels = c('1645','2097',"3081"))

Combine whole month with A1

# read in Paradise

MtRainier_Local_2017 %>% filter(month == 9 & year== 2017 ) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='1645')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='1953')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='2097')) +
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),col='3081')) + 
  geom_line(data=MtRainier_AE10A1_1718[MtRainier_AE10A1_1718$month == 9 & MtRainier_AE10A1_1718$year== 2017,],aes(timect,Temp,col='1450')) +
theme_classic() + labs(x="Date", y="Temperature(°C) ", color = "Height (m)",
                       subtitle="Met stations and A1-  Mt Rainier Hourly readings (2017) ",                                                                                                   caption="Data Source : http://nwac.us")  +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed") 

Combine whole month with A1 selective days

# read in Paradise
MtRainier_AE10A1_1718$timectdiff2 <- MtRainier_AE10A1_1718$timect - lubridate::hours(2)

MtRainier_Local_2017 %>% filter(month == 9 & year== 2017 & day %in% c(1,2,3,4,5,10,11,12,13,14,15) ) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='1645')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='1953')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='2097')) +
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),col='3081')) + 
  geom_line(data=MtRainier_AE10A1_1718[MtRainier_AE10A1_1718$month == 9 &      MtRainier_AE10A1_1718$year== 2017 & MtRainier_AE10A1_1718$day %in% c(1,2,3,4,5,10,11,12,13,14,15) ,],aes(timectdiff2,Temp,col='1450')) +
theme_classic() + labs(x="Date", y="Temperature(°C) ", color = "Height (m)",
                       subtitle="Met stations and A1-  Mt Rainier Hourly readings (2017) ",                                                                                                   caption="Data Source : http://nwac.us")  +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed") 

Combine whole month with A1 2017

# read in Paradise

MtRainier_Local_2017 %>% filter(year== 2017) %>%
  ggplot() + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Paradise_5400),col='1645')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),col='1953')) + 
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(Sunrise_6880),col='2097')) +
  geom_line(aes(datetime,weathermetrics::fahrenheit.to.celsius(CampMuir_10110),col='3081')) + 
  geom_line(data=MtRainier_AE10A1_1718[MtRainier_AE10A1_1718$year== 2017 ,],aes(timect,Temp,col='1450')) +
theme_classic() + labs(x="Date", y="Temperature(°C) ", color = "Height (m)",
                       subtitle="Met stations and A1-  Mt Rainier Hourly readings (2017) ",                                                                                                   caption="Data Source : http://nwac.us")  +
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed") 

## 1-04-2019

Plotting the min and max of the coop and snotel

MtRainier_coopsnowsep_longmire <- read_csv('./data/UCC_ghcn_Longmire.csv',comment = '#')
## Parsed with column specification:
## cols(
##   Day = col_date(format = ""),
##   Precipitation = col_character(),
##   Min_Temperature = col_character(),
##   Max_Temperature = col_character()
## )
MtRainier_coopsnowsep_skatecreek <- read_csv('./data/UCC_ghcn_SkateCreek.csv',comment = '#')
## Parsed with column specification:
## cols(
##   Day = col_date(format = ""),
##   Precipitation = col_character(),
##   Min_Temperature = col_character(),
##   Max_Temperature = col_character()
## )
MtRainier_coopsnowsep_Paradise <- read_csv('./data/UCC_ghcn_Paradise.csv',comment = '#')
## Parsed with column specification:
## cols(
##   Day = col_date(format = ""),
##   Precipitation = col_character(),
##   Min_Temperature = col_character(),
##   Max_Temperature = col_character()
## )
MtRainier_coopsnowsep_longmire$day <- day(MtRainier_coopsnowsep_longmire$Day)
MtRainier_coopsnowsep_longmire$month<- month(MtRainier_coopsnowsep_longmire$Day)
MtRainier_coopsnowsep_longmire$year<- year(MtRainier_coopsnowsep_longmire$Day)

MtRainier_coopsnowsep_longmire %>% 
  filter(year== 2018) %>% 
  ggplot() + 
  geom_line(aes(Day,as.numeric(Min_Temperature),col='1')) +
  geom_line(aes(Day,as.numeric(Max_Temperature),col='2')) +
  geom_line(data=MtRainier_coopsnowsep_skatecreek,aes(Day,as.numeric(Min_Temperature),col='3')) +
  geom_line(data=MtRainier_coopsnowsep_skatecreek,aes(Day,as.numeric(Max_Temperature),col='4')) +
geom_line(data=MtRainier_coopsnowsep_Paradise,aes(Day,as.numeric(Min_Temperature),col='5')) +
  geom_line(data=MtRainier_coopsnowsep_Paradise,aes(Day,as.numeric(Max_Temperature),col='6')) +

 
   theme_classic() + labs(x="Date", y="Temperature(°C)  ",subtitle="Coop/Snotel -  Mt Rainier- Minimum/Max Recorded every day (2018) ",                                                                                                   caption="Data Source : utah state climate center") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4','5','6'), labels = c('841(Longmire)-Min ','841(Longmire)-Max ','1149(Skatecreek)-Min','1149(Skatecreek)-Max',"1654(Paradise)-Min","1654(Paradise)-Max"))

Looking at AG05 which is near Longmire

Lets look at one site

mclim_AG05_TN01_2018<- read.csv('./data/DATALOG-AG05-TN01.CSV')
names(mclim_AG05_TN01_2018) <- c('time','nodeid','temp','batt')
mclim_AG05_TN01_2018$time <- as.POSIXct(mclim_AG05_TN01_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AG05_TN01_2018$hr <- hour(mclim_AG05_TN01_2018$time)
mclim_AG05_TN01_2018$minute<- minute(mclim_AG05_TN01_2018$time)
mclim_AG05_TN01_2018$day <- day(mclim_AG05_TN01_2018$time)
mclim_AG05_TN01_2018$month<- month(mclim_AG05_TN01_2018$time)

#Roughly one feet apart
mclim_AG05_TN01_2018$height <- 0

mclim_AG05_TN01_2018[mclim_AG05_TN01_2018$nodeid=='28E21777910602CF' ,]$height <- 0.6
mclim_AG05_TN01_2018[mclim_AG05_TN01_2018$nodeid=='28DE0577910A02ED' ,]$height <- 1.2
mclim_AG05_TN01_2018[mclim_AG05_TN01_2018$nodeid=='2851BA7791090256' ,]$height <- 0.3
mclim_AG05_TN01_2018[mclim_AG05_TN01_2018$nodeid=='2885827791080230' ,]$height <- 0.9

## Day plot , Representive day
mclim_AG05_TN01_2018 %>% filter(month(time) %in% '9') %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AG05- Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

Plot Longmire and Micromet

# take height 1.2



mclim_AG05_TN01_2018 %>% filter(month(time) %in% '9' & height == 1.2) %>%
group_by(month,day) %>%
mutate(minT = min(temp),maxT=max(temp)) %>%  
ggplot() + 
geom_point(aes(day,minT,col='1')) +
geom_point(aes(day,maxT,col='2')) +  
  geom_line(data=MtRainier_coopsnowsep_longmire[MtRainier_coopsnowsep_longmire$month==9,],aes(day,as.numeric(Min_Temperature),col='3')) +
  geom_line(data=MtRainier_coopsnowsep_longmire[MtRainier_coopsnowsep_longmire$month==9,],aes(day,as.numeric(Max_Temperature),col='4')) +
theme_minimal() +
ggtitle("Variation in temperature at AG05 TN01- Closed with Longmire")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="",caption="Data Source : http://nanoclimate.org") +
  
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4'), labels = c('MM-921(Longmire)-Min ','MM-921(Longmire)-Max ','841(Longmire)-Min','841(Longmire)-Max'))

Validation

amb_4<- read_csv('./data/ambient-weather-4.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_5<- read_csv('./data/ambient-weather-5.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_6<- read_csv('./data/ambient-weather-6.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_7<- read_csv('./data/ambient-weather-7.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_8<- read_csv('./data/ambient-weather-8.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_9<- read_csv('./data/ambient-weather-9.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_10<- read_csv('./data/ambient-weather-10.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_11<- read_csv('./data/ambient-weather-11.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_12<- read_csv('./data/ambient-weather-12.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_13<- read_csv('./data/ambient-weather-13.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_14<- read_csv('./data/ambient-weather-14.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_15<- read_csv('./data/ambient-weather-15.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_16<- read_csv('./data/ambient-weather-16.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_17<- read_csv('./data/ambient-weather-17.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_18<- read_csv('./data/ambient-weather-18.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_19<- read_csv('./data/ambient-weather-19.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb_20<- read_csv('./data/ambient-weather-20.csv')
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   Datetime = col_character()
## )
## See spec(...) for full column specifications.
amb <- bind_rows(amb_4,
             amb_5,amb_6,.id = NULL)



names(amb) <- c('Datetime','Wind_Direction','Wind_Speed','Wind_Gust','Max_Daily_Gust','Outdoor_Temperature','Hourly_Rain','Event_Rain','Daily_Rain','Weekly_Rain','Monthly_Rain','Total_Rain','Relative_Pressure','Absolute_Pressure','Outdoor_Humidity','Indoor_Temperature','Indoor_Humidity','Ultra-Violet_Radiation_Index','Solar_Radiation','Feels_Like','Dew-Point') 
   
amb$time <- as.POSIXct(amb$Datetime, format="%m/%d/%Y %I:%M %p",tz="America/Los_Angeles")

amb$hr <- hour(amb$time)
amb$minute<- minute(amb$time)
amb$day <- day(amb$time)
amb$month<- month(amb$time)

amb %>%
ggplot() + 
geom_point(aes(time,Outdoor_Temperature ,col='1')) +
  geom_line(aes(time,Outdoor_Temperature)) +
 
theme_minimal() +
ggtitle("Variation in temperature at AG05 TN01- Closed with Longmire")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="",caption="Data Source : http://nanoclimate.org") +
  
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4'), labels = c('MM-Ambient ','MM-921(Longmire)-Max ','841(Longmire)-Min','841(Longmire)-Max'))

8.24 1-9-2019

Temperature profile (Diel), daily vs weekly

library(RColorBrewer)
mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 9 & day < 15)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp1)) %>%
  group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,m1,group=day ,color=as.factor(day),linetype = '1.2'),se=F)+
  
  scale_colour_manual("Temperature on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in temperature at 1.2m at site AE10 (1450m)")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/10/18 - 9/14/19",caption="Data Source : http://www.nanoclimate.org") 

Comparing it to Paradise

library(RColorBrewer)
MtRainier_Local_2017 %>%  filter (month %in% c(9) ) %>%
  filter( day > 9 & day < 15)  %>%
    group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,weathermetrics::fahrenheit.to.celsius(Paradise_5400),group=day ,color=as.factor(day))) +
  scale_colour_manual("Temperature on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
  theme_classic()  + ggtitle("Diel Variation in temperature at site Paradise (1645m) ")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/10/18 - 9/14/19",caption="Data Source : http://www.nwac.org") 

Comparing it to Sunrise Base

library(RColorBrewer)
MtRainier_Local_2017 %>%  filter (month %in% c(9) ) %>%
  filter( day > 9 & day < 15)  %>%
    group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,weathermetrics::fahrenheit.to.celsius(Sunrise_6410),group=day ,color=as.factor(day))) +
  scale_colour_manual("Temperature on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
  theme_classic()  + ggtitle("Diel Variation in temperature at site Sunrise Base (1953m) ")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/10/18 - 9/14/19",caption="Data Source : http://www.nwac.org") 

Need to add interpolated for Longmire.

Onto Radiation, use AE10-CN01

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 9 & day < 15)  %>%
        mutate(solrf = ((solar-39) * 1.8) + ((25 -temp1) * .0012)) %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(solrf)) %>%
  group_by(day,hr) %>% 
  ggplot() +
  geom_line(aes(hr,m1,group=day ,color=as.factor(day),linetype = '1.2'),se=F)+
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in radiation at 1.2m at site AE10 (1450m)")  + xlab("Hour") +
  ylab("Radiation (W/m^2)") + labs(colour = "Hour",
                                subtitle="9/10/18 - 9/14/19",caption="Data Source : http://www.nanoclimate.org") 

Paradise radiation

MtRainier_Solar %>% filter(month == 9 & year== 2018 & day %in% c(10,11,12,13,14) ) %>%
  ggplot() + 
  geom_line(aes(hr,Paradise_5400,group=day ,color=as.factor(day))) + 
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
  scale_x_continuous(breaks = c(seq(0,23,by=1))) +
   theme_classic() + labs(x="Date", y="Solar radiation(W/m2) ",subtitle="Met station Paradise (1645m) -  Mt Rainier  Solar ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  

MtRainier_Solar %>% filter(month == 9 & year== 2018 & day %in% c(10,11,12,13,14) ) %>%
  ggplot() + 
  geom_line(aes(hr,Sunrise_6880,group=day ,color=as.factor(day))) + 
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   theme_classic() + labs(x="Date", y="Solar radiation(W/m2) ",subtitle="Met station Sunrise base (2097m) -  Mt Rainier  Solar ",                                                                                                   caption="Data Source : http://nanoclimate.org") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  

Daily solar, but average a 12 min interval.

labelsx <- c( "0","-", "-", "-", "-" ,
                "1","-", "-", "-", "-",  "2" , "-", "-", "-", "-",
                "3", "-", "-", "-", "-",  "4",  "-", "-", "-", "-",
                "5", "-", "-", "-", "-",  "6",  "-", "-", "-", "-",
                "7", "-", "-", "-", "-", "8", "-", "-", "-", "-",
                "9", "-", "-", "-", "-", "10",  "-", "-", "-", "-",
                "11", "-", "-", "-", "-", "12",  "-", "-", "-", "-",
                "13", "-", "-", "-", "-", "14",  "-", "-", "-", "-",
                "15", "-", "-", "-", "-", "16",  "-", "-", "-", "-",
                "17", "-", "-", "-", "-", "18",  "-", "-", "-", "-",
                "19", "-", "-", "-", "-", "20",  "-", "-", "-", "-",
                "21", "-", "-", "-", "-", "22",  "-", "-", "-", "-",
                "23",  "-", "-", "-", "-")
mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 9 & day < 11)  %>%
        mutate(solrf = ((solar-39) * 1.8) + ((25 -temp1) * .0012)) %>%
  group_by(hr,minute) %>%
      summarise(solmin = mean(solrf)) %>%
      group_by(b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(hr,b) %>%
      summarize(meansol = mean(solmin),
                sd = sd(solmin)) %>%
      mutate(height="1.2",newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(height) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(index,meansol))+
        theme_minimal() +
      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelsx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in radiation at 1.2m at site AE10")  + xlab("Hour") +
  ylab("Radiation (W/m^2)") + labs(colour = "Hour",
                                subtitle="9/10/18 - 9/14/19",caption="Data Source : http://www.nanoclimate.org") 

8.25 1-10-2019

Combining the plots onto a single plot

Create three dataframes to combine into one

MtRainier_Local_2018<- read_csv('./data/mt-rainier_temperature_2018.csv')
## Parsed with column specification:
## cols(
##   `Date/Time (PST)` = col_datetime(format = ""),
##   `deg F - 5400' - Paradise` = col_double(),
##   `deg F - 6410' - Sunrise Base` = col_double(),
##   `deg F - 6880' - Sunrise Upper` = col_double(),
##   `deg F - 10110' - Camp Muir` = col_double()
## )
colnames(MtRainier_Local_2018) <- c('datetime','Paradise_5400','Sunrise_6410','Sunrise_6880','CampMuir_10110')

MtRainier_Local_2018$hr <- hour(MtRainier_Local_2018$datetime)
MtRainier_Local_2018$minute <- minute(MtRainier_Local_2018$datetime)
MtRainier_Local_2018$day <- day(MtRainier_Local_2018$datetime)
MtRainier_Local_2018$month<- month(MtRainier_Local_2018$datetime)
MtRainier_Local_2018$year<- year(MtRainier_Local_2018$datetime)

#subset dataframe for AE 10

ae1010to14 <- mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 9 & day < 15)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp1)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae1010to14$site <- 'AE10' 

Paradise_10to14 <- MtRainier_Local_2018 %>%  filter (month %in% c(9) ) %>%
  filter( day > 9 & day < 15)  %>% mutate(m1=weathermetrics::fahrenheit.to.celsius(Paradise_5400) ) %>%
    group_by(month,day,hr) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()


Paradise_10to14$site <- 'Paradise_5400'

Sunrise_10to14 <- MtRainier_Local_2018 %>%  filter (month %in% c(9) ) %>%
  filter( day > 9 & day < 15)   %>% mutate(m1=weathermetrics::fahrenheit.to.celsius(Sunrise_6880) ) %>%
    group_by(month,day,hr) %>% 

    dplyr::select(month,day,hr,m1) %>% as.data.frame()

Sunrise_10to14$site <- 'Sunrise_6880'

combined_10to14  <- rbind(ae1010to14,Paradise_10to14,Sunrise_10to14)

Do the plot

combined_10to14 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(10) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
   scale_linetype_manual("Site(m)",values=c("AE10"=1,"Paradise_5400"=2,"Sunrise_6880"=3)) +
  theme_classic()  + ggtitle("Variation in temperature at two different heights at AE10")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/10/18",caption="Data Source : http://www.nanoclimate.org") 

8.26 1-11-2019

Grid plots for multiple days

combined_10to14 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day) +
   scale_linetype_manual("Site(m)",values=c("AE10"=1,"Paradise_5400"=2,"Sunrise_6880"=3)) +
  theme_classic()  + ggtitle("Diel variation at differmt sites in comparion to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="9/10/18",caption="Data Source : http://www.nanoclimate.org") 

Grid for two weeks

ae10_5to15 <- mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp1)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_5to15$site <- 'AE10_1450' 

Paradise_5to15 <- MtRainier_Local_2018 %>%  filter (month %in% c(9) ) %>%
  filter( day > 4 & day < 16)   %>% mutate(m1=(Paradise_5400 - 32) * (5/9)) %>%
    group_by(month,day,hr) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()


Paradise_5to15$site <- 'Paradise_1645'

Sunrise_5to15 <- MtRainier_Local_2018 %>%  filter (month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>% mutate(m1= weathermetrics::fahrenheit.to.celsius(Sunrise_6880)) %>%
    group_by(month,day,hr) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()

Sunrise_5to15$site <- 'Sunrise_2097'

combined_5to15  <- rbind(ae10_5to15,Paradise_5to15,Sunrise_5to15)


combined_5to15 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10_1450"=1,"Paradise_1645"=2,"Sunrise_2097"=3)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

Combine Solar radiation

ae10_5to15_solar <-  mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
        mutate(solrf = ((solar-39) * 1.8) + ((25 -temp1) * .0012)) %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(solrf)) %>%
  group_by(day,hr) %>%  as.data.frame()


ae10_5to15_solar$site <- 'AE10_1450' 

Paradise_5to15_solar <- MtRainier_Solar %>%  filter (month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>% 
    summarise(m1= mean(Paradise_5400)) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()


Paradise_5to15_solar$site <- 'Paradise_1645'

Sunrise_5to15_solar <- MtRainier_Solar %>%  filter (month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>% 
    summarise(m1= mean(Sunrise_6880)) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()

Sunrise_5to15_solar$site <- 'Sunrise_2097'

combined_5to15_solar  <- rbind(ae10_5to15_solar,Paradise_5to15_solar,Sunrise_5to15_solar)


combined_5to15_solar %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10_1450"=1,"Paradise_1645"=2,"Sunrise_2097"=3)) +
  theme_classic()  + ggtitle("Diel variation Solar radiation at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Solar radiation(W/m2)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

10 to 14th of September

combined_5to15_solar %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10"=1,"Paradise_5400"=2,"Sunrise_6880"=3)) +
  theme_classic()  + ggtitle("Diel variation at differmt sites in comparion to micromet")  + xlab("Hour") +
  ylab("Solar radiation(W/m2)") + labs(colour = "Hour",
                                subtitle="",caption="Data Source : http://www.nanoclimate.org") 

Solar radiation profile at 12 min resolution

labelfx <- c( "0","", "", "", "" ,
                "1","", "", "", "" ,  "2" , "", "", "", "" ,
                "3", "", "", "", "" ,  "4",  "", "", "", "" ,
                "5", "", "", "", "",  "6",  "", "", "", "" ,
                "7", "", "", "", "" , "8", "", "", "", "" ,
                "9", "", "", "", "" , "10", "", "", "", "" ,
                "11", "", "", "", "" , "12",  "", "", "", "" ,
                "13", "", "", "", "" , "14",  "", "", "", "" ,
                "15", "", "", "", "" , "16",  "", "", "", "" ,
                "17", "", "", "", "" , "18",  "", "", "", "" ,
                "19", "", "", "", "" , "20",  "", "", "", "" ,
                "21", "", "", "", "" , "22",  "", "", "", "" ,
                "23",  "","", "", "" )

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
        mutate(solrf = ((solar-39) * 1.8) + ((25 -temp1) * .0012)) %>%
  group_by(day,hr,minute) %>%
      summarise(solmin = mean(solrf)) %>%
      group_by(day,b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(day,hr,b) %>%
      summarize(meansol = mean(solmin),
                sd = sd(solmin)) %>%
      mutate(height="1.2",newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(day,height) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(hr,meansol))+
        theme_minimal() +
  facet_grid(.~ day,scales = "free") +
#      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelfx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in radiation at 1.2m at site AE10")  + xlab("Hour") +
  ylab("Radiation (W/m^2)") + labs(colour = "Hour",
                                subtitle="12 min resolution",caption="Data Source : http://www.nanoclimate.org") 

Selective plots

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 8 & day < 13)  %>%
        mutate(solrf = ((solar-39) * 1.8) + ((25 -temp1) * .0012)) %>%
  group_by(day,hr,minute) %>%
      summarise(solmin = mean(solrf)) %>%
      group_by(day,b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(day,hr,b) %>%
      summarize(meansol = mean(solmin),
                sd = sd(solmin)) %>%
      mutate(height="1.2",newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(day,height) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(index,meansol))+
        theme_minimal() +
  facet_grid(.~ day,scales = "free") +
      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelfx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in radiation at 1.2m at site AE10")  + xlab("Hour") +
  ylab("Radiation (W/m^2)") + labs(colour = "Hour",
                                subtitle="9/9/18 - 9/12/19",caption="Data Source : http://www.nanoclimate.org") 

Wind profiles at 12 min resolution (0.3m)

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 7)  %>%
  group_by(day,height,hr,minute) %>%
      summarise(wspd1 = mean(windspeed4)) %>%
      group_by(day,b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(day,hr,b) %>%
      summarize(meanw1 = mean(wspd1),
                sd = sd(wspd1)) %>%
      mutate(ht='1.2',newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(day,ht) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(index,meanw1))+
        theme_minimal() +
  facet_grid(.~ day,scales = "free") +
      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelfx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in wind profile at 0.3m at site AE10")  + xlab("Hour") +
  ylab("Wind speed (km/hr)") + labs(colour = "Hour",
                                subtitle="12 min resolution",caption="Data Source : http://www.nanoclimate.org") 

Wind profiles at 12 min resolution (0.6m)

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
  group_by(day,height,hr,minute) %>%
      summarise(wspd1 = mean(windspeed3)) %>%
      group_by(day,b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(day,hr,b) %>%
      summarize(meanw1 = mean(wspd1),
                sd = sd(wspd1)) %>%
      mutate(ht='1.2',newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(day,ht) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(index,meanw1))+
        theme_minimal() +
  facet_grid(.~ day,scales = "free") +
      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelfx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in wind profile at 0.6m at site AE10")  + xlab("Hour") +
  ylab("Radiation (km/hr)") + labs(colour = "Hour",
                                subtitle="12 min resolution",caption="Data Source : http://www.nanoclimate.org") 

Wind profiles at 12 min resolution (0.9m)

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
  group_by(day,height,hr,minute) %>%
      summarise(wspd1 = mean(windspeed2)) %>%
      group_by(day,b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(day,hr,b) %>%
      summarize(meanw1 = mean(wspd1),
                sd = sd(wspd1)) %>%
      mutate(ht='1.2',newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(day,ht) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(index,meanw1))+
        theme_minimal() +
  facet_grid(.~ day,scales = "free") +
      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelfx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in wind profile at 0.9m at site AE10")  + xlab("Hour") +
  ylab("Windspeed (km/hr)") + labs(colour = "Hour",
                                subtitle="12 min resolution",caption="Data Source : http://www.nanoclimate.org") 

Wind profiles at 12 min resolution (1.2m)

mclim_AE10_CN01_2018 %>%  filter (!is.na(mclim_AE10_CN01_2018$minute) & month %in% c(9) ) %>%
  filter( day > 4 & day < 16)  %>%
  group_by(day,height,hr,minute) %>%
      summarise(wspd1 = mean(windspeed1)) %>%
      group_by(day,b = gl(ceiling(n()/4), 4, n())) %>%
      group_by(day,hr,b) %>%
      summarize(meanw1 = mean(wspd1),
                sd = sd(wspd1)) %>%
      mutate(ht='1.2',newx= as.numeric(paste(hr,b,sep=""))) %>%  #select(newx) %>% distinct(newx)
      dplyr::group_by(day,ht) %>%
      mutate(index=1:n()) %>%
   
  ggplot() +
  geom_line(aes(index,meanw1))+
        theme_minimal() +
  facet_grid(.~ day,scales = "free") +
      scale_x_continuous(breaks = seq(0,119,by=1), limits = c(0,120),labels = labelfx) +
  
  scale_colour_manual("Solar radiatiion on day", breaks = c("10","11", "12","13","14"), values = brewer.pal(5, "Set1")) +
   scale_linetype_manual("Height(m)",values=c("1.2"=1)) +
  theme_classic()  + ggtitle("Diel Variation in wind profile at 1.2m at site AE10")  + xlab("Hour") +
  ylab("Radiation (km/hr)") + labs(colour = "Hour",
                                subtitle="12 min resolution",caption="Data Source : http://www.nanoclimate.org") 

Notes from the PI meeting

Remarks

  • Temperature readings from AE10 still looks very buffered (not tracking the regional)
  • Solar radiation magnitude not matching-up, hard to believe canopy buffering is the cause. If canopy buffering was the case, it wont be that be that influential after the peak solar radiation.
  • Battery hypothesis that being cold is making it lose the ability to capture the signal.

Next steps

  • Compare with Longmire
  • Compare with Skate creek and other MM sites
  • If the site is buffered, previous years comparison sgould highlight that (Aji’s hypothesis), there are old-growth forests. ()

Compare with

file = 'AE10-A1_hourly.csv'

 # Read the file
   onest <- read.csv(paste("data/" , file, sep = ""))
   # Update the tumestamp
   onest$dt <- strptime(onest$DATE, format = "%Y-%m-%d %H:%M:%S")
   # add the year
   onest$year <- as.numeric(substring(as.character(onest$DATE),1,4))
   # add txn date
   onest$dt_txn <- as.POSIXct(onest$DATE,ormat = "%Y-%m-%d %H:%M:%S")
   # Add month column
   # Add day column
   # Add hour column
   onest$month <- as.numeric(format(onest$dt_txn,"%m"))
   onest$day <- as.numeric(format(onest$dt_txn,"%d"))
   onest$hr <- as.numeric(format(onest$dt,"%H"))
   
   onest %>% 
     dplyr::select( "series_xts" ,     "year"  ,    
 "dt_txn"   ,  "month"  ,    "day"  ,      "hr") %>%
     filter (month %in% c(9) ) %>% 
       group_by(year,month,day,hr) %>% 
    summarise(m1= mean(series_xts)) %>% 
  filter( day %in% c(5,6,7,8,9) )  %>% 
    ggplot() +
  geom_line(aes(hr,m1,group=as.factor(day),linetype = as.factor(day)),se=F)+ 
  facet_grid(. ~ year, scales = "free") +
 #  scale_linetype_manual("Site(m)",values=c("AE10_1450"=1,"Paradise_1645"=2,"Sunrise_2097"=3)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

Compare 14,15 and 2016. I hypitheize that southside slope, facng tatoosh range, its a deep valley which is giving rise to the unque microclimate

Paradise_5400_2017<- read.csv('./data/Paradise_5400_feet_2017.csv')
Paradise_5400_2016<- read.csv('./data/Paradise_5400_feet_2016.csv')
Paradise_5400_2015<- read.csv('./data/Paradise_5400_feet_2015.csv')
Paradise_5400_2014<- read.csv('./data/Paradise_5400_feet_2014.csv')

Paradise_5400_2017$date <- as.Date(Paradise_5400_2017$Date.Time..PST., "%Y-%m-%d")
Paradise_5400_2017$datetime <- as.Date(Paradise_5400_2017$Date.Time..PST., "%Y-%m-%d %H:%M")
library(lubridate)
library(gridExtra)
Paradise_5400_2017$hr <-lubridate::hour(lubridate::as_datetime(Paradise_5400_2017$Date.Time..PST.))
Paradise_5400_2017$min <-lubridate::minute(lubridate::as_datetime(Paradise_5400_2017$Date.Time..PST.))
Paradise_5400_2017$month <- as.numeric (strftime(Paradise_5400_2017$Date.Time..PST.,'%m'))
Paradise_5400_2017$day <-as.numeric (strftime(Paradise_5400_2017$Date.Time..PST.,'%d'))

# 2014


Paradise_5400_2014$date <- as.Date(Paradise_5400_2014$Date.Time..PST., "%Y-%m-%d")
Paradise_5400_2014$datetime <- as.Date(Paradise_5400_2014$Date.Time..PST., "%Y-%m-%d %H:%M")
Paradise_5400_2014$hr <-lubridate::hour(lubridate::as_datetime(Paradise_5400_2014$Date.Time..PST.))
Paradise_5400_2014$min <-lubridate::minute(lubridate::as_datetime(Paradise_5400_2014$Date.Time..PST.))
Paradise_5400_2014$month <- as.numeric (strftime(Paradise_5400_2014$Date.Time..PST.,'%m'))
Paradise_5400_2014$day <-as.numeric (strftime(Paradise_5400_2014$Date.Time..PST.,'%d'))

# 2015


Paradise_5400_2015$date <- as.Date(Paradise_5400_2015$Date.Time..PST., "%Y-%m-%d")
Paradise_5400_2015$datetime <- as.Date(Paradise_5400_2015$Date.Time..PST., "%Y-%m-%d %H:%M")
Paradise_5400_2015$hr <-lubridate::hour(lubridate::as_datetime(Paradise_5400_2015$Date.Time..PST.))
Paradise_5400_2015$min <-lubridate::minute(lubridate::as_datetime(Paradise_5400_2015$Date.Time..PST.))
Paradise_5400_2015$month <-  as.numeric (strftime(Paradise_5400_2015$Date.Time..PST.,'%m'))
Paradise_5400_2015$day <- as.numeric (strftime(Paradise_5400_2015$Date.Time..PST.,'%d'))


# 2016


Paradise_5400_2016$date <- as.Date(Paradise_5400_2016$Date.Time..PST., "%Y-%m-%d")
Paradise_5400_2016$datetime <- as.Date(Paradise_5400_2016$Date.Time..PST., "%Y-%m-%d %H:%M")
Paradise_5400_2016$hr <-lubridate::hour(lubridate::as_datetime(Paradise_5400_2016$Date.Time..PST.))
Paradise_5400_2016$min <-lubridate::minute(lubridate::as_datetime(Paradise_5400_2016$Date.Time..PST.))
Paradise_5400_2016$month <-  as.numeric (strftime(Paradise_5400_2016$Date.Time..PST.,'%m'))
Paradise_5400_2016$day <- as.numeric (strftime(Paradise_5400_2016$Date.Time..PST.,'%d'))


ae10_A1_1to30_2015 <- onest %>% 
     dplyr::select( "series_xts" ,     "year"  ,    
 "dt_txn"   ,  "month"  ,    "day"  ,      "hr") %>%
     filter (month %in% c(9) & year ==2015) %>% 
   filter(day > 0 & day < 31)  %>%
       group_by(month,day,hr) %>% 
    summarise(m1= mean(series_xts)) %>%
  dplyr::select(month,day,hr,m1) %>% as.data.frame()

ae10_A1_1to30_2015$site <- 'AE10_A1_1450' 

ae10_A1_1to30_2016 <- onest %>% 
     dplyr::select( "series_xts" ,     "year"  ,    
 "dt_txn"   ,  "month"  ,    "day"  ,      "hr") %>%
     filter (month %in% c(9) & year ==2016) %>% 
   filter(day > 0 & day < 31)  %>%
       group_by(month,day,hr) %>% 
    summarise(m1= mean(series_xts)) %>%
  dplyr::select(month,day,hr,m1) %>% as.data.frame()

ae10_A1_1to30_2016$site <- 'AE10_A1_1450' 

Paradise_1to30_2015 <-Paradise_5400_2015 %>%  filter (month %in% c(9) ) %>%
  filter(day > 0 & day < 31)  %>%
    group_by(month,day,hr) %>% 
    summarise(m1= mean(weathermetrics::fahrenheit.to.celsius(Temperature..deg.F.))) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()


Paradise_1to30_2015$site <- 'Paradise_2015_1645'

Paradise_1to30_2016 <-Paradise_5400_2016 %>%  filter (month %in% c(9) ) %>%
  filter(day > 0 & day < 31)  %>%
    group_by(month,day,hr) %>% 
    summarise(m1= mean(weathermetrics::fahrenheit.to.celsius(Temperature..deg.F.))) %>% 
    dplyr::select(month,day,hr,m1) %>% as.data.frame()


Paradise_1to30_2016$site <- 'Paradise_2016_1645'

combined_1to30_A1_2015  <- rbind(ae10_A1_1to30_2015,Paradise_1to30_2015)   
combined_1to30_A1_2016  <- rbind(ae10_A1_1to30_2016,Paradise_1to30_2016) 

8.27 1-12-2019

Do the comparison with year 2015 against M1

combined_1to30_A1_2015 %>%  filter (month %in% c(9) ) %>%
 # filter( day %in% c(10,11,12,13,14) ) %>%
     filter(day > 0 & day < 31)  %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10_A1_1450"=1,"Paradise_2015_1645"=2,"Sunrise_6880"=3)) +
  theme_classic()  + ggtitle("Diel variation at different sites in comparion to A1")  + xlab("Hour") +
  ylab("Solar radiation(W/m2)") + labs(colour = "Hour",
                                subtitle="Year 2015",caption="Data Source : http://www.nanoclimate.org") 

Do the comparison with year 2016 against M1

combined_1to30_A1_2016 %>%  filter (month %in% c(9) ) %>%
 # filter( day %in% c(10,11,12,13,14) ) %>%
     filter(day > 0 & day < 31)  %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10_A1_1450"=1,"Paradise_2016_1645"=2,"Sunrise_6880"=3)) +
  theme_classic()  + ggtitle("Diel variation at different sites in comparion to A1")  + xlab("Hour") +
  ylab("Solar radiation(W/m2)") + labs(colour = "Hour",
                                subtitle="Year 2016",caption="Data Source : http://www.nanoclimate.org") 

Looks like A1 is tracking quite well, adhering to principles that air temperature is quite in sync and with boundary principles, and being in the canopy does not seem to be afffecting its temperatyres .

Lets now test the hypothesis that maybe other three sites in AE10 might be capturing the signal quite well if battery is givng out.

Here I hypothesize that being in deep understory, ours should be more refglectant of the temp above ground. Inversion …..

ae10_TN01_5to15 <- mclim_AE10_TN01_2018 %>%  
  filter ( month %in% c(9) & height == 0.9) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_TN01_5to15$site <- 'AE10_TN01_1450' 

ae10_TN02_5to15 <- mclim_AE10_TN02_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_TN02_5to15$site <- 'AE10_TN02_1450' 

ae10_TN03_5to15 <- mclim_AE10_TN03_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_TN03_5to15$site <- 'AE10_TN03_1450' 


combined_5to15_all_MMAE10  <- rbind(ae10_TN01_5to15,
                                    ae10_TN02_5to15,
                                    ae10_TN03_5to15,
                                    ae10_5to15,
                                    Paradise_5to15,
                                    Sunrise_5to15)


combined_5to15_all_MMAE10 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10_TN01_1450"=1,"AE10_TN02_1450"=2,"AE10_TN03_1450"=3,"AE10_1450"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

some inetersting facts, plots terrible, be selective

combined_5to15_all_MMAE10 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(10,11,12) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,group=site,linetype = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_linetype_manual("Site(m)",values=c("AE10_TN01_1450"=1,"AE10_TN02_1450"=2,"AE10_TN03_1450"=3,"AE10_1450"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

Line types not legible, lets try the color

combined_5to15_all_MMAE10 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,color=site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_color_manual("Site(m)",values=c("AE10_TN01_1450"=1,"AE10_TN02_1450"=2,"AE10_TN03_1450"=3,"AE10_1450"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

Wow, something going on, our three MM are quite inline.

combined_5to15_all_MMAE10 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(10,11,12) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,color=site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_color_manual("Site(m)",values=c("AE10_TN01_1450"=1,"AE10_TN02_1450"=2,"AE10_TN03_1450"=3,"AE10_1450"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
  theme_classic()  + ggtitle("Diel variation at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

theme_Publication <- function(base_size=14, base_family="helvetica") {
      library(grid)
      library(ggthemes)
      (theme_foundation(base_size=base_size, base_family=base_family)
       + theme(plot.title = element_text(face = "bold",
                                         size = rel(1.2), hjust = 0.5),
               text = element_text(),
               panel.background = element_rect(colour = NA),
               plot.background = element_rect(colour = NA),
               panel.border = element_rect(colour = NA),
               axis.title = element_text(face = "bold",size = rel(1)),
               axis.title.y = element_text(angle=90,vjust =2),
               axis.title.x = element_text(vjust = -0.2),
               axis.text = element_text(), 
               axis.line = element_line(colour="black"),
               axis.ticks = element_line(),
               panel.grid.major = element_line(colour="#f0f0f0"),
               panel.grid.minor = element_blank(),
               legend.key = element_rect(colour = NA),
               legend.position = "bottom",
               legend.direction = "horizontal",
               legend.key.size= unit(0.2, "cm"),
               legend.margin = unit(0, "cm"),
               legend.title = element_text(face="italic"),
               plot.margin=unit(c(10,5,5,5),"mm"),
               strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
               strip.text = element_text(face="bold")
          ))
      
}
presentation_theme <- theme(axis.text = element_text(size = 25, colour = "black"),
    axis.title.x = element_text(size = 30), axis.title.y = element_text(size = 30,
        angle = 0), strip.text.x = element_text(size = 25, face = "italic"),
    strip.text.y = element_text(size = 25, angle = 270, face = "italic"), plot.title = element_text(size = 35,
        face = "bold"), legend.text = element_text(size = 20), legend.title = element_text(size = 25,
        face = "bold"))

my_theme <- theme(axis.text.x = element_text(angle = 45, vjust = 0.9,
                hjust = 0.9, size = rel(3)))
png("Spatial-MC.png",  width = 1024, height = 768, units = 'px')
combined_5to15_all_MMAE10 %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(10,11,12) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,color=site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_color_manual("Site(m)",values=c("AE10_TN01_1450"=1,"AE10_TN02_1450"=2,"AE10_TN03_1450"=3,"AE10_1450"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
 my_theme  + ggtitle("Diel variation at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 
dev.off()
## quartz_off_screen 
##                 2

Something unique,

8.28 1-15-2019

look how TN03 is the colder of them all, and also you see the tiering where TN01 and AE10 CN01 are relatively the same. This was done at .9m , so not the convential height the weater stations use.

8.29 1-16-2019

Load other stations at AG05

AG05 - TN02

Data cirruption - 9/9 from 8 pm onwards to 1am next day. 2871D7779109021D Removed the faulty record

mclim_AG05_TN02_2018<- read.csv('./data/DATALOG-AG05-TN02.CSV')
names(mclim_AG05_TN02_2018) <- c('time','nodeid','temp','batt')
mclim_AG05_TN02_2018$time <- as.POSIXct(mclim_AG05_TN02_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AG05_TN02_2018$hr <- hour(mclim_AG05_TN02_2018$time)
mclim_AG05_TN02_2018$minute<- minute(mclim_AG05_TN02_2018$time)
mclim_AG05_TN02_2018$day <- day(mclim_AG05_TN02_2018$time)
mclim_AG05_TN02_2018$month<- month(mclim_AG05_TN02_2018$time)

#Roughly one feet apart
mclim_AG05_TN02_2018$height <- 0

mclim_AG05_TN02_2018[mclim_AG05_TN02_2018$nodeid=='282662779114024E' ,]$height <- 0.6
mclim_AG05_TN02_2018[mclim_AG05_TN02_2018$nodeid=='28121077910602EC' ,]$height <- 1.2
mclim_AG05_TN02_2018[mclim_AG05_TN02_2018$nodeid=='2871D7779109021D' ,]$height <- 0.3
mclim_AG05_TN02_2018[mclim_AG05_TN02_2018$nodeid=='28AE157791060244' ,]$height <- 0.9

## Day plot , Representive day
mclim_AG05_TN02_2018 %>% filter(month(time) %in% '9' & day %in% c(10)) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AG05- TN02 Closed")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

AG05 TN03

mclim_AG05_TN03_2018<- read.csv('./data/DATALOG-AG05-TN03.CSV')
names(mclim_AG05_TN03_2018) <- c('time','nodeid','temp','batt')
mclim_AG05_TN03_2018$time <- as.POSIXct(mclim_AG05_TN03_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AG05_TN03_2018$hr <- hour(mclim_AG05_TN03_2018$time)
mclim_AG05_TN03_2018$minute<- minute(mclim_AG05_TN03_2018$time)
mclim_AG05_TN03_2018$day <- day(mclim_AG05_TN03_2018$time)
mclim_AG05_TN03_2018$month<- month(mclim_AG05_TN03_2018$time)

#Roughly one feet apart
mclim_AG05_TN03_2018$height <- 0

mclim_AG05_TN03_2018[mclim_AG05_TN03_2018$nodeid=='282E997791080298' ,]$height <- 0.6
mclim_AG05_TN03_2018[mclim_AG05_TN03_2018$nodeid=='28A005779106022B' ,]$height <- 1.2
mclim_AG05_TN03_2018[mclim_AG05_TN03_2018$nodeid=='286EF577910A024C' ,]$height <- 0.3
mclim_AG05_TN03_2018[mclim_AG05_TN03_2018$nodeid=='2886E177910902F2' ,]$height <- 0.9

## Day plot , Representive day
mclim_AG05_TN03_2018 %>% filter(month(time) %in% '9' & day %in% c(10)) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AG05- TN03 Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height (m)",
                                subtitle="",caption="Data Source : http://nanoclimate.org") 

AM16

Narada falls, expect it to be much cooler as its a bog where the CN is and others are little above.

TN01

mclim_AM16_TN01_2018<- read.csv('./data/DATALOG-AM16-TN01.CSV')
names(mclim_AM16_TN01_2018) <- c('time','nodeid','temp','batt')
mclim_AM16_TN01_2018$time <- as.POSIXct(mclim_AM16_TN01_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AM16_TN01_2018$hr <- hour(mclim_AM16_TN01_2018$time)
mclim_AM16_TN01_2018$minute<- minute(mclim_AM16_TN01_2018$time)
mclim_AM16_TN01_2018$day <- day(mclim_AM16_TN01_2018$time)
mclim_AM16_TN01_2018$month<- month(mclim_AM16_TN01_2018$time)

#Roughly one feet apart
mclim_AM16_TN01_2018$height <- 0

mclim_AM16_TN01_2018[mclim_AM16_TN01_2018$nodeid=='28D216779104027E' ,]$height <- 0.6
mclim_AM16_TN01_2018[mclim_AM16_TN01_2018$nodeid=='28BC8B77910802B8' ,]$height <- 1.2
mclim_AM16_TN01_2018[mclim_AM16_TN01_2018$nodeid=='28B50A7791040265' ,]$height <- 0.3
mclim_AM16_TN01_2018[mclim_AM16_TN01_2018$nodeid=='28B18877910802BC' ,]$height <- 0.9

## Day plot , Representive day
mclim_AM16_TN01_2018 %>% filter(month(time) %in% '9') %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AM16- TN01 Closed")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

mclim_AM16_TN02_2018<- read.csv('./data/DATALOG-AM16-TN02.CSV')
names(mclim_AM16_TN02_2018) <- c('time','nodeid','temp','batt')
mclim_AM16_TN02_2018$time <- as.POSIXct(mclim_AM16_TN02_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AM16_TN02_2018$hr <- hour(mclim_AM16_TN02_2018$time)
mclim_AM16_TN02_2018$minute<- minute(mclim_AM16_TN02_2018$time)
mclim_AM16_TN02_2018$day <- day(mclim_AM16_TN02_2018$time)
mclim_AM16_TN02_2018$month<- month(mclim_AM16_TN02_2018$time)

#Roughly one feet apart
mclim_AM16_TN02_2018$height <- 0

mclim_AM16_TN02_2018[mclim_AM16_TN02_2018$nodeid=='28439C77910802C3' ,]$height <- 0.6
mclim_AM16_TN02_2018[mclim_AM16_TN02_2018$nodeid=='28F4B977910902AF' ,]$height <- 1.2
mclim_AM16_TN02_2018[mclim_AM16_TN02_2018$nodeid=='28D9657791100272' ,]$height <- 0.3
mclim_AM16_TN02_2018[mclim_AM16_TN02_2018$nodeid=='28C928779106026A' ,]$height <- 0.9

## Day plot , Representive day
mclim_AM16_TN02_2018 %>% filter(month(time) %in% '9') %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AM16- TN02 Closed")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

Need to fix the hour

mclim_AM16_TN03_2018<- read.csv('./data/DATALOG-AM16-TN03.CSV')
names(mclim_AM16_TN03_2018) <- c('time','nodeid','temp','batt')
mclim_AM16_TN03_2018$time <- as.POSIXct(mclim_AM16_TN03_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_AM16_TN03_2018$hr <- hour(mclim_AM16_TN03_2018$time)
mclim_AM16_TN03_2018$minute<- minute(mclim_AM16_TN03_2018$time)
mclim_AM16_TN03_2018$day <- day(mclim_AM16_TN03_2018$time)
mclim_AM16_TN03_2018$month<- month(mclim_AM16_TN03_2018$time)

#Roughly one feet apart
mclim_AM16_TN03_2018$height <- 0

mclim_AM16_TN03_2018[mclim_AM16_TN03_2018$nodeid=='28A64677910302C1' ,]$height <- 0.6
mclim_AM16_TN03_2018[mclim_AM16_TN03_2018$nodeid=='28542677910A027E' ,]$height <- 1.2
mclim_AM16_TN03_2018[mclim_AM16_TN03_2018$nodeid=='28EE7977910802DD' ,]$height <- 0.3
mclim_AM16_TN03_2018[mclim_AM16_TN03_2018$nodeid=='283D867791080289' ,]$height <- 0.9

## Day plot , Representive day
mclim_AM16_TN03_2018 %>% filter(month(time) %in% '9' & height !=0) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at AM16- TN03 Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

To do CN01 for AM16 which is on the bog.

TO04 - expect it to be cold but stull warmer than the rest

mclim_TO04_TN01_2018<- read.csv('./data/DATALOG-TO04-TN01.CSV')
names(mclim_TO04_TN01_2018) <- c('time','nodeid','temp','batt')
mclim_TO04_TN01_2018$time <- as.POSIXct(mclim_TO04_TN01_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_TO04_TN01_2018$hr <- hour(mclim_TO04_TN01_2018$time)
mclim_TO04_TN01_2018$minute<- minute(mclim_TO04_TN01_2018$time)
mclim_TO04_TN01_2018$day <- day(mclim_TO04_TN01_2018$time)
mclim_TO04_TN01_2018$month<- month(mclim_TO04_TN01_2018$time)

#Roughly one feet apart
mclim_TO04_TN01_2018$height <- 0

mclim_TO04_TN01_2018[mclim_TO04_TN01_2018$nodeid=='2883A377910802B7' ,]$height <- 0.6
mclim_TO04_TN01_2018[mclim_TO04_TN01_2018$nodeid=='28B14477910F02D1' ,]$height <- 1.2
mclim_TO04_TN01_2018[mclim_TO04_TN01_2018$nodeid=='28783877910402B7' ,]$height <- 0.3
mclim_TO04_TN01_2018[mclim_TO04_TN01_2018$nodeid=='286919779106027F' ,]$height <- 0.9

## Day plot , Representive day
mclim_TO04_TN01_2018 %>% filter(month(time) %in% '9' & temp != -127) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at TO04- TN01 Closed")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

mclim_TO04_TN02_2018<- read.csv('./data/DATALOG-TO04-TN02.CSV')
names(mclim_TO04_TN02_2018) <- c('time','nodeid','temp','batt')
mclim_TO04_TN02_2018$time <- as.POSIXct(mclim_TO04_TN02_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_TO04_TN02_2018$hr <- hour(mclim_TO04_TN02_2018$time)
mclim_TO04_TN02_2018$minute<- minute(mclim_TO04_TN02_2018$time)
mclim_TO04_TN02_2018$day <- day(mclim_TO04_TN02_2018$time)
mclim_TO04_TN02_2018$month<- month(mclim_TO04_TN02_2018$time)

#Roughly one feet apart
mclim_TO04_TN02_2018$height <- 0

mclim_TO04_TN02_2018[mclim_TO04_TN02_2018$nodeid=='28A13C7791130278' ,]$height <- 0.6
mclim_TO04_TN02_2018[mclim_TO04_TN02_2018$nodeid=='2893977791080277' ,]$height <- 1.2
mclim_TO04_TN02_2018[mclim_TO04_TN02_2018$nodeid=='28414B77910F02CC' ,]$height <- 0.3
mclim_TO04_TN02_2018[mclim_TO04_TN02_2018$nodeid=='28F94277910F0299' ,]$height <- 0.9

## Day plot , Representive day
mclim_TO04_TN02_2018 %>% filter(month(time) %in% '9' & temp != -127) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at TO04- TN02 Open")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

mclim_TO04_TN03_2018<- read.csv('./data/DATALOG-TO04-TN03.CSV')
names(mclim_TO04_TN03_2018) <- c('time','nodeid','temp','batt')
mclim_TO04_TN03_2018$time <- as.POSIXct(mclim_TO04_TN03_2018$time, "%Y/%m/%d %H:%M:%S")

#Add hour month and day
## 11-05-2018
mclim_TO04_TN03_2018$hr <- hour(mclim_TO04_TN03_2018$time)
mclim_TO04_TN03_2018$minute<- minute(mclim_TO04_TN03_2018$time)
mclim_TO04_TN03_2018$day <- day(mclim_TO04_TN03_2018$time)
mclim_TO04_TN03_2018$month<- month(mclim_TO04_TN03_2018$time)

#Roughly one feet apart
mclim_TO04_TN03_2018$height <- 0

mclim_TO04_TN03_2018[mclim_TO04_TN03_2018$nodeid=='28CC077791040287' ,]$height <- 0.6
mclim_TO04_TN03_2018[mclim_TO04_TN03_2018$nodeid=='288EEB77910902EE' ,]$height <- 1.2
mclim_TO04_TN03_2018[mclim_TO04_TN03_2018$nodeid=='28D7C67791090242' ,]$height <- 0.3
mclim_TO04_TN03_2018[mclim_TO04_TN03_2018$nodeid=='286EDA779109028E' ,]$height <- 0.9

## Day plot , Representive day
mclim_TO04_TN03_2018 %>% filter(month(time) %in% '9' & temp != -127) %>% 
ggplot( aes(time,temp,color = factor(height))) + geom_line() + theme_minimal() +
ggtitle("Variation in temperature at TO04- TN03 Closed")  + xlab("Date") +
  ylab("Temperature (°C)") + labs(colour = "Height(m)",
                                subtitle="9/17/2018",caption="Data Source : http://nanoclimate.org") 

8.30 1-17-2019

ae10_TN01 <- mclim_AE10_TN01_2018 %>%  
  filter ( month %in% c(9) & height == 0.9) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_TN01$site <- 'AE10_TN01' 

ag05_TN01 <- mclim_AG05_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ag05_TN01$site <- 'AG05_TN01' 

am16_TN01 <- mclim_AM16_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
am16_TN01$site <- 'AM16_TN01' 

TO04_TN01 <- mclim_TO04_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2 &  temp != -127) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
TO04_TN01$site <- 'TO04_TN01' 

combined_across_MM <- rbind(ae10_TN01,
                                    ag05_TN01,
                                    am16_TN01,
                                    TO04_TN01,
                                    Paradise_5to15,
                                    Sunrise_5to15)


combined_across_MM %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,color = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_color_manual("Site(m)",values=c("AE10_TN01"=1,"AG05_TN01"=2,"AM16_TN01"=3,"TO04_TN01"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

Battery voltages

ae10_TN01_batt <- mclim_AE10_TN01_2018 %>%  
  filter ( month %in% c(9) & height == 0.9) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(batt)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_TN01_batt$site <- 'AE10_TN01' 

ag05_TN01_batt <- mclim_AG05_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(batt)) %>%
  group_by(day,hr) %>%  as.data.frame()
ag05_TN01_batt$site <- 'AG05_TN01' 

am16_TN01_batt <- mclim_AM16_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(batt)) %>%
  group_by(day,hr) %>%  as.data.frame()
am16_TN01_batt$site <- 'AM16_TN01' 

TO04_TN01_batt <- mclim_TO04_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2 ) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(batt)) %>%
  group_by(day,hr) %>%  as.data.frame()
TO04_TN01_batt$site <- 'TO04_TN01' 

combined_batt_across_MM <- rbind(ae10_TN01_batt,
                                    ag05_TN01_batt,
                                    am16_TN01_batt,
                                    TO04_TN01_batt)


combined_batt_across_MM %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,color = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_color_manual("Site(m)",values=c("AE10_TN01"=1,"AG05_TN01"=2,"AM16_TN01"=3,"TO04_TN01"=4,"Paradise_1645"=5,"Sunrise_2097"=6)) +
  theme_classic()  + ggtitle("Diel variation in batt at different sMM sites")  + xlab("Hour") +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

Difference between the heights

ggplot(data=mclim_AM16_TN01_2018, aes(x=as.factor(height), y=temp)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AM16 -Narada Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4) +
  theme_minimal()

mclim_AE10_TN01_2018 %>% filter(temp != -127) %>%
ggplot(aes(x=as.factor(height), y=temp)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AE10 -Reflection Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4) +
  theme_minimal()

mclim_AG05_TN01_2018 %>% filter(temp != -127) %>%
ggplot(aes(x=as.factor(height), y=temp)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AG05 -Longmire Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4) +
  theme_minimal()

mclim_TO04_TN01_2018 %>% filter(temp != -127) %>%
ggplot(aes(x=as.factor(height), y=temp)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("TO04 -Devils Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

Open vs Closed - Expect to see higher temperatures ad more variability

AE10 - TN01 - Open AM16 - TN01 - Closed AG05 - TN01 - Closed TO04 - TN01 - Closed

Looking at the above plots AE10 is warmer than the rest.

0.3 must be more turbulent than the rest, is it ?

mclim_TO04_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("TO04 -Devils SD Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

Looks like SD is the highest for 1.2 height, is it true for all of them ?

mclim_AG05_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AG05 -Longmire SD Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

mclim_AM16_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AM16 -Narada falls SD Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

Falls in place for AM16, lets check fpr AE10

mclim_AE10_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AE10 -Reflection falls SD Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

## 1-18-2019

Longmire hourly data

MtRainier_coopsnowsep_longmire %>% 
  filter(year== 2018) %>% 
  ggplot() + 
  geom_line(aes(Day,as.numeric(Min_Temperature),col='1')) +
  geom_line(aes(Day,as.numeric(Max_Temperature),col='2')) +
  geom_line(data=MtRainier_coopsnowsep_skatecreek,aes(Day,as.numeric(Min_Temperature),col='3')) +
  geom_line(data=MtRainier_coopsnowsep_skatecreek,aes(Day,as.numeric(Max_Temperature),col='4')) +
geom_line(data=MtRainier_coopsnowsep_Paradise,aes(Day,as.numeric(Min_Temperature),col='5')) +
  geom_line(data=MtRainier_coopsnowsep_Paradise,aes(Day,as.numeric(Max_Temperature),col='6')) +

 
   theme_classic() + labs(x="Date", y="Temperature(°C)  ",subtitle="Coop/Snotel -  Mt Rainier- Minimum/Max Recorded every day (2018) ",                                                                                                   caption="Data Source : utah state climate center") + 
   geom_hline(aes(yintercept=9),colour="black", linetype="dashed")  +
    scale_colour_manual(name = 'Heights(m)', 
         values =c('1','2','3','4','5','6'), labels = c('841(Longmire)-Min ','841(Longmire)-Max ','1149(Skatecreek)-Min','1149(Skatecreek)-Max',"1654(Paradise)-Min","1654
                                                        
                                                        (Paradise)-Max"))

# head(MtRainier_coopsnowsep_longmire)
# 
# daily_longmire <- data.frame()
# # R function
# #get hourly temperatures
# dtf = function(x, output) {
#     # x is the row of type Character
#     # access element in first column
#     date = x[1]
#     # min
#     min = as.numeric(x[3])
#     
#      # max
#     max = as.numeric(x[4])
#     
#      # day
#     day = x[5]
#     
#      # month
#     month = x[6]
#     
#      # year
#     year = x[7]
#     
#     for (hr in 1:24)
#     {
#      dayrecords <-  TrenchR::diurnal_temp_variation_sine(Tmn=min,Tmx=max,Hr=hr)
#      print(paste(date,dayrecords,hr,min,max,day,month,year,sep = ','))
#      daily_longmire <- rbind(daily_longmire, dayrecords)
#     }
#     
#     
# }
# 
# MtRainier_coopsnowsep_longmire_ss <-  MtRainier_coopsnowsep_longmire %>% dplyr::filter(month==9 & day > 0 & day < 25) %>% as.data.frame()
# 
# MtRainier_coopsnowsep_longmire_ss$Min_Temperature <- as.numeric(MtRainier_coopsnowsep_longmire_ss$Min_Temperature)
# 
# MtRainier_coopsnowsep_longmire_ss$Max_Temperature <- as.numeric(MtRainier_coopsnowsep_longmire_ss$Max_Temperature)
# 
# df <- apply(MtRainier_coopsnowsep_longmire_ss, 1, dtf)

Prepare Longmire hourly

longmire_hrly <- read_csv('./data/longmire_hourly')
## Parsed with column specification:
## cols(
##   date = col_date(format = ""),
##   m1 = col_double(),
##   hr = col_double(),
##   min = col_double(),
##   max = col_double(),
##   day = col_double(),
##   month = col_double(),
##   year = col_double()
## )
 longmire_hrly_5to15 <- longmire_hrly %>% filter (month %in% c(9)) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    summarise(m1= mean(m1)) %>%
  group_by(day,hr) %>%  as.data.frame()
longmire_hrly_5to15$site <- 'Longmire_841' 
ae10_TN01 <- mclim_AE10_TN01_2018 %>%  
  filter ( month %in% c(9) & height == 0.9) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    dplyr::summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ae10_TN01$site <- 'AE10_TN01_1450' 

ag05_TN01 <- mclim_AG05_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    dplyr::summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
ag05_TN01$site <- 'AG05_TN01_950' 

am16_TN01 <- mclim_AM16_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    dplyr::summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
am16_TN01$site <- 'AM16_TN01_1200' 

TO04_TN01 <- mclim_TO04_TN01_2018 %>%  
  filter (month %in% c(9) & height == 1.2 &  temp != -127) %>%
  filter( day > 4 & day < 16)  %>%
    group_by(month,day,hr) %>%
    add_count(wt=3) %>%
    dplyr::summarise(m1= mean(temp)) %>%
  group_by(day,hr) %>%  as.data.frame()
TO04_TN01$site <- 'TO04_TN01_650' 


combined_across_MM <- rbind(ae10_TN01,
                                    ag05_TN01,
                                    am16_TN01,
                                    TO04_TN01,longmire_hrly_5to15,
                                    Paradise_5to15,
                                    Sunrise_5to15)


combined_across_MM %>%  filter (month %in% c(9) ) %>%
  filter( day %in% c(5,6,7,8,9,10,11,12,13,14) ) %>%
    ggplot() +
  geom_line(aes(hr,m1,color = site),se=F)+ 
  facet_grid(. ~ day, scales = "free") +
   scale_color_manual("Site(m)",values=c("AE10_TN01_1450"=1,"AG05_TN01_950"=2,"AM16_TN01_1200"=3,"TO04_TN01_650"=4,"Paradise_1645"=5,"Sunrise_2097"=6,"Longmire_841"=8)) +
  theme_classic()  + ggtitle("Diel variation in Temperature at different sites in comparison to micromet")  + xlab("Hour") +
      theme_minimal(base_size=24) +
  theme(legend.position = 'bottom',axis.text.x=element_text(angle=90)) +
  ylab("Temperature (°C)") + labs(colour = "Hour",
                                subtitle="1 hr resolution",caption="Data Source : http://www.nanoclimate.org") 

  ggsave("mm_comparedtocaorse.png",dpi=300, dev='png', height=8, width=14, units="in")                               

Ford et. al

understory structure had greater effect on daily maximum temperatures

canopy had effect on 100m - avg daily max and minimum temperatures

canopy gaps had higher max temps, but lower minimum and mean temps.

Check the CV

mclim_TO04_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft/meant)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("TO04 -Devils CV Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

mclim_AE10_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft/meant)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AE16 -Ref lakes CV Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point", shape=5, size=4)  +
  theme_minimal()

mclim_AM16_TN01_2018 %>% filter(temp != -127) %>%
  dplyr::group_by(height) %>%
  dplyr::summarise(meant = mean(temp), cft = sd(temp)) %>%
ggplot(aes(x=as.factor(height), y=cft/meant)) +
  geom_boxplot(aes(fill=as.factor(height))) + 
  ylab("Temperature") +  xlab("Height")  +ggtitle("AM16 -Narada  CV Temp Boxplot") +
  stat_summary(fun.y=mean, geom="point",