Documentation ¶
Overview ¶
Package ncmem is a Go binding for the netCDF C library's in-memory operations.
NetCDF version 4.6.2 or later is required.
In-memory support is documented here: https://www.unidata.ucar.edu/software/netcdf/docs/md__Volumes_Workspace_releases_netcdf-c-4_87_84_netcdf-c_docs_inmemory.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes struct { Data []byte // contains filtered or unexported fields }
Bytes provides a view into C allocated data. It's Free method method must be called to release the memory.
type Dataset ¶
Dataset wraps netcdf.Dataset, adding methods specific to in-memory datasets.
Must be closed via one of the added Close, CloseBytes, or CloseCopyBytes methods to properly release memory.
func Create ¶
Create creates a new in-memory dataset. Path sets the dataset name. Mode is a bitwise-or of netcdf.FileMode values. InitialSize is a hint for the initial amount of memory to allocate for the dataset.
func Open ¶
Open opens an existing netCDF dataset from a copy of the provided data. Path sets the dataset name. Mode is a bitwise-or of netcdf.FileMode values. Flags is a bitwise-or of Flags values.
func OpenReader ¶
func OpenReader(path string, mode netcdf.FileMode, flags Flags, r io.Reader) (ds Dataset, err error)
OpenReader reads and opens an existing netCDF dataset from r. Path sets the dataset name. Mode is a bitwise-or of netcdf.FileMode values. Flags is a bitwise-or of Flags values.
If r fulfills LenReader, it's Len method will be used to determine how much memory to allocate.
func (Dataset) Close ¶
Close closes and releases the memory of the dataset.
Use CloseMem to retrieve the in-memory data.
func (Dataset) CloseBytes ¶
CloseBytes closes the dataset and returns a reference to C allocated memory.
func (Dataset) CloseCopyBytes ¶
CloseCopyBytes closes the dataset and returns a copy of the in-memory data.
type Flags ¶
Flags define how the netCDF library should manage memory.
const (
MEMIO_LOCKED Flags = C.NC_MEMIO_LOCKED
)
Flags for Open.