-
Notifications
You must be signed in to change notification settings - Fork 25
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
terra-based reading/writing of netcdf files #156
Conversation
In testing this, I wrote a magclass object with 12 subdimensions until 2100. In a .mz format, this was around 36 mb. The write function worked, but produced a 227 mb sized .nc file (which I could interact with in Panoply fine, it seemed). However, this extremely large file breaks the readMagpieNC function (it hangs). I can do some more tests when I have more time, but are .nc files usually 9x larger than their .mz equivalents? Even the uncompressed (.m) magpie file is only ~50 mb. |
@tscheypidi Please have a look, this may fix the CRAN windows problem. @dklein-pik had the same problem locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these changes test-readwritemagpie.R:87:3
, which previously failed on my Windows computer, works again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks!
The existing read/write support for netcdf based on ncdf4 and raster was not quite working as discussed on mattermost. With this PR nc files are written and read using terra.
The author of raster and terra recommends to not use the netcdf writing feature of raster, see here.