brenovisk7
brenovisk7

Reputation: 35

Is there any way to work with NetCDF files in Nim?

I've discovered Nim some days ago and am really interested in it.
However, I need to know if I'd able to work with NetCDF files (or at least GRB files) to see if it is suitable for my every-day life.
I've searched the web for some library or code, but couldn't find any, so if anybody knows a way to do it, please let me know.

Upvotes: 2

Views: 133

Answers (2)

ingo
ingo

Reputation: 117

use the NetCFD tool ncks to extract the data as NCO-JSON (pdf) then parse the JSON with jsony into nim objects.

Upvotes: 0

pietroppeter
pietroppeter

Reputation: 1473

Possible options (as of September 2020) to work with netcdf files using nim:

  • since netcdf4 is based on hdf5, maybe nimhdf5 could be useful
  • using nimpy bridge to access python libraries that access netcdf, such as netcdf4-python (your local python environment will be a dependency)
  • wrap netcdf C api using tools like c2nim or nimterop

Upvotes: 2

Related Questions