Documentation ¶
Overview ¶
Package cdf supports v1 (classic), v2 (64-bit offset) and v5 file formats.
Index ¶
- Variables
- func New(file api.ReadSeekerCloser) (ag api.Group, err error)
- func Open(fname string) (api.Group, error)
- func SetLogLevel(level int) int
- type CDF
- func (cdf *CDF) Attributes() api.AttributeMap
- func (cdf *CDF) Close()
- func (cdf *CDF) GetDimension(name string) (uint64, bool)
- func (cdf *CDF) GetGoType(name string) (string, bool)
- func (cdf *CDF) GetGroup(group string) (g api.Group, err error)
- func (cdf *CDF) GetType(name string) (string, bool)
- func (cdf *CDF) GetVarGetter(name string) (slicer api.VarGetter, err error)
- func (cdf *CDF) GetVariable(name string) (v *api.Variable, err error)
- func (cdf *CDF) ListDimensions() []string
- func (cdf *CDF) ListSubgroups() []string
- func (cdf *CDF) ListTypes() []string
- func (cdf *CDF) ListVariables() []string
- type CDFWriter
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotCDF = errors.New("not a CDF file") ErrUnsupportedVersion = errors.New("unsupported CDF version") ErrUnknownVersion = errors.New("unknown CDF version") ErrUnknownType = errors.New("unknown type") ErrCorruptedFile = errors.New("corrupted file") ErrNotFound = errors.New("not found") ErrNoStreamingDimensions = errors.New("streaming dimensions not supported") ErrInternal = errors.New("internal error") ErrDuplicateVariable = errors.New("duplicate variable") ErrTooManyDimensions = errors.New("too many dimensions") ErrFillValue = errors.New("fill value not a scalar") )
var ( ErrUnlimitedMustBeFirst = errors.New("unlimited dimension must be first") ErrDimensionSize = errors.New("dimension doesn't match size") ErrInvalidName = errors.New("invalid name") ErrAttribute = errors.New("invalid attribute") ErrEmptySlice = errors.New("empty slice encountered") )
Functions ¶
func New ¶
func New(file api.ReadSeekerCloser) (ag api.Group, err error)
New is the implementation of the API netcdf.New. Using netcdf.New is preferred over using this directly.
func Open ¶
Open is the implementation of the API netcdf.Open. Using netcdf.Open is preferred over using this directly.
func SetLogLevel ¶
SetLogLevel sets the logging level to the given level, and returns the old level. This is for internal debugging use. The log messages are not expected to make much sense to anyone but the developers. The lowest level is 0 (no error logs at all) and the highest level is 3 (errors, warnings and debug messages).
Types ¶
type CDF ¶
type CDF struct {
// contains filtered or unexported fields
}
func (*CDF) Attributes ¶
func (cdf *CDF) Attributes() api.AttributeMap
Attributes returns the global attributes for this group.
func (*CDF) Close ¶
func (cdf *CDF) Close()
Close closes this group and closes any underlying files if they are no longer being used by any other groups.
func (*CDF) GetDimension ¶
GetDimension returns the value of the named dimension.
func (*CDF) GetGroup ¶
GetGroup gets the given group or returns an error if not found. The group can start with "/" for absolute names, or relative.
func (*CDF) GetVarGetter ¶
GetVarGetter is an function that returns an interface that allows you to get smaller slices of a variable, in case the variable is very large and you want to reduce memory usage.
func (*CDF) GetVariable ¶
GetVariable returns the named variable or sets the error if not found.
func (*CDF) ListDimensions ¶
ListDimensions lists the names of the dimensions.
func (*CDF) ListSubgroups ¶
ListSubgroups returns the names of the subgroups of this group
func (*CDF) ListTypes ¶
ListTypes just returns an empty list because there are no user-defined types in CDF
func (*CDF) ListVariables ¶
ListVariables lists the variables in this group.
type CDFWriter ¶
type CDFWriter struct {
// contains filtered or unexported fields
}
func OpenWriter ¶
OpenWriter creates the file and make it available for writing using AddVar and AddGlobalAttrs. The file must be closed to actually write it out.
func (*CDFWriter) AddGlobalAttrs ¶
func (cw *CDFWriter) AddGlobalAttrs(attrs api.AttributeMap) error
AddGlobalAttrs adds global attributes to be written out. Use util.NewOrderedMap to create attribute maps.