hnetcdf: Haskell NetCDF library

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Bindings to the Unidata NetCDF library, along with a higher-level Haskell interface that attempts to provide container polymorphic data access (initially just Storable vectors and Repa arrays).


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.5.0.0
Change logCHANGELOG.markdown
Dependenciesbase (>=4.3 && <5), containers (>=0.5.0.0 && <0.7), filepath (==1.4.*), hnetcdf, repa (==3.4.*), transformers (>=0.2 && <0.6), vector (==0.12.*) [details]
LicenseBSD-3-Clause
CopyrightCopyright (2013) Ian Ross
AuthorIan Ross
Maintainerian@skybluetrades.net
CategoryData
Home pagehttps://github.com/ian-ross/hnetcdf
Source repositoryhead: git clone https://github.com/ian-ross/hnetcdf
Executablesexample2, example1
UploadedWed Feb 6 08:32:20 UTC 2019 by DominicSteinitz

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for hnetcdf-0.5.0.0

[back to package description]

hnetcdf

Build Status

Haskell NetCDF library: as well as conventional low-level FFI bindings to the functions in the NetCDF library (in the Data.NetCDF.Raw modules), 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 Storable Vectors and Repa arrays easily.

For example:

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 Storable Vector, 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
      ...