weather

package
v0.0.0-...-d6154dd Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2014 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Provides interface to weather data from Chapelco Ski Resort weather station via Google Drive

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadLastNAbsPressures

func ReadLastNAbsPressures(table *godbf.DbfTable, n int) []float64

ReadLastNAbsPressures reads the last n PRES_ABS records

func ReadLastNDateTimes

func ReadLastNDateTimes(table *godbf.DbfTable, n int) []string

ReadLastNDateTimes reads the last n DATE_TIME records

func ReadLastNDewPoints

func ReadLastNDewPoints(table *godbf.DbfTable, n int) []float64

ReadLastNDewPoints reads the last n CHN1_DEW records

func ReadLastNFromFloat64Field

func ReadLastNFromFloat64Field(table *godbf.DbfTable, n int, field string) []float64

ReadLastNFromFloat64Field reads the last n records by field string

func ReadLastNPressures

func ReadLastNPressures(table *godbf.DbfTable, n int) []float64

ReadLastNPressures reads the last n PRES_LOC records

func ReadLastNRainSums

func ReadLastNRainSums(table *godbf.DbfTable, n int) []float64

ReadLastNRainSums reads the last n RAIN_SUM records

func ReadLastNRelativeHumidities

func ReadLastNRelativeHumidities(table *godbf.DbfTable, n int) []float64

ReadLastNRelativeHumidities reads the last n CHN1_RF records

func ReadLastNTemperatures

func ReadLastNTemperatures(table *godbf.DbfTable, n int) []float64

ReadLastNTemperatures reads the last n CHN1_DEG records

func ReadLastNWeatherRecordsToMap

func ReadLastNWeatherRecordsToMap(n int) map[string]interface{}

ReadLastNWeatherRecordsToMap reads the last n records in separate lists into a map with keys from code.

Types

type CachedDbfTable

type CachedDbfTable struct {
	DbfTable *godbf.DbfTable

	sync.RWMutex
	// contains filtered or unexported fields
}

CachedDbfTable consists of DbfTable which holds a godbf.DfTable, updatedAt contains the time.Time it was last updated, and holds a Read/Write lock to insure that the table is in sync with when it was last updated.

type WeatherRecord

type WeatherRecord struct {
	Datetime         time.Time
	LocalPressure    float64
	AbsolutePressure float64
	Temperature      float64
	DewPoint         float64
	RainSum          float64
	RelativeHumidity float64
}

WeatherRecord represents one weather observation from the weather station

func ReadCurrentWeatherRecord

func ReadCurrentWeatherRecord() *WeatherRecord

ReadCurrentWeatherRecord reads the most recent (last 1) WeatherRecord from the DbfTable

func ReadLastNWeatherRecords

func ReadLastNWeatherRecords(n int) []WeatherRecord

ReadLastNWeatherRecords reads the last n records from the cached DbfTable

func ReadLastNWeatherRecordsFromDbf

func ReadLastNWeatherRecordsFromDbf(table *godbf.DbfTable, n int) []WeatherRecord

ReadLastNWeatherRecordsFromDbf reads the last n WeatherRecords from the DbfTable

func ReadWeatherRecordFromDbf

func ReadWeatherRecordFromDbf(table *godbf.DbfTable, n int) *WeatherRecord

ReadWeatherRecordFromDbf reads a single WeatherRecord from the given Dbf Table.

Jump to

Keyboard shortcuts

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