csv

package
v0.0.0-...-a46f264 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package csv writes comma-separated values (CSV) files using the LTER default CSV format.

The format looks as follows:

time,station,landuse,elevation,latitude,longitude,a_avg,wind_speed,air_rh_avg,precip_rt_nrt_tot
,,,,,,c,km/h,%,mm
2020-01-01 00:15:00,s1,me_s1,1000,3.14159,2.71828,0,0,0,0
2020-01-01 00:30:00,s1,me_s1,1000,3.14159,2.71828,1,1,1,1
2020-01-01 00:45:00,s1,me_s1,1000,3.14159,2.71828,2,2,2,2
2020-01-01 00:15:00,s2,me_s2,1000,3.14159,2.71828,0,0,0,0
2020-01-01 00:30:00,s2,me_s2,1000,3.14159,2.71828,1,1,1,1
2020-01-01 00:45:00,s2,me_s2,1000,3.14159,2.71828,2,2,2,2

Index

Constants

View Source
const DefaultTimeFormat = "2006-01-02 15:04:05"

DefaultTimeFormat defines the default format for timestamps in the CSV output.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

Writer writes a browser.TimeSeries as a CSV file. It wraps a default csv.Writer.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter returns a new Writer that writes to w.

func (*Writer) Write

func (w *Writer) Write(ts browser.TimeSeries) error

Write writes the given browser.TimeSeries as CSV file.

Jump to

Keyboard shortcuts

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