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

How to save biascorrected grids? #49

Open
Fisico2k opened this issue Oct 4, 2022 · 1 comment
Open

How to save biascorrected grids? #49

Fisico2k opened this issue Oct 4, 2022 · 1 comment

Comments

@Fisico2k
Copy link

Fisico2k commented Oct 4, 2022

After biasCorrection command, I need to save the resulting grid in netCDF format. I use grid2nc command and the file is correctly created. But when I try to reopen ti with loadGridData there is this error:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3

Actually, I note that files correctly opened by loadGridData (i.e. ESGF model outputs) have this output:

dataInventory("path_to_file")
$pr =
$Description
'Precipitation'
...... etc........
$Dimensions
$time
...etc....
$lat
...etc...
$lon
...etc...

On the contrary files from bias-corrected grids have this type of output:

dataInventory("path_to_file")
$pr =
$Description
'Precipitation'
...... etc........
$Dimensions
$lat
...etc...
$lon
...etc...

It seems theere is no time dimension and the error seems to depend on it (Am I right???).
But time data are actually presente in the grid! Only the format is different indeed.
It is so:

$Dates
$start
'2021-01-01 UTC'.....................

Otherwise in "ordinary" grids it is so:

$Dates
$start
'2021-01-01 12:00:00 GMT'.....................

Anybody can help me to try to solve?

@durutti
Copy link

durutti commented Oct 27, 2022

your bias adjusted grid variable data shoud be a 3D array with dims time lat lon. What are dimensions of the grids going into biasCorrection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants