nasapower: A NASA POWER Global Meteorology, Surface Solar Energy and Climatology Data Client for R

  • Sparks A
N/ACitations
Citations of this article
184Readers
Mendeley users who have this article in their library.

Abstract

and Statement of Need nasapower is an R (R Core Team, 2018) package providing functionality to interface with the NASA POWER API (Stackhouse et al., 2018) for reproducible data retrieval using R. Three functions, get_power(), create_met() and create_icasa() are provided. The get_power() function provides complete access to all functionality that the POWER API provides, which includes three user communities, AG (agroclimatology), SSE (Surface meteorology and Solar Energy) and SB (Sustainable Buildings); three temporal averages, Daily, Interannual and Climatology; three geographic options, single point, regional and global for the appropriate parameters offered. nasapower uses lubridate (Grolemund & Wickham, 2011) internally to format and parse dates which are passed along to the the query constructed using crul (Chamberlain, 2018) to interface with the POWER API. The query returns a json response, which is parsed by jsonlite (Ooms, 2014) to obtain the url of the .csv file that has been requested. The .csv file is downloaded to local disk using curl (Ooms, 2018) and read into R using readr (Wickham, Hester, & Francois, 2017). Data are returned in a tidy data frame (Wickham, 2014) as a tibble (Müller & Wickham, 2018) with a custom header, which provides POWER metadata. Two other functions provide functionality to generate weather input files for agricultural crop modelling. The create_met() function is a wrapper for the get_power() function coupled with the prepareMet() and writeMet() functions from APSIM (Fainges, 2017) to simplify the process of querying the data and creating text files in the .met format for use in Agricultural Production Systems sIMulator (APSIM). While the create_icasa() function wraps the get_power() into a function that generates and locally saves a text file in the International Consortium for Agricultural Systems Applications (ICASA) format for use in the Decision Support System for Agrotechnology Transfer (DSSAT) framework (G. Hoogenboom et al., 2017; J. W. Jones et al., 2003). Extended documentation is provided with examples of converting it to spatial objects using raster (Hijmans, 2017). Integrating this data retrieval and formatting in R will streamline processes with models such as APSIM (Keating et al., 2003), DSSAT (J. W. Jones et al., 2003; J. Jones et al., 1998) and EPIRICE (Savary, Nelson, Willocquet, Pangga, & Aunario, 2012) that can be linked to or are implemented fully in the R programming language.

Cite

CITATION STYLE

APA

Sparks, A. (2018). nasapower: A NASA POWER Global Meteorology, Surface Solar Energy and Climatology Data Client for R. Journal of Open Source Software, 3(30), 1035. https://doi.org/10.21105/joss.01035

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free