Giter VIP home page Giter VIP logo

daymetr's Introduction

Build Status DOI

daymetr

The daymetr R package provides functions to (batch) download single pixel or gridded daymet data (tiled) data directly into your R workspace, or save them as csv/tif files on your computer. Gridded (tiled) data downloads for a region of interest are specified by a top left / bottom right coordinate pair or a single pixel location. Please cite as: Koen Hufkens. (2017). khufkens/daymetr: Download daymet data using R. Zenodo. http://doi.org/10.5281/zenodo.437886.

Installation

clone the project to your home computer using the following command (with git installed)

require(devtools)
install_github("khufkens/daymetr") # install the package
library(daymetr) # load the package

Use

Single pixel location download

For a single site use the following format

 download.daymet(site = "Oak Ridge National Laboratories",
                lat = 36.0133,
                lon = -84.2625,
                start_yr = 1980,
                end_yr = 2010,
                internal = TRUE)
Parameter Description
site site name
lat latitude of the site
lon longitude of the site
start_yr start year of the time series (data start in 1980)
end_yr end year of the time series (current year - 2 years / for safety, tweak this check to reflect the currently available data)
internal logical, TRUE or FALSE, if true data is imported into R workspace otherwise it is downloaded into the current working directory

Batch mode uses similar parameters but you provide a comma separated file with site names and latitude longitude which are sequentially downloaded. Format of the comma separated file is as such: site name, latitude, longitude.

batch.download.daymet(file_location = 'my_sites.csv',
                      start_yr = 1980,
                      end_yr = 2010,
                      internal = TRUE)

Gridded data download

For gridded data use the following format

download.daymet.tiles(lat1 = 36.0133,
                      lon1 = -84.2625,
                      lat2 = NA,
                      lon2 = NA,
                      start_yr = 1980,
                      end_yr = 2012,
                      param = "ALL")
Parameter Description
lat1 top left latitude
lon1 top left longitude
lat2 bottom right latitude (can be empty)
lon2 bottom right latitude (can be empty)
start_yr start year of the time series (data start in 1980)
end_yr end year of the time series (current year - 2 years / for safety, tweak this check to reflect the currently available data)
param climate variable you want to download vapour pressure (vp), minimum and maximum temperature (tmin,tmax), snow water equivalent (swe), solar radiation (srad), precipitation (prcp) , day length (dayl). The default setting is ALL, this will download all the previously mentioned climate variables.

If only the first set of coordinates is provided the tile in which these reside is downloaded. If your region of interest falls outside the scope of the DAYMET data coverage a warning is issued. If both top left and bottom right coordinates are provided all tiles covering the region of interst are downloaded. I would caution against downloading too much data, as file sizes do add up. So be careful how you specify your region of interest.

Dependencies

The code depends on the following R packages: sp, rgdal, curl and will be installed alongside the daymetr package.

daymetr's People

Contributors

khufkens avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.