Skip to content
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

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7adae91
added first draft of download caladapt helper functions
dlebauer Jan 30, 2025
7e1cded
Merge branch 'develop' of github.com:pecanproject/pecan into caladapt
dlebauer Feb 19, 2025
b7edf1f
moved download_caladapt to data.atmosphere
dlebauer Feb 19, 2025
78379a9
refactored download_caladapt functions to take either pts or polygons…
dlebauer Feb 19, 2025
c3a3a40
updating download_caladapt tests
dlebauer Feb 19, 2025
b1a232e
tests passing 🤞
dlebauer Feb 19, 2025
a4c395c
tests passing 🤞
dlebauer Feb 19, 2025
7637ee4
Merge branch 'caladapt' of github.com:dlebauer/pecan into caladapt
dlebauer Feb 19, 2025
7a1e86f
updated contributing, changelog, news, compiled documentation
dlebauer Feb 19, 2025
f288d6e
updated contributing, changelog, news, compiled documentation
dlebauer Feb 19, 2025
704cec1
Merge branch 'caladapt' of github.com:dlebauer/pecan into caladapt
dlebauer Feb 19, 2025
3be4bbd
Merge branch 'caladapt' of github.com:dlebauer/pecan into caladapt
dlebauer Feb 19, 2025
1f63064
Merge branch 'caladapt' of github.com:dlebauer/pecan into caladapt
dlebauer Feb 19, 2025
0491a50
add caladaptr to Imports
dlebauer Feb 19, 2025
8a49c6b
load caladapt package data
dlebauer Feb 19, 2025
97010b2
updated pecan dependencies
dlebauer Feb 20, 2025
240d02b
Merge branch 'develop' into caladapt
infotroph Feb 26, 2025
ff40eb1
typo+sorting
infotroph Feb 26, 2025
f9be063
deps
infotroph Feb 26, 2025
ccfb8b0
added some standards for function naming and parameter order
dlebauer Mar 3, 2025
68a6a9a
change download caladapt name, arguments, and address other PR feedback
dlebauer Mar 3, 2025
1e19fc5
Merge branch 'develop' into caladapt
dlebauer Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For more information about this file see also [Keep a Changelog](http://keepacha

- Documentation of `make` options including addition of `make help`
- Add make option to document a single package with `make documentation pathto/package`
- Add caladapt_download_loca functions #3445

### Fixed
- updated github action to build docker images
Expand All @@ -19,7 +20,7 @@ For more information about this file see also [Keep a Changelog](http://keepacha

### Changed

- Is is now easier to run PEcAn workflows with no active database connection by setting `settings$database$bety$write` to FALSE or missing (#3398, #3419). In this mode you are reponsible for providing the correct paths/ids for all needed files, and run metadata are not written back to the database.
- It is now easier to run PEcAn workflows with no active database connection by setting `settings$database$bety$write` to FALSE or missing (#3398, #3419). In this mode you are responsible for providing the correct paths/ids for all needed files, and run metadata are not written back to the database.
- The following components have changed their licensing. With approval of all their contributors, we now provide them under a BSD 3-clause license rather than the previously used NCSA Open Source license. As a reminder, we intend to relicense the entire system and this list will expand as we gather permission from the relevant copyright owners.
* `apps/api`
* Shiny apps `dbsync`, `BenchmarkReport`, `Data-Ingest`, `Elicitation`, `ForecastingDashboard`, `global-sensitivity`, `Pecan.depend`, `SDAdashboard`, and `ViewMet`
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Your PR should include:
- CITATION.cff: if you are making or have made a non-trivial contribution (please ask if unsure; our approach is inclusive), add your name to the author section.
- NEWS.md: for each package
- CHANGELOG.md: add changes to [Unreleased] section
- Tests for any features that should remain working in the future
- Documentation files generated by `devtools::document()`
- Updates to documentation if applicable.


### Push your changes up to GitHub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ _Do not_ add packages to `Depends`.
In general, try to avoid adding new dependencies (especially ones that depend on system libraries) unless they are necessary or already widely used in PEcAn (e.g. GDAL, NetCDF, XML, JAGS, `dplyr`).
For a more thorough and nuanced discussion, see the [package dependencies appendix](#package-dependencies).

#### PEcAn-Specific Function Conventions {#pecan-function-conventions}

PEcAn has established patterns for function naming and parameter ordering to ensure consistency across modules:

- **Function naming**:
- Functions that download data: `download.<source>` (e.g., `download.ameriflux`).
- Functions that convert a met data source to PEcAn standard: `met2CF.<source>` (e.g., `met2CF.ameriflux`).
- Functions that convert PEcAn standard met data to a model input: `met2model.<model>` (e.g., `met2model.biocro`).
- Functions that convert a model output to a standard format should be named `model2netcdf.<model>` (e.g., `model2CF.biocro`).

- **Parameter order**: Follow standard order and naming for function parameters:
1. Required parameters without defaults first:
- `outfolder`: Directory where output will be saved (no default)
- `start_date`: Beginning date for data (no default)
- `end_date`: End date for data (no default)
2. Spatial information parameters
- lat, lon or
- sitename / site_id
- sf object
3. Product-specific parameters
4. Optional parameters with defaults

This pattern is consistent with R norms of placing parameters without defaults before those with defaults.
These conventions help maintain consistency across PEcAn modules (meteorology, models, SDA constraints, etc.)
and enable scalability.


# dplyr

Expand Down
1 change: 1 addition & 0 deletions docker/depends/pecan_deps_from_github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ ropensci/nneo
ropensci/traits
SticsRPacks/SticsOnR
SticsRPacks/SticsRFiles
ucanr-igis/caladaptr
VangiElia/GEDI4R
1 change: 1 addition & 0 deletions docker/depends/pecan_package_dependencies.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"BayesianTools","*","modules/rtm","Imports",FALSE
"BioCro","*","models/biocro","Suggests",FALSE
"bit64","*","base/db","Suggests",FALSE
"caladaptr","*","modules/data.atmosphere","Imports",FALSE
"coda","*","models/maespa","Suggests",FALSE
"coda","*","models/sipnet","Suggests",FALSE
"coda","*","modules/assim.sequential","Imports",FALSE
Expand Down
2 changes: 2 additions & 0 deletions modules/data.atmosphere/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Imports:
xts,
zoo
Suggests:
caladaptr,
doParallel,
foreach,
furrr,
Expand All @@ -75,6 +76,7 @@ Suggests:
Remotes:
github::adokter/suntools,
github::chuhousen/amerifluxr,
github::ucanr-igis/caladaptr,
github::ropensci/geonames,
github::ropensci/nneo
License: BSD_3_clause + file LICENSE
Expand Down
9 changes: 5 additions & 4 deletions modules/data.atmosphere/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Generated by roxygen2: do not edit by hand

S3method(extract,local.CMIP5)
S3method(extract,local.NLDAS)
S3method(extract,nc)
S3method(extract,nc.ERA5)
export(.download.raw.met.module)
export(.extract.nc.module)
export(.met2model.module)
Expand Down Expand Up @@ -38,6 +42,7 @@ export(download.PalEON)
export(download.PalEON_ENS)
export(download.US_WCr)
export(download.US_Wlef)
export(download.caladapt.loca)
export(downscale_ShortWave_to_half_hrly)
export(downscale_ShortWave_to_hrly)
export(downscale_repeat_6hr_to_half_hrly)
Expand All @@ -48,10 +53,6 @@ export(downscale_spline_to_half_hrly)
export(downscale_spline_to_hrly)
export(equation_of_time)
export(exner)
export(extract.local.CMIP5)
export(extract.local.NLDAS)
export(extract.nc)
export(extract.nc.ERA5)
export(gen.subdaily.models)
export(get.es)
export(get.lv)
Expand Down
6 changes: 6 additions & 0 deletions modules/data.atmosphere/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# PEcAn.data.atmosphere 1.8.1

## Added

* `download_caladapt_loca` to download rasters from Cal-Adapt LOCA dataset given a spatial point or polygon object.

# PEcAn.data.atmosphere 1.8.0.9000

## Fixed
Expand Down
Loading
Loading