-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create CalAdapt Download Functions for LOCA downscaled CMIP-5 #3446
base: develop
Are you sure you want to change the base?
Conversation
…, and factored out validation functionsdata(periods, package = "caladaptr", envir = environment())
@@ -24,6 +24,7 @@ Imports: | |||
amerifluxr, | |||
assertthat, | |||
arrow, | |||
caladaptr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend making caladaptr a "suggests" since it's only used by one function outside of the core workflow
#' out_dir = "data" | ||
#' ) | ||
#' } | ||
download_caladapt_loca_raster <- function(sf_obj, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the reason for accepting a sf_obj instead of just lat/lon, which is non-standard for PEcAn met files, but beyond that I'd highly recommend doing everything else you an to adhere to workflow norms and patterns. These include naming the function download. and having the required inputs start with (outfolder, start_date, end_date), followed by spatial information, followed by product-specific variables. This order is also consistent with R norms of having variables that have defaults AFTER those that don't have a default (start/end). To that end, I'd recommend dropping the default on outfolder (what you call outdir) and renaming start_year and end_year to start_date and end_date
period = period, | ||
start_year = start_year, | ||
end_year = end_year, | ||
raster = rast_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning on writing separate functions convert the raster to netCDF CF and extract info from it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep download --> met2cf --> met2model
but next step is to write the download functions for the WRF downscaled CMIP-6. Hopefully (🤞🏻) met2cf.caladapt will work on both.
Description
Adds
download_caladapt_loca
to download Cal-Adapt LOCA downscaled CMIP5 rasters inputs that can subsequently be used for data extraction. Acceptssf
,sfc
, andSpatVector
objects.Motivation and Context
To support CCMMF project #3445
support for WRF-downscaled CMIP6 data will be added in a separate PR
Types of changes
Checklist: