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

globalop field in griddata is incorrect when grid cells are missing #35

Closed
rplzzz opened this issue Nov 14, 2019 · 0 comments
Closed

globalop field in griddata is incorrect when grid cells are missing #35

rplzzz opened this issue Nov 14, 2019 · 0 comments
Assignees
Labels

Comments

@rplzzz
Copy link
Contributor

rplzzz commented Nov 14, 2019

When part of a grid is missing, as, for example, in the land-only data files provided by ISIMIP, we drop all of the grid cells containing NA values:

fldgen/R/handle_NAs.R

Lines 50 to 55 in c8e220d

## Find the grid cells with valid data
valid_cells <- which(nmiss == 0)
## Drop missing cells from vardata and globalop
griddata$vardata <- griddata$vardata[ , valid_cells]
griddata$globalop <- griddata$globalop[valid_cells, ]

The globalop field is the global mean operator; we have to drop the missing values from there too. However, for the global mean operator to do its job, it has to be scaled so that it sums up to 1, and we don't rescale it here. This causes our global mean temperatures to be bogus.

> emu <- train_models('IPSL-CM5A-LR')
> sum(emu$griddataT$globalop)
[1] 0.2869764
> summary(emu$tgav)
       V1       
 Min.   :81.73  
 1st Qu.:82.01  
 Median :82.16  
 Mean   :82.39  
 3rd Qu.:82.73  
 Max.   :84.28  
@rplzzz rplzzz added the bug label Nov 14, 2019
@rplzzz rplzzz self-assigned this Nov 14, 2019
@rplzzz rplzzz closed this as completed in fd9eeb3 Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant