Chapter 3 SCAN

NOTE: website change requires updating.

3.1 How to use SCAN

  1. Go to Soil Climate Analysis Network (SCAN) site.

  2. Select the data type you want under Reports.

  3. Select a state and a station from the list and hit “View.”

  4. After the loading is complete, you will see the data. Right click on the page to save the data as a text file and open it. Notice that the file starts with the data documentation indicated by #.

  5. Save the data documentation elsewhere if needed and manually delete all the lines with #. Save the file.

3.2 Code example

Getting maximum air temperatures in Nunn, CO (-104.73°, 40.87°) for January 1-31 in 2017

From this page, go to “Daily SCAN Standard Report - Period of Record,” and select COLORADO, then Nunn #1 and view. Download the file and process the text file as described above.

library(magrittr)
library(utils)

scan <- read.delim(PATH_TO_TEXTFILE)

scan$Date <- as.Date(scan$Date)

data <- scan[scan$Date >= as.Date("2017-07-01") & scan$Date <= as.Date("2017-07-31")),]

vals <- data[, varIndex]
vals <- (vals - 32) / 1.8 # Convert degF to degC

days <- c()
for (i in 1:31) {
  days <- c(days, paste0("2017-07-", i))
}

df <- data.frame("Date" = as.Date(days), 
                 "Data" = vals)