epwshiftr
Create future EnergyPlus Weather files using CMIP6 data.
https://github.com/ideas-lab-nus/epwshiftr
Category: Climate Change
Sub Category: Climate Data Processing and Analysis
Keywords
climate-change cmip6 energyplus epw esgf
Keywords from Contributors
bayesian-calibration parametric psychrometrics
Last synced: about 8 hours ago
JSON representation
Repository metadata
Create future EnergyPlus Weather files using CMIP6 data
- Host: GitHub
- URL: https://github.com/ideas-lab-nus/epwshiftr
- Owner: ideas-lab-nus
- License: other
- Created: 2019-12-16T05:44:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-12T03:42:59.000Z (about 2 months ago)
- Last Synced: 2025-11-29T08:19:26.336Z (about 1 month ago)
- Topics: climate-change, cmip6, energyplus, epw, esgf
- Language: R
- Homepage: https://ideas-lab-nus.github.io/epwshiftr/
- Size: 1.3 MB
- Stars: 37
- Watchers: 3
- Forks: 11
- Open Issues: 12
- Releases: 5
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(epwshiftr)
# copy files in advance
f <- c("tas_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20490101-20491231.nc",
"tas_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20500101-20501231.nc",
"tas_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20510101-20511231.nc",
"hurs_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20490101-20491231.nc",
"hurs_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20500101-20501231.nc",
"hurs_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20510101-20511231.nc",
"tas_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20790101-20791231.nc",
"tas_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20800101-20801231.nc",
"tas_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20810101-20811231.nc",
"hurs_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20790101-20791231.nc",
"hurs_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20800101-20801231.nc",
"hurs_day_AWI-CM-1-1-MR_ssp585_r1i1p1f1_gn_20810101-20811231.nc"
)
file.copy(file.path("/mnt/d/ScenarioMIP", f), tempdir())
```
# epwshiftr
[](https://github.com/ideas-lab-nus/epwshiftr/actions)
[](https://CRAN.R-project.org/package=epwshiftr)
[](https://app.codecov.io/gh/ideas-lab-nus/epwshiftr?branch=master)
[](https://cran.r-project.org/package=epwshiftr)
> Create future EnergyPlus Weather files using CMIP6 data
## How to cite
To cite epwshiftr in publications use:
Jia, Hongyuan, Chong, Adrian, Ning, Baisong, 2023.
Epwshiftr: incorporating open data of climate change prediction into building performance simulation for future adaptation and mitigation,
in: Proceedings of Building Simulation 2023: 18th Conference of IBPSA, Building Simulation.
Presented at the Building Simulation 2023, IBPSA, Shanghai, China, pp. 3201–3207.
https://doi.org/10.26868/25222708.2023.1612
A BibTeX entry for LaTeX users is:
```bibtex
@inproceedings{jia2023epwshiftr,
title = {Epwshiftr: Incorporating Open Data of Climate Change Prediction into Building Performance Simulation for Future Adaptation and Mitigation},
shorttitle = {Epwshiftr},
booktitle = {Proceedings of {{Building Simulation}} 2023: 18th {{Conference}} of {{IBPSA}}},
author = {Jia, Hongyuan and Chong, Adrian and Ning, Baisong},
year = {2023},
series = {Building {{Simulation}}},
volume = {18},
pages = {3201--3207},
publisher = {{IBPSA}},
address = {{Shanghai, China}},
doi = {10.26868/25222708.2023.1612}
}
```
* [Installation](#installation)
* [Get started](#get-started)
* [Build CMIP6 output file index](#build-cmip6-output-file-index)
* [Manage CMIP6 output files](#download-cmip6-output-files)
* [Extract CMIP6 output data](#extract-cmip6-output-data)
* [Morphing EPW weather variables](#morphing-epw-weather-variables)
* [Create future EPW files](#create-future-epw-files)
* [Author](#author)
* [License](#license)
* [Contribute](#contribute)
## Installation
You can install the latest stable release of epwshiftr from
[CRAN](https://CRAN.R-project.org).
```{r cran-install, eval = FALSE}
install.packages("epwshiftr")
```
Alternatively, you can install the development version from GitHub.
```{r gh-install, eval = FALSE}
install.packages("epwshiftr",
repos = c(
ideaslab = "https://ideas-lab-nus.r-universe.dev",
cran = "https://cran.r-project.org"
)
)
```
## Get started
### Build CMIP6 output file index
* The first step is to build CMIP6 experiment output file index based on queries
using ESGF search RESTful API
```{r index}
# set directory to store files
options(epwshiftr.dir = tempdir())
options(epwshiftr.verbose = TRUE)
# get CMIP6 data nodes
(nodes <- get_data_node())
# create a CMIP6 output file index
idx <- init_cmip6_index(
# only consider ScenarioMIP activity
activity = "ScenarioMIP",
# specify dry-bulb temperature and relative humidity
variable = c("tas", "hurs"),
# specify report frequent
frequency = "day",
# specify experiment name
experiment = c("ssp585"),
# specify GCM name
source = "AWI-CM-1-1-MR",
# specify variant,
variant = "r1i1p1f1",
# specify years of interest
years = c(2050, 2080),
# save to data dictionary
save = TRUE
)
# the index has been automatically saved into directory specified using
# `epwshiftr.dir` option and can be reloaded
idx <- load_cmip6_index()
str(head(idx))
```
### Manage CMIP6 output files
* You have to download CMIP6 output file by yourself using your preferable
methods or tools. The download url can be found in the `file_url` column in
the index.
* After you have downloaded CMIP6 output files of interest, you can use
`suumary_database()` to get a summary on files downloaded against the CMIP6
output file index.
* This step is necessary as it map the loaded files against index so that
epwshiftr knows which case is complete and can be used for the next step.
```{r database}
# Summary downloaded file by GCM and variable, use the latest downloaded file if
# multiple matches are detected and save matched information into the index file
sm <- summary_database(tempdir(), by = c("source", "variable"), mult = "latest", update = TRUE)
knitr::kable(sm)
```
### Extract CMIP6 output data
* With previous step, now we can match coordinates of an EPW in the CMIP6 output
file
```{r coord}
epw <- file.path(eplusr::eplus_config(8.8)$dir, "WeatherData/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw")
# match any coordinates with absolute distance less than 1 degree
coord <- match_coord(epw, threshold = list(lon = 1, lat = 1), max_num = 1)
class(coord)
names(coord)
coord$meta
coord$coord[, .(file_path, coord)]
str(coord$coord$coord[[1]])
```
* Once we get the matched coordinates, we can extract corresponding data related
to input EPW file using `extract_data()`
```{r data}
data <- extract_data(coord, years = c(2050, 2080))
class(data)
names(data)
knitr::kable(head(data$data))
```
### Morphing EPW weather variables
* With all necessary information extracted above, now we can perform morphing on
out EPW
```{r morph}
morphed <- morphing_epw(data)
class(morphed)
names(morphed)
knitr::kable(head(morphed$tdb))
knitr::kable(head(morphed$rh))
```
### Create future EPW files
* Once we get the morphed data using `morphing_epw()`, we can now create future
EPW files using `future_epw()`
```{r epw}
# create future EPWs grouped by GCM, experiment ID, interval (year)
epws <- future_epw(morphed, by = c("source", "experiment", "interval"),
dir = tempdir(), separate = TRUE, overwrite = TRUE
)
epws
sapply(epws, function (epw) epw$path())
```
## Author
Hongyuan Jia and Adrian Chong
## License
* **epwshiftr**
epwshiftr is released under the terms of MIT License.
Copyright © 2019-2024 Hongyuan Jia and Adrian Chong
* **CMIP6 data**
> To enable modeling groups and others who support CMIP6 to demonstrate its
> impact (and secure ongoing funding), you are required to cite and
> acknowledge those who have made CMIP6 possible. You also must abide by any
> licensing restrictions, which are recorded in each file as a global
> attribute (named “license”).
>
> Please carefully read and adhere to the [CMIP6 Terms of Use](https://pcmdi.llnl.gov/CMIP6/TermsOfUse/).
## Disclaimer
CMIP6 model data is licensed under a [Creative Commons Attribution-ShareAlike
4.0 International License](https://creativecommons.org/licenses/).
Consult [Terms of Use](https://pcmdi.llnl.gov/CMIP6/TermsOfUse/) for terms of use
governing CMIP6 output, including citation requirements and proper
acknowledgment. Further information about each GCM output data, including some
limitations, can be found via the `further_info_url` (recorded as a **global
attribute** in the NetCDF file) and at [EC-Earth](https://ec-earth.org/). The
data producers and data providers make no warranty, either express or implied,
including, but not limited to, warranties of merchantability and fitness for a
particular purpose. All liabilities arising from the supply of the information
(including any liability arising in negligence) are excluded to the fullest
extent permitted by law.
## Contribute
If you encounter a clear bug or have questions about the usage, please file an
issue with a minimal reproducible example on
[GitHub](https://github.com/ideas-lab-nus/epwshiftr/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
If you have a solution for an existing bug or an implementation for a missing
feature, please send a pull request and let us review.
------------------------------------------------------------------------
Please note that the 'epwshiftr' project is released with a
[Contributor Code of Conduct](https://github.com/ideas-lab-nus/epwshiftr/blob/master/.github/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.
Owner metadata
- Name: IDEAS-lab
- Login: ideas-lab-nus
- Email: adrian.chong@nus.edu.sg
- Kind: organization
- Description:
- Website: https://ideaslab.io
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/49540067?v=4
- Repositories: 5
- Last ynced at: 2023-03-08T00:36:52.335Z
- Profile URL: https://github.com/ideas-lab-nus
GitHub Events
Total
- Watch event: 7
- Delete event: 1
- Issue comment event: 1
- Push event: 3
- Fork event: 2
Last Year
- Watch event: 5
- Issue comment event: 1
- Push event: 3
- Fork event: 2
Committers metadata
Last synced: 4 days ago
Total Commits: 187
Total Committers: 3
Avg Commits per committer: 62.333
Development Distribution Score (DDS): 0.209
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Hongyuan Jia | h****a@b****g | 148 |
| Hongyuan Jia | h****a@c****n | 35 |
| Adrian Chong | a****g@n****g | 4 |
Committer domains:
- nus.edu.sg: 1
- cqust.edu.cn: 1
- bears-berkeley.sg: 1
Issue and Pull Request metadata
Last synced: 12 days ago
Total issues: 50
Total pull requests: 43
Average time to close issues: 3 months
Average time to close pull requests: 6 days
Total issue authors: 10
Total pull request authors: 1
Average comments per issue: 0.34
Average comments per pull request: 0.49
Merged pull request: 41
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 0
Past year average comments per issue: 2.0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- hongyuanjia (37)
- mitmat (4)
- chrisdane (2)
- IsaakBM (1)
- lolow (1)
- San42 (1)
- milonbrri (1)
- mohy74 (1)
- dvictori (1)
- germolinal (1)
Top Pull Request Authors
- hongyuanjia (43)
Top Issue Labels
- feature (11)
- enhancement (8)
- bug (7)
- documentation (6)
- JOSS (5)
- CI (4)
- CRAN (2)
- question (2)
- refactor (1)
Top Pull Request Labels
- documentation (12)
- feature (11)
- bug (9)
- enhancement (4)
- CI (4)
- CRAN (4)
- refactor (2)
Package metadata
- Total packages: 2
-
Total downloads:
- cran: 333 last-month
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 1 (may contain duplicates)
- Total versions: 10
- Total maintainers: 1
proxy.golang.org: github.com/ideas-lab-nus/epwshiftr
- Homepage:
- Documentation: https://pkg.go.dev/github.com/ideas-lab-nus/epwshiftr#section-documentation
- Licenses: other
- Latest release: v0.1.4 (published almost 2 years ago)
- Last Synced: 2025-12-26T17:03:33.793Z (3 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
cran.r-project.org: epwshiftr
Create Future 'EnergyPlus' Weather Files using 'CMIP6' Data
- Homepage: https://github.com/ideas-lab-nus/epwshiftr
- Status: removed
- Documentation: http://cran.r-project.org/web/packages/epwshiftr/epwshiftr.pdf
- Licenses: MIT + file LICENSE
- Latest release: 0.1.4 (published almost 2 years ago)
- Last Synced: 2025-12-26T17:03:32.651Z (3 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 1
- Downloads: 333 Last month
-
Rankings:
- Stargazers count: 10.228%
- Forks count: 10.858%
- Average: 20.355%
- Dependent repos count: 24.3%
- Dependent packages count: 27.852%
- Downloads: 28.536%
- Maintainers (1)
Dependencies
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/cache v1 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v2 composite
- r-lib/actions/pr-fetch v2 composite
- r-lib/actions/pr-push v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- PCICt * imports
- R6 * imports
- RNetCDF * imports
- checkmate >= 2.0.0 imports
- cli >= 3.4.0 imports
- data.table >= 1.12.4 imports
- eplusr >= 0.15.2 imports
- fst * imports
- future.apply * imports
- jsonlite * imports
- progressr * imports
- psychrolib * imports
- rappdirs * imports
- units * imports
- curl * suggests
- knitr * suggests
- mockery * suggests
- pingr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- withr * suggests
Score: 10.804563118603802