Skip to content

Commit

Permalink
bug fixed in getBiasFactor
Browse files Browse the repository at this point in the history
bug fixed in getBiasFactor
  • Loading branch information
Yuanchao-Xu committed Sep 27, 2018
1 parent 3f7470a commit cb75c3e
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .Rproj.user/7DCFFB88/sdb/per/t/B4594EC

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .Rproj.user/7DCFFB88/sdb/prop/INDEX
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
~%2FGitHub%2Fhyfo%2FDESCRIPTION="9E7FEC5D"
~%2FGitHub%2Fhyfo%2FNEWS="F6FD6B5D"
~%2FGitHub%2Fhyfo%2FR%2FbiasCorrect(generic).R="284FBADF"
~%2FGitHub%2Fhyfo%2FR%2Fmulti-biasCorrect(generic).R="8D6FC6B0"
~%2FGitHub%2Fhyfo%2FR%2Fncdf.R="3AC0369"
~%2FGitHub%2Fhyfo%2FREADME.md="F3D2C6B8"
~%2FGitHub%2Fhyfo%2Fvignettes%2Fhyfo.Rmd="7142D528"
1 change: 1 addition & 0 deletions .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
C:/Users/User/Documents/GitHub/hyfo/vignettes/hyfo.Rmd="BE89A8F"
C:/Users/user/Documents/GitHub/hyfo/R/extractPeriod(generic).R="35D21910"
C:/Users/user/Documents/GitHub/hyfo/vignettes/hyfo.Rmd="E84A6BF8"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Network Trash Folder
Temporary Items
.apdisk
inst/doc
.Rproj.user
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: hyfo
Type: Package
Title: Hydrology and Climate Forecasting
Version: 1.3.9
Date: 2017-2-20
Version: 1.4.0
Date: 2018-9-27
Authors@R: person("Yuanchao", "Xu", email = "[email protected]",
role = c("aut", "cre"))
Description: Focuses on data processing and visualization in hydrology and
Expand Down Expand Up @@ -39,4 +39,4 @@ LazyData: true
URL: https://yuanchao-xu.github.io/hyfo/
BugReports: https://github.com/Yuanchao-Xu/hyfo/issues
Repository: CRAN
RoxygenNote: 6.0.1
RoxygenNote: 6.1.0
8 changes: 8 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
hyfo 1.4.0
==========
Date: 2018-9-27

- "memberIndex" length zero bug fixed in getBiasFactor



hyfo 1.3.9
==========
Date: 2017-2-20
Expand Down
3 changes: 3 additions & 0 deletions R/biasCorrect(generic).R
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ biasCorrect.list <- function(frc, hindcast, obs, method, scaleType, preci, prThr

# Now real bias correction is executed.

# for some forcasts, they have results from different models or scenarios, if so
# there will be a dimension called member

memberIndex <- grepAndMatch('member', attributes(frcData)$dimensions)

# For dataset that has a member part
Expand Down
7 changes: 5 additions & 2 deletions R/multi-biasCorrect(generic).R
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,14 @@ getBiasFactor.list <- function(hindcast, obs, method, scaleType, preci, prThresh


# Now real bias correction is executed.
# for some forcasts, they have results from different models or scenarios, if so
# there will be a dimension called member


memberIndex <- grepAndMatch('member', attributes(hindcastData)$dimensions)

# For dataset that has a member part
if (!is.na(memberIndex)) {
if (length(memberIndex) != 0) {

hindcastData <- adjustDim(hindcastData, ref = c('lon', 'lat', 'time', 'member'))

Expand Down Expand Up @@ -573,7 +576,7 @@ applyBiasFactor.list <- function(frc, biasFactor, obs) {
memberIndex <- grepAndMatch('member', attributes(frcData)$dimensions)

# For dataset that has a member part
if (!is.na(memberIndex)) {
if (length(memberIndex) != 0) {
# check if frcData and hindcastData has the same dimension and length.
if (calcuDim(frcData, dim = 'member') != memberDim) {
stop('frc data has different member number from hindcast.')
Expand Down
6 changes: 4 additions & 2 deletions man/applyBiasFactor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions man/biasCorrect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/collectData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/extractPeriod.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/getAnnual.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/getMeanPreci.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/getPreciBar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/getSpatialMap_mat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/plotTS.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb75c3e

Please sign in to comment.