toa5

package module
v0.0.0-...-886ff9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

README

toa5

GoDoc

toa5 provides a reader for TOA5 files. This format is used as an output format by the CR1000 data loggers of Campbell Scientific.

License

The library is distributed under the BSD-style licence found in LICENSE file.

Documentation

Overview

Package toa5 provides a reader for TOA5 files. The TOA5 file format is used as an output format by the CR1000 data loggers of Campbell Scientific.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTOA5File        = errors.New("no TOA5 file")
	ErrEmptyRecord       = errors.New("empty record name")
	ErrNoOptions         = errors.New("no options provided")
	ErrEnvironmentLength = errors.New("environment line has missing fields")
)

General errors.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	Filetype  string
	Station   string
	Model     string
	Serial    string
	OSVersion string
	Program   string
	Signature string
	Table     string
}

Environment denotes the first header line in a TOA5 file.

type Options

type Options struct {
	TimeLayout   string
	TimeLocation *time.Location
	Delimiter    rune
}

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a reader for TOA5 files and wraps and csv.Reader.

func NewReader

func NewReader(in io.Reader) (*Reader, error)

NewReader will return a new TOA5 reader.

func NewReaderWithOptions

func NewReaderWithOptions(in io.Reader, opt *Options) (*Reader, error)

func (*Reader) Aggregation

func (r *Reader) Aggregation() []string

Aggregation returns the aggregation header line of the TOA5.

func (*Reader) Environment

func (r *Reader) Environment() *Environment

Environment returns the environment header line of the TOA5.

func (*Reader) Fields

func (r *Reader) Fields() []string

Fields returns the field header line of the TOA5.

func (*Reader) Read

func (r *Reader) Read() (*Record, error)

Read reads and returns a Record.

func (*Reader) Units

func (r *Reader) Units() []string

Units returns the unit header line of the TOA5.

type Record

type Record struct {
	Timestamp   time.Time
	Value       float64
	Name        string
	Unit        string
	Aggregation string
}

Record denotes a single record in a TOA5 file with its associated metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL