Working with Data: An adventure!

Figure 1: Locations of the 28 NERRS reserves. Image source: http://www.nerrs.noaa.gov/ReservesMap.aspx

Figure 1: Locations of the 28 NERRS reserves. Image source

The National Estuarine Research Reserve System (NERRS) has a plethora of time series data freely and openly available. These data sets include meteorological parameters (air temperature, precipitation, etc.), water quality parameters (water temperature, salinity, dissolved oxygen, etc.), and nutrients for the NERRS reserves shown in Figure 1. You can access this data here.

Figure 2: Time series of air temperature for Jug Bay, MD starting on August 1, 2003.

Figure 2: Air temperature at Jug Bay starting on Aug. 1, 2003.

 

Since the study area of this project is Chesapeake Bay, we will be looking at the unique ecosystems represented by the Maryland and Virginia reserves.

Now that we have data, what can we do with it? For this post, I will show an example of how I have been looking at the atmospheric temperature data at the Jug Bay, MD and Taskinas Creek, VA sites.

Using R (a computer language), I have plotted all of the temperature data. One of our goals for this project is to calculate the extreme climate indices and to assess if magnitude and frequency of extreme weather events have changed in Chesapeake Bay.

Figure 3: Time series of air temperature for Taskinas Creek, VA starting on January 1, 2001.

Figure 3: Air temperature at Taskinas Creek, VA starting on January 1, 2001.

Air temperature is collected every 15 minutes at these sites, and many of the extreme climate indices need daily temperature values. This means that there are 96 data points for every 1 day! We can use the package “zoo” in R to get the average daily temperature.

 

Here is a simplified sample of the R script I have been using for the date (Date) and air temperature (ATemp) variables:

#create a zoo object for air temperature ordered by the date.

#zoo combines air temperature and date into an object (Temp), so we have a nice, ordered, time series.

 

Figure 4: This is the same data used from Figure 2, however, is now daily temperature.

Figure 4: This is the same data used from Figure 2 displayed as daily temperature.

Temp <- zoo(ATemp,Date))

#now we can use zoo to apply our desired function using the rollapply function

Tmean<- rollapply(Temp, 96, mean, by = 96)

#In this function, the mean air temperature was taken for a window of 96 data points and does not overlap.  The result: we take the average temperature daily, trimming the time series from 96 points per day to 1 (average value).

Figure 5: This is the same data used from Figure 3, however, is now daily temperature.

Figure 5: This is the same data used from Figure 3 displayed as daily temperature.

 

While the trend between the 15 minute data and daily mean is the same, visually the lines are now “thinner” and we can see the general, mean trend in the data. As expected, temperature for both MD and VA follow a seasonal cycle where the temperature is warmer in the summer and cooler in the winter (no surprise there!). It also appears to vary year-to-year (more on this later!).

However, by calculating a mean temperature, the highs and lows all changed (compare the y-axes between Figures 2 and 4 and Figures 3 and 5). Not ideal if the goal is to look at extreme values! So, instead of calculating the mean daily temperature, we want to calculate the daily maximum and minimum temperatures. We can do this using R just like the mean calculation above.

Figure 6: New plot of the daily max, mean, and min temperature at Jug Bay, MD.

Figure 6: New plot of the daily max, mean, and min temperature at Jug Bay, MD.

#Rollapply using the function max and min. Tmax is the daily highest temperature and Tmin is the daily lowest temperature.

Tmax <- rollapply(Temp, 96, max, by = 96)

Tmin <- rollapply(Temp, 96, min, by = 96)

There! Here is a new way to look at the same data. In a nutshell, Figures 6 and 7 show you the range of temperatures you could have experienced in a single day at Jug Bay, MD and Taskinas Creek, VA.

Figure 7: New plot of the daily max, mean, and min temperature at Taskinas Creek, VA.

Figure 7: New plot of the daily max, mean, and min temperature at Taskinas Creek, VA.

Why did I separate the data into a max and min temperature? Think about it from this perspective: when you get a weather forecast for a day, the meteorologist will often give the high and low temperature in addition to the average temperature so we can be prepared.

For example, the average daily temperature at Jug Bay on July 7, 2013 was 77°F (24.8°C). If you dressed only for this temperature, you would be sweating away when the daily high temperature hit 89°F (31.5°C). I clearly remember this day because it was my wedding…and I remember that 90°C period!

Kari Pohl

About Kari Pohl

I am a post-doctoral researcher at NOAA and the University of Maryland (Center for Environmental Science at Horn Point Laboratory). My work investigates how climate variability and extremes affect the diverse ecosystems in Chesapeake Bay. I received a Ph.D. in oceanography from the University of Rhode Island (2014) and received a B.S. in Environmental Science and a B.A. in Chemistry from Roger Williams University (2009). When I am not busy being a scientist, my hobbies include running, watching (and often yelling at) the Boston Bruins, and taking photos of my cat.
This entry was posted in Atmospheric Temperature and tagged , , . Bookmark the permalink.

One Response to Working with Data: An adventure!

  1. Victoria Coles says:

    These are neat Kari! It looks to me like maybe the Tmin minima are more homogeneous (more similar) across the sites than the Tmax maxima. We can quantify this by correlating them, and learn about whether the factors driving low winter temperatures are more likely to occur throughout the region as compared with the forcing that causes really hot days.

Leave a Reply

Your email address will not be published. Required fields are marked *