Downloading humidity data with nasapower

The nasapower package aims at making it quick and easy to automate downloading NASA POWER (NASA Prediction of Worldwide Energy Resource) global meteorology, surface solar energy and climatology data.

Here, we will use the nasapower package to retrieve the relative humidity data for specific countries or for the world.

We have also used the nasapower package to retrieve rainfall data here. The rainfall tutorial includes an introduction on the nasapower package and how its functions work.

Installing nasapower package

We can install the package from CRAN and load it as follows.

install.packages("nasapower")
library(nasapower)

Using get_power() to fetch data

First let us have a look at how to get the daily data for humidity in agriculture. This can be done using the get_power() function.

Fetching daily data for single point

We use get_power() function arguments pars = "RH2M" which means relative umidity at 2 meters, temporal_average = "DAILY", and longlat equal to a single location.

data_RH <- get_power(community = "AG",
          lonlat = c(134.489563,-25.734968),
          dates = c("2010-09-23","2010-12-23"),
          temporal_average = "DAILY",
          pars = "RH2M")

data_RH %>% datatable(extensions = c('Scroller','FixedColumns'), options = list(
  deferRender = TRUE,
  scrollY = 350,
  scrollX = 350,
  dom = 't',
  scroller = TRUE,
  fixedColumns = list(leftColumns = 3)
))

Fetching daily data for an area

daily_humidity <- get_power(community = "AG",
          lonlat = c(150.5, -28.5 , 153.5, -25.5),
          pars = "RH2M",
          dates = c("2004-09-19","2004-09-29"),
          temporal_average = "DAILY")

daily_humidity %>% datatable(extensions = c('Scroller','FixedColumns'), options = list(
  deferRender = TRUE,
  scrollY = 350,
  scrollX = 350,
  dom = 't',
  scroller = TRUE,
  fixedColumns = list(leftColumns = 3)
))

Fetching climatology data

Global data are obtained by setting community = "AG" and temporal_average = "CLIMATOLOGY".

climate_avg_RH <- get_power(community = "AG",
                         pars = "RH2M",
                         lonlat = "GLOBAL",
                         temporal_average = "CLIMATOLOGY"
)
climate_avg_RH %>% datatable(extensions = c('Scroller','FixedColumns'), options = list(
  deferRender = TRUE,
  scrollY = 350,
  scrollX = 350,
  dom = 't',
  scroller = TRUE,
  fixedColumns = list(leftColumns = 3)
))