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

Save Permuted Cube is not working - saveCube(x::SubCubePerm) #105

Closed
milanflach opened this issue Feb 25, 2019 · 3 comments
Closed

Save Permuted Cube is not working - saveCube(x::SubCubePerm) #105

milanflach opened this issue Feb 25, 2019 · 3 comments

Comments

@milanflach
Copy link
Collaborator

Permuted Cubes of type SubCubePerm{Union{Missing, T}} cannot be saved as there is no method definition for SubCubePerm to be used by saveCube. @Fgans Is it possible to add a new mathod to saveCube?
Minimal Example to reproduce the error:

using ESDL
c = "/Path/2Cube"
cdata = getCubeData(c, variable = "gross_primary_productivity", region = "Belgium")
perm_cdata = permutedims(cdata, (3,1,3))
saveCube(perm_cdata, "/scratch/path2saveCube")
@milanflach
Copy link
Collaborator Author

sorry should be @meggart
and

perm_cdata = permutedims(cdata, (3,1,2))

@meggart
Copy link
Member

meggart commented Feb 25, 2019

It would not be trivial, do you want the values to be stored in the permuted order? Otherwise, you could save the unpermuted cube and then permute after loading? Otherwise, just doing a non-operation and then saving should work:

remappedcube = mapCube(copyto!,perm_cdata,indims=InDims("Time"),outdims=OutDims("Time"))
saveCube(remappedCube, "/scratch/path2save")

@milanflach
Copy link
Collaborator Author

Ok, I already use this solution, thought there is a trivial fix for that...

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