Haskell NetCDF library https://github.com/ian-ross/hnetcdf
|Latest on Hackage:||0.4.0.0|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Haskell NetCDF library: as well as conventional low-level FFI bindings
to the functions in the NetCDF library (in the
hnetcdf provides a higher-level Haskell interface
(currently only for reading data). This higher-level interface aims
to provide a "container polymorphic" view of NetCDF data allowing
NetCDF variables to be read into
Vectors and Repa arrays
import Data.NetCDF import Foreign.C import qualified Data.Vector.Storable as SV ... type SVRet = IO (Either NcError (SV.Vector a)) ... enc <- openFile "tst.nc" ReadMode case enc of Right nc -> do eval <- get nc "varname" :: SVRet CDouble ...
gets the full contents of a NetCDF variable as a
while the following code reads the same variable (assumed to be
three-dimensional) into a Repa array:
import Data.NetCDF import Foreign.C import qualified Data.Array.Repa as R import qualified Data.Array.Repa.Eval as RE import Data.Array.Repa.Repr.ForeignPtr (F) ... type RepaRet3 a = IO (Either NcError (R.Array F R.DIM3 a)) ... enc <- openFile "tst.nc" ReadMode case enc of Right nc -> do eval <- get nc "varname" :: RepaRet3 CDouble ...
Breaking change: fix problem with hmatrix API -- replace
HMatrixtype and manage data ordering internally.
Update to work with hmatrix 0.16
- Add partial output API