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

LA143_hddcdd #844

Merged
merged 29 commits into from Dec 7, 2017
Merged

LA143_hddcdd #844

merged 29 commits into from Dec 7, 2017

Conversation

kdorheim
Copy link
Contributor

@bpbond this was a bit of a rush job, I will be out of town but can make the edits when I get back 11/29

Copy link
Member

@bpbond bpbond left a comment

Choose a reason for hiding this comment

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

Looks great @kdorheim - thanks.

#'
#' @param command API command to execute
#' @param ... other optional parameters, depending on command
#' @return Depends on \code{command}: either a vector of required inputs,
#' a vector of output names, or (if \code{command} is "MAKE") all
#' the generated outputs: \code{L143.share_state_Pop_CDD_sR9}, \code{L143.share_state_Pop_CDD_sR13}, \code{L143.share_state_Pop_HDD_sR9}, \code{L143.share_state_Pop_HDD_sR13}, \code{L143.HDDCDD_scen_state}. The corresponding file in the
#' original data system was \code{LA143.HDDCDD.R} (gcam-usa level1).
#' @details Describe in detail what this chunk does.
#' @details Estimate heating and cooling degree days for gcam-usa
Copy link
Member

Choose a reason for hiding this comment

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

This is concise...maybe a bit too concise. A few more details would be useful.

@bpbond
Copy link
Member

bpbond commented Nov 21, 2017

I stitched the downstream chunks and an error is being thrown:

[1] "module_gcam.usa_LA144.Residential"
 Error: `by` can't contain join column `subregion13` which is missing from RHS 

(Will deal with this later.)

@bpbond
Copy link
Member

bpbond commented Nov 29, 2017

Holding on @gokuliyer review.

@bpbond
Copy link
Member

bpbond commented Dec 1, 2017

Thanks @kdorheim

Copy link
Contributor

@gokuliyer gokuliyer left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in getting to this. I had some clarifying questions and requests for more information.

select(state, subregion9, subregion13, year, value) ->
L143.Pop_HDD_state

# Aggregate the population cooling and heating degree days by census subregions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Unclear to me why the aggregation for each subregion needs to be done one by one.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be helful to add a comment on why this aggregation needs to be done.

@@ -1,6 +1,6 @@
# ../gcam-usa-data/level1//L143.HDDCDD_scen_state.csv
# Written by LA143.HDDCDD.R
# Wed Sep 20 02:00:41 2017
# Mon Nov 20 14:29:22 2017
# " Heating and cooling degree days by state and scenario "
Copy link
Contributor

Choose a reason for hiding this comment

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

We must track down the source of the HDD and CDD data. I am not sure off the top of my head. @pkyle , any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that the original files are in the GIS folder within gcam-usa-data. Is that where we plan to keep these files?

Copy link
Contributor Author

@kdorheim kdorheim Dec 6, 2017

Choose a reason for hiding this comment

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

@gokuliyer @bpbond @pkyle I put the CDD and HDD input files into the gcamdata\inst\extdata\gcam-usa but @gokuliyer is right, in the old data system it was in the gcam-usa-data\GIS directory. Where do we want to put it in the new data system?

Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest gcamdata\inst\extdata\gcam-usa\GIS\

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry guys, I just noticed I hadn't written back!
The HDD and CDD data in the model were all produced by Yuyu, and we don't have any archive of the raw data, processing code, etc. You can see from the file names that the future scenarios are from the GFDL climate model, A2 scenario; the historical ones are also from a climate model as well (as opposed to historical or re-analysis data), but the fact that they only go up to 2008 means that the dataset was produced in 2011. And I don't know which climate model was used--my guess is CCSM3. Here's an excerpt from some documentation I wrote up in 2012:
"Historical gridded population data for the US are from HYDE (Klein Goldewikj et al. 2011), which has population at the 5’ scale. Global gridded population data for future scenarios are from the IIASA GGI database. These scenarios are available at 0.5 degree latitude by longitude at a 10-year resolution from 2000 to 2100. Historical and future climate data are from three climate models, depending on the scenario being run. These models include CCSM3 (Collins et al. 2006), GISS (Russell et al. 2000), and Hadley (Gordon et al. 2000). These population and climate data are used to generate historical heating and cooling degree days (HDD and CDD), as well as future scenarios."...
"The method for calculating heating and cooling degree days by state using gridded data of temperature and population over time is documented in Zhou et al. (in review); a brief summary follows. First, the monthly temperature data and estimates of the daily standard deviation in each grid cell, derived from analysis of historical climate data, are used to calculate the monthly HDD and CDD for each grid cell. This step is necessary because climate model output for future scenarios is in monthly timesteps, whereas heating and cooling degree days are calculated from daily temperature. Then, these monthly HDD and CDD are aggregated to annual values.Then, the population-weighted HDD and CDD over a given geographical area (in this case, states) are calculated as follows:"
hddcddcalc

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @pkyle!

@bpbond bpbond assigned kdorheim and unassigned gokuliyer Dec 6, 2017
@codecov
Copy link

codecov bot commented Dec 7, 2017

Codecov Report

Merging #844 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #844   +/-   ##
=======================================
  Coverage   92.26%   92.26%           
=======================================
  Files          11       11           
  Lines        1332     1332           
=======================================
  Hits         1229     1229           
  Misses        103      103

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f314c6...c8cf993. Read the comment docs.

@bpbond
Copy link
Member

bpbond commented Dec 7, 2017

@gokuliyer OK to merge?

@bpbond bpbond merged commit 538740c into master Dec 7, 2017
@bpbond bpbond deleted the LA143.HDDCDD branch December 7, 2017 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants