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

Adding functions and scripts for downloading, extracting, and processing observations, initial conditions, land cover types, ERA5 drivers for anchor sites within NA. #3278

Merged
merged 84 commits into from
May 21, 2024

Conversation

DongchenZ
Copy link
Contributor

@DongchenZ DongchenZ commented Mar 12, 2024

Description

This PR includes:

  1. script for preparing required data sets (ERA5; AGB, LAI, SMAP, and SOC; land cover) for anchor sites.
  2. script for preparing initial conditions (AGB, LAI, Soil moisture, SOC) for anchor sites.
  3. updated function for searching ecoregion within NA.
  4. functions for downloading and extracting soil moisture from the CDS server.
  5. function for downloading and extracting MODIS land cover products.
  6. function for extracting AGB initial condition from the GeoTIFF files.
  7. function for extracting ISCN SOC from existing Rdata file.

Motivation and Context

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@infotroph
Copy link
Member

infotroph commented Mar 13, 2024

As currently structured this PR adds more than 100 megabytes of data files to the package, which is far outside the norm for R package size -- CRAN wants special justification for anything with more than 5 MB of data or more then 10 MB for the whole package. Do the shapefiles and Rdata files really need to be distributed as part of data.land or can they be stored elsewhere and read in as needed?

Copy link
Member

@mdietze mdietze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the process of data prep for large-scale SDA runs, there needs to be better overall documentation of how one does that. Even if someone else found these functions and scripts, they wouldn't know how to run them without some sort of README.md. Indeed, for prep scripts that only make sense to run manually (as opposed to cron jobs or some other automation) you might consider writing them as Rmd files.

modules/data.land/R/ISCN_extract.R Outdated Show resolved Hide resolved
modules/data.land/R/download.SM_CDS.R Outdated Show resolved Hide resolved
modules/data.land/inst/IC_prep_anchorSites.R Outdated Show resolved Hide resolved
modules/data.remote/R/MODIS_LAI_prep.R Show resolved Hide resolved
@@ -0,0 +1,41 @@
#' Extract above ensemble ground biomass density from pre-existing GeoTIFF file for the SDA workflow.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so presumably this isn't a generic approch to reading any AGB geotiff (of which there are many in the world), but something for working with some specific product? That needs to be well documented, including being clear in the function name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

modules/data.land/R/download.SM_CDS.R Show resolved Hide resolved
@DongchenZ DongchenZ requested a review from mdietze May 16, 2024 20:52
@mdietze mdietze enabled auto-merge May 21, 2024 17:57
@@ -918,20 +918,29 @@ post.analysis.multisite.ggplot <- function(settings, t, obs.times, obs.mean, obs
##' @param CI range of confidence interval.
##' @param unit list of unit used for y axis label.
##' @param style color option.
##' @param PDF_w width of exported PDF file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What units? I'm guessing probably whatever pdf() defaults to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For cases like this I like to leave a breadcrumb trail:

Suggested change
##' @param PDF_w width of exported PDF file.
##' @param PDF_w width of exported PDF file, passed on to `base::pdf()`.

(and similar for PDF_h)

@mdietze mdietze added this pull request to the merge queue May 21, 2024
Merged via the queue into PecanProject:develop with commit 6f82227 May 21, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants