mosaic_daymet: Mosaic Daymet files

View source: R/Daymet_fun.R

mosaic_daymetR Documentation

Mosaic Daymet files

Description

Mosaic daymet tiles by year and day

Usage

mosaic_daymet(
  dir,
  days = 1:365,
  out_dir = ".",
  format = c("raster", "GTiff"),
  crop = NULL,
  reproject = NULL,
  method = "ngb",
  verbose = TRUE
)

Arguments

dir

⁠[character]⁠ Directory where Daymet data are stored

days

⁠[integer = 1:365]⁠ Integer(ish) vector giving the days you want retained in the data. Defaults to all days (1:365). See note in Details.

out_dir

⁠[character = "data"]⁠ Directory to save mosaicked output.

format

⁠[character = "raster"]⁠ Output format of raster. Either "raster" (.grd) or "GTiff" (.tif).

crop

⁠[Extent = NULL]⁠ Optional. Extent for cropping Daymet rasters. If NULL (default), no cropping occurs. reproject takes priority over crop if both are specified.

reproject

⁠[Raster* = NULL]⁠ Optional. Raster for reprojecting Daymet rasters. If NULL (default), no reprojection occurs. reproject takes priority over crop if both are specified.

method

⁠[character = "ngb"]⁠ Method used to compute values if reprojecting raster. Either "ngb" or "bilinear". Ignored if reproject is NULL.

verbose

⁠[logical = TRUE]⁠ Determines whether the user will be notified of progress.

Details

This function takes the tiles downloaded by get_daymet_swe() and mosaics them together by year and day. Each Daymet NetCDF file has 365 bands corresponding to days of the year. This function finds all the ⁠*.nc⁠ files for each year in the folder, then determines which bands (days) to load with the argument days, so processing is sped up noticeably if you only specify the days you need. The output is then saved in a single-band GeoTIFF labeled with yyyy_day in the filename.

A note on Daymet days. During leap years, there are still only 365 bands in the raster. December 31st is omitted during leap years.


bsmity13/snowdl documentation built on Feb. 24, 2024, 9:03 p.m.