Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeList(data [][]string, l ListDecoder) error
- func EncodeList(l ListEncoder) [][]string
- func Format(t time.Time) string
- func LoadList(path string, l ListDecoder) error
- func MarshalList(l ListEncoder) ([]byte, error)
- func ParseFloat64(s string) (float64, error)
- func ParseInt(s string) (int, error)
- func ParseSamplingRate(s string) (float64, error)
- func StoreList(path string, l ListEncoder) error
- func UnmarshalList(b []byte, l ListDecoder) error
- type Asset
- type AssetList
- type Calibration
- type CalibrationList
- type Channel
- type ChannelList
- type Citation
- type CitationList
- type Class
- type ClassList
- type Collection
- type Compare
- type Component
- type ComponentList
- type Connection
- type ConnectionList
- type Constituent
- type ConstituentList
- type Correction
- type Dart
- type DartList
- type DeployedDatalogger
- type DeployedDataloggerList
- type DeployedReceiver
- type DeployedReceiverList
- type Doi
- type Equipment
- type Feature
- type FeatureList
- type Field
- type FirmwareHistory
- type FirmwareHistoryList
- type Gain
- type GainList
- type Gauge
- type GaugeList
- type Header
- type Install
- type InstalledAntenna
- type InstalledAntennaList
- type InstalledCamera
- type InstalledCameraList
- type InstalledDoas
- type InstalledDoasList
- type InstalledMetSensor
- type InstalledMetSensorList
- type InstalledRadome
- type InstalledRadomeList
- type InstalledRecorder
- type InstalledRecorderList
- type InstalledSensor
- type InstalledSensorList
- type KeyValue
- type List
- type ListDecoder
- type ListEncoder
- type Mark
- type MarkList
- type MetSensorAccuracy
- type Monument
- type MonumentList
- type Mount
- type MountList
- type Network
- type NetworkList
- type Offset
- type Orientation
- type Placename
- type PlacenameList
- type Point
- type PointList
- type Polarity
- type PolarityList
- type Position
- type Preamp
- type PreampList
- type Range
- type Reference
- type Sample
- type SampleList
- type Scale
- type Session
- type SessionList
- type Set
- func (s Set) Asset(make, model, serial string) (Asset, bool)
- func (s Set) Assets() []Asset
- func (s Set) Calibrations() []Calibration
- func (s Set) Channels() []Channel
- func (s Set) Citation(key string) (Citation, bool)
- func (s Set) Citations() []Citation
- func (s Set) Class(station string) (Class, bool)
- func (s Set) Classes() []Class
- func (s *Set) Collections(site Site) []Collection
- func (s Set) Components() []Component
- func (s Set) Connections() []Connection
- func (s Set) Constituents() []Constituent
- func (set *Set) Corrections(coll Collection) []Correction
- func (s Set) Dart(station string) (Dart, bool)
- func (s Set) Darts() []Dart
- func (s *Set) DataloggerCalibrationCorrections(coll Collection) []Correction
- func (s Set) DeployedDataloggers() []DeployedDatalogger
- func (s Set) DeployedReceivers() []DeployedReceiver
- func (s Set) Doases() []InstalledDoas
- func (s Set) Features() []Feature
- func (s Set) FirmwareHistory() []FirmwareHistory
- func (s *Set) GainCorrections(coll Collection) []Correction
- func (s Set) Gains() []Gain
- func (s Set) Gauges() []Gauge
- func (s Set) InstalledAntennas() []InstalledAntenna
- func (s Set) InstalledCameras() []InstalledCamera
- func (s Set) InstalledMetSensors() []InstalledMetSensor
- func (s Set) InstalledRadomes() []InstalledRadome
- func (s Set) InstalledRecorders() []InstalledRecorder
- func (s Set) InstalledSensors() []InstalledSensor
- func (s *Set) KeyValue(name, label, desc string, entries map[string]string) TableList
- func (s Set) Mark(code string) (Mark, bool)
- func (s Set) Marks() []Mark
- func (s Set) Monument(mark string) (Monument, bool)
- func (s Set) Monuments() []Monument
- func (s Set) Mount(code string) (Mount, bool)
- func (s Set) Mounts() []Mount
- func (s Set) Network(code string) (Network, bool)
- func (s Set) Networks() []Network
- func (s Set) Placename(name string) (Placename, bool)
- func (s Set) Placenames() []Placename
- func (s Set) Point(sample, location string) (Point, bool)
- func (s Set) Points() []Point
- func (s Set) Polarities() []Polarity
- func (s *Set) PolarityCorrections(coll Collection) []Correction
- func (s *Set) PreampCorrections(coll Collection) []Correction
- func (s Set) Preamps() []Preamp
- func (s Set) Sample(code string) (Sample, bool)
- func (s Set) Samples() []Sample
- func (s *Set) SensorCalibrationCorrections(coll Collection) []Correction
- func (s Set) Sessions() []Session
- func (s Set) Site(station, location string) (Site, bool)
- func (s Set) Sites() []Site
- func (s Set) Station(code string) (Station, bool)
- func (s Set) Stations() []Station
- func (s Set) Streams() []Stream
- func (s *Set) TableList(extra ...TableList) []TableList
- func (s Set) Telemetries() []Telemetry
- func (s *Set) TelemetryCorrections(coll Collection) []Correction
- func (s *Set) TimingCorrections(coll Collection) []Correction
- func (s Set) Timings() []Timing
- func (s Set) View(mount, code string) (View, bool)
- func (s Set) Views() []View
- func (s Set) Visibilities() []Visibility
- type SetPathMap
- type Site
- type SiteList
- type Span
- type Station
- type StationList
- type Stream
- type StreamList
- type Table
- func (t Table) Columns() []string
- func (t Table) Encode(list ListEncoder) [][]string
- func (t Table) End() (string, bool)
- func (t Table) HasDateTime() (string, string, bool)
- func (t Table) IsDateTime(col int) bool
- func (t Table) IsForeign(col int) (string, bool)
- func (t Table) IsNative(col int) bool
- func (t Table) IsPrimary(col int) bool
- func (t Table) Name() string
- func (t Table) Remap(s string) string
- func (t Table) Scan() []string
- func (t Table) Start() (string, bool)
- type TableList
- type Telemetry
- type TelemetryList
- type Timing
- type TimingList
- type View
- type ViewList
- type Visibility
- type VisibilityList
Constants ¶
const ( RadiansToDegrees = 57.2957795 DegreesToKm = math.Pi * 6371.0 / 180.0 RadiansToKm = RadiansToDegrees * DegreesToKm )
const ( AssetFiles = "assets/*.csv" DartsFile = "network/darts.csv" MarksFile = "network/marks.csv" MonumentsFile = "network/monuments.csv" MountsFile = "network/mounts.csv" NetworksFile = "network/networks.csv" PointsFile = "network/points.csv" SamplesFile = "network/samples.csv" SitesFile = "network/sites.csv" StationsFile = "network/stations.csv" ViewsFile = "network/views.csv" AntennasFile = "install/antennas.csv" CalibrationsFile = "install/calibrations.csv" CamerasFile = "install/cameras.csv" ChannelsFile = "install/channels.csv" ComponentsFile = "install/components.csv" ConnectionsFile = "install/connections.csv" DataloggersFile = "install/dataloggers.csv" DoasesFile = "install/doases.csv" FirmwareFile = "install/firmware.csv" GainsFile = "install/gains.csv" MetsensorsFile = "install/metsensors.csv" PolaritiesFile = "install/polarities.csv" PreampsFile = "install/preamps.csv" RadomesFile = "install/radomes.csv" ReceiversFile = "install/receivers.csv" RecordersFile = "install/recorders.csv" SensorsFile = "install/sensors.csv" SessionsFile = "install/sessions.csv" StreamsFile = "install/streams.csv" TelemetriesFile = "install/telemetries.csv" TimingsFile = "install/timings.csv" ClassesFile = "environment/classes.csv" ConstituentsFile = "environment/constituents.csv" FeaturesFile = "environment/features.csv" GaugesFile = "environment/gauges.csv" PlacenamesFile = "environment/placenames.csv" VisibilityFile = "environment/visibility.csv" CitationsFile = "references/citations.csv" )
const DateTimeFormat = "2006-01-02T15:04:05Z"
DateTimeFormat is the standard date and time storage format used in the CSV files, it is assumed to have resolution of one second and that times are in UTC.
Variables ¶
var ErrInvalidDOI = errors.New("invalid DOI reference")
var StationTable = Table{ // contains filtered or unexported fields }
Functions ¶
func DecodeList ¶
func DecodeList(data [][]string, l ListDecoder) error
DecodeList converts a slice of string slices into a type that implements the ListDecoder interface, it returns a non empty error otherwise.
func EncodeList ¶
func EncodeList(l ListEncoder) [][]string
EncodeList converts a type that implements the ListEncoder interface into a slice of string slices.
func LoadList ¶
func LoadList(path string, l ListDecoder) error
LoadList reads and decodes a file into a type that implements the ListDecoder interface, it returns a non empty error otherwise.
func MarshalList ¶
func MarshalList(l ListEncoder) ([]byte, error)
MarshalList converts a type that implements the ListEncoder interface into a byte slice, or returns an error otherwise.
func ParseFloat64 ¶
ParseFloat64 converts a string into a float64 value. After trimming spaces, an empty string will return zero, otherwise the converted number is returned or an error if the conversion failed.
func ParseInt ¶
ParseInt converts a string into a int value. After trimming spaces, an empty string will return zero, otherwise the converted number is returned or an error if the conversion failed.
func ParseSamplingRate ¶
ParseSamplingRate converts a string into a float64 value representing a sampling rate. After trimming spaces, an empty string will return zero, otherwise the converted sample rate is returned or an error if the float64 conversion failed. For initial sampling rates that are found to be negative the inverse of the negative sampling rate is returned, the negative number indicates that the value is actually a sampling period.
func StoreList ¶
func StoreList(path string, l ListEncoder) error
StoreList encodes and writes into a file the contents of a type that implements the ListEncoder interface, it returns a non empty error otherwise.
func UnmarshalList ¶
func UnmarshalList(b []byte, l ListDecoder) error
UnmarshalList decodes a byte slice into a type that implements the ListDecoder interface, it returns a non empty error otherwise.
Types ¶
type Asset ¶
func LoadAssets ¶
type Calibration ¶
type Calibration struct { Install ScaleFactor float64 `json:"scale-factor"` ScaleBias float64 `json:"scale-bias"` ScaleAbsolute float64 `json:"scale-absolute"` Frequency float64 `json:"scale-frequency"` Number int `json:"number"` // contains filtered or unexported fields }
Calibration defines times where sensor scaling or offsets are needed, these will be overwrite the existing values, i.e. A + BX => A' + B' X, where A' and B' are the given bias and scaling factors.
func LoadCalibrations ¶
func LoadCalibrations(path string) ([]Calibration, error)
LoadCalibrations reads a CSV formatted file and returns a slice of Calibration types.
func (Calibration) Id ¶
func (c Calibration) Id() string
Id returns a unique string which can be used for sorting or checking.
func (Calibration) Less ¶
func (s Calibration) Less(calibration Calibration) bool
Less returns whether one Calibration sorts before another.
type CalibrationList ¶
type CalibrationList []Calibration
CalibrationList is a slice of Calibration types.
func (CalibrationList) Len ¶
func (c CalibrationList) Len() int
func (CalibrationList) Less ¶
func (c CalibrationList) Less(i, j int) bool
func (CalibrationList) Swap ¶
func (c CalibrationList) Swap(i, j int)
type Channel ¶
type Channel struct { Make string Model string Type string SamplingRate float64 Response string Number int // contains filtered or unexported fields }
Channel is used to describe a generic recording from a Datalogger.
func LoadChannels ¶
func (Channel) Description ¶
Description returns a short label for the channel model family.
type ChannelList ¶
type ChannelList []Channel
func (ChannelList) Len ¶
func (c ChannelList) Len() int
func (ChannelList) Less ¶
func (c ChannelList) Less(i, j int) bool
func (ChannelList) Swap ¶
func (c ChannelList) Swap(i, j int)
type Citation ¶
type Citation struct { Key string Author string Year int Title string Published string Volume string Pages string Doi Doi Link string Retrieved time.Time // contains filtered or unexported fields }
func LoadCitations ¶
type CitationList ¶
type CitationList []Citation
func (CitationList) Len ¶
func (c CitationList) Len() int
func (CitationList) Less ¶
func (c CitationList) Less(i, j int) bool
func (CitationList) Swap ¶
func (c CitationList) Swap(i, j int)
type Class ¶
type Class struct { Station string SiteClass string Vs30 float64 Vs30Quality string Tsite Range TsiteMethod string TsiteQuality string BasementDepth float64 DepthQuality string Link string Citations []string Notes string }
func LoadClasses ¶
type Collection ¶
type Collection struct { Span `json:"span"` Stream `json:"stream"` Channel `json:"channel"` Component `json:"component"` InstalledSensor `json:"installed-sensor"` DeployedDatalogger `json:"deployed-datalogger"` }
Collection describes the period where a sensor and a datalogger are co-located at a site with the associated streams.
func (Collection) Azimuth ¶
func (c Collection) Azimuth(polarity *Polarity) float64
Azimuth returns the horizontal orientation of the recorded stream in degrees from north.
func (Collection) Code ¶
func (c Collection) Code() string
Code returns the Channel code based on the Stream and Component values.
func (Collection) Dip ¶
func (c Collection) Dip(polarity *Polarity) float64
Dip returns the vertical orientation of the recorded stream in degrees from the vertical, positive values are downwards.
func (Collection) Less ¶
func (c Collection) Less(collection Collection) bool
Less compares whether one Collection will sort before another.
func (Collection) Subsource ¶
func (c Collection) Subsource() string
Subsource returns the Subsource code based on the Stream and Component values.
type Component ¶
type Component struct { Make string Model string Type string Number int Source string Subsource string Dip float64 Azimuth float64 Types string SamplingRate float64 Response string // contains filtered or unexported fields }
func LoadComponents ¶
func (Component) Description ¶
Description returns a short label for the channel model family.
type ComponentList ¶
type ComponentList []Component
func (ComponentList) Len ¶
func (c ComponentList) Len() int
func (ComponentList) Less ¶
func (c ComponentList) Less(i, j int) bool
func (ComponentList) Swap ¶
func (c ComponentList) Swap(i, j int)
type Connection ¶
type Connection struct { Span Station string `json:"station"` Location string `json:"location"` Place string `json:"place"` Role string `json:"role,omitempty"` Number int `json:"number,omitempty"` // contains filtered or unexported fields }
func LoadConnections ¶
func LoadConnections(path string) ([]Connection, error)
type ConnectionList ¶
type ConnectionList []Connection
func (ConnectionList) Len ¶
func (c ConnectionList) Len() int
func (ConnectionList) Less ¶
func (c ConnectionList) Less(i, j int) bool
func (ConnectionList) Swap ¶
func (c ConnectionList) Swap(i, j int)
type Constituent ¶
type Constituent struct { Span Gauge string Number int Name string Amplitude float64 Lag float64 // contains filtered or unexported fields }
func LoadConstituents ¶
func LoadConstituents(path string) ([]Constituent, error)
type ConstituentList ¶
type ConstituentList []Constituent
func (ConstituentList) Len ¶
func (c ConstituentList) Len() int
func (ConstituentList) Less ¶
func (c ConstituentList) Less(i, j int) bool
func (ConstituentList) Swap ¶
func (c ConstituentList) Swap(i, j int)
type Correction ¶
type Correction struct { Span Polarity *Polarity Gain *Gain Preamp *Preamp Telemetry *Telemetry Timing *Timing SensorCalibration *Calibration DataloggerCalibration *Calibration }
Correction contains adjustments to a Sensor and Datalogger instrument details to account for installation settings and changes.
type Dart ¶
type DeployedDatalogger ¶
type DeployedDatalogger struct { Install Place string `json:"place"` Role string `json:"role,omitempty"` }
func LoadDeployedDataloggers ¶
func LoadDeployedDataloggers(path string) ([]DeployedDatalogger, error)
type DeployedDataloggerList ¶
type DeployedDataloggerList []DeployedDatalogger
func (DeployedDataloggerList) Len ¶
func (dd DeployedDataloggerList) Len() int
func (DeployedDataloggerList) Less ¶
func (dd DeployedDataloggerList) Less(i, j int) bool
func (DeployedDataloggerList) Swap ¶
func (dd DeployedDataloggerList) Swap(i, j int)
type DeployedReceiver ¶
func LoadDeployedReceivers ¶
func LoadDeployedReceivers(path string) ([]DeployedReceiver, error)
type DeployedReceiverList ¶
type DeployedReceiverList []DeployedReceiver
func (DeployedReceiverList) Len ¶
func (dr DeployedReceiverList) Len() int
func (DeployedReceiverList) Less ¶
func (dr DeployedReceiverList) Less(i, j int) bool
func (DeployedReceiverList) Swap ¶
func (dr DeployedReceiverList) Swap(i, j int)
type Doi ¶
type Doi string
func MustDoi ¶
MustDoi returns a Doi value, or panics. This is useful for testing with known values.
func (Doi) MarshalText ¶
MarshalText implements the TextMarshaler interface.
func (*Doi) UnmarshalText ¶
UnmarshalText implements the TextUnmarshaler interface.
type Equipment ¶
type Equipment struct { // Make describes the manufacturer or equipment maker. Make string `json:"make"` // Model describes the manufacturer's model name. Model string `json:"model"` // Serial describes the manufacturer's identification of the device. Serial string `json:"serial"` }
Equipment represents an indiviual piece of hardware.
type Feature ¶
type Feature struct { Span Station string Location string Sublocation string Property string Description string Aspect string }
func LoadFeatures ¶
type FeatureList ¶
type FeatureList []Feature
func (FeatureList) Len ¶
func (f FeatureList) Len() int
func (FeatureList) Less ¶
func (f FeatureList) Less(i, j int) bool
func (FeatureList) Swap ¶
func (f FeatureList) Swap(i, j int)
type Field ¶
Field is a mapping between the expected field entry and the csv file column number. This allows finding the desired column without being explicitly constrained by the column contents or order.
type FirmwareHistory ¶
func LoadFirmwareHistory ¶
func LoadFirmwareHistory(path string) ([]FirmwareHistory, error)
type FirmwareHistoryList ¶
type FirmwareHistoryList []FirmwareHistory
func (FirmwareHistoryList) Len ¶
func (fh FirmwareHistoryList) Len() int
func (FirmwareHistoryList) Less ¶
func (fh FirmwareHistoryList) Less(i, j int) bool
func (FirmwareHistoryList) Swap ¶
func (fh FirmwareHistoryList) Swap(i, j int)
type Gain ¶
type Gain struct { Span Scale Station string Location string Sublocation string Subsource string Absolute float64 // contains filtered or unexported fields }
Gain defines times where sensor installation scaling or offsets are needed, these will be applied to the existing values, i.e. A * X + B => A * A' * X + B * A' + A * B' + C where A' and B' are the gain scale factor and bias and C is the absolute bias.
func (Gain) Subsources ¶
Subsources returns a sorted slice of single defined components.
type Gauge ¶
type Gauge struct { Span Reference Position Number string TimeZone float64 Crex string // contains filtered or unexported fields }
func LoadGauges ¶
type Header ¶
Header is used to manage the encoding and decoding of csv formatted files by using their column headers. This allows adding or removing columns in the file without breaking existing applications that may not understand or expect extra columns.
An example usage where data is a slice of csv rows.
var headers Header = map[string]int{ "Label": labelId, ... } fields := headers.Fields(data[0]) for _, v := range data[1:] { d := fields.Remap(v) label := d[labelId] ... }
type Install ¶
type Install struct { // Equipment respresents the actual installed equipment. Equipment // Span describes the installed time period. Span }
Install is a compounded struct the represents the installation of a piece of equipment over a given time period.
type InstalledAntenna ¶
type InstalledAntenna struct { Install Offset Mark string Azimuth float64 // contains filtered or unexported fields }
func LoadInstalledAntennas ¶
func LoadInstalledAntennas(path string) ([]InstalledAntenna, error)
type InstalledAntennaList ¶
type InstalledAntennaList []InstalledAntenna
func (InstalledAntennaList) Len ¶
func (ia InstalledAntennaList) Len() int
func (InstalledAntennaList) Less ¶
func (ia InstalledAntennaList) Less(i, j int) bool
func (InstalledAntennaList) Swap ¶
func (ia InstalledAntennaList) Swap(i, j int)
type InstalledCamera ¶
func LoadInstalledCameras ¶
func LoadInstalledCameras(path string) ([]InstalledCamera, error)
type InstalledCameraList ¶
type InstalledCameraList []InstalledCamera
func (InstalledCameraList) Len ¶
func (ic InstalledCameraList) Len() int
func (InstalledCameraList) Less ¶
func (ic InstalledCameraList) Less(i, j int) bool
func (InstalledCameraList) Swap ¶
func (ic InstalledCameraList) Swap(i, j int)
type InstalledDoas ¶
type InstalledDoas struct { Install Orientation Offset Mount string View string }
func LoadInstalledDoass ¶
func LoadInstalledDoass(path string) ([]InstalledDoas, error)
type InstalledDoasList ¶
type InstalledDoasList []InstalledDoas
func (InstalledDoasList) Len ¶
func (id InstalledDoasList) Len() int
func (InstalledDoasList) Less ¶
func (id InstalledDoasList) Less(i, j int) bool
func (InstalledDoasList) Swap ¶
func (id InstalledDoasList) Swap(i, j int)
type InstalledMetSensor ¶
type InstalledMetSensor struct { Install Position Mark string IMSComment string Accuracy MetSensorAccuracy }
func LoadInstalledMetSensors ¶
func LoadInstalledMetSensors(path string) ([]InstalledMetSensor, error)
type InstalledMetSensorList ¶
type InstalledMetSensorList []InstalledMetSensor
func (InstalledMetSensorList) Len ¶
func (ims InstalledMetSensorList) Len() int
func (InstalledMetSensorList) Less ¶
func (ims InstalledMetSensorList) Less(i, j int) bool
func (InstalledMetSensorList) Swap ¶
func (ims InstalledMetSensorList) Swap(i, j int)
type InstalledRadome ¶
func LoadInstalledRadomes ¶
func LoadInstalledRadomes(path string) ([]InstalledRadome, error)
type InstalledRadomeList ¶
type InstalledRadomeList []InstalledRadome
func (InstalledRadomeList) Len ¶
func (ir InstalledRadomeList) Len() int
func (InstalledRadomeList) Less ¶
func (ir InstalledRadomeList) Less(i, j int) bool
func (InstalledRadomeList) Swap ¶
func (ir InstalledRadomeList) Swap(i, j int)
type InstalledRecorder ¶
type InstalledRecorder struct { InstalledSensor DataloggerModel string }
func LoadInstalledRecorders ¶
func LoadInstalledRecorders(path string) ([]InstalledRecorder, error)
type InstalledRecorderList ¶
type InstalledRecorderList []InstalledRecorder
func (InstalledRecorderList) Len ¶
func (ir InstalledRecorderList) Len() int
func (InstalledRecorderList) Less ¶
func (ir InstalledRecorderList) Less(i, j int) bool
func (InstalledRecorderList) Swap ¶
func (ir InstalledRecorderList) Swap(i, j int)
type InstalledSensor ¶
type InstalledSensor struct { Install Orientation Offset Scale Station string `json:"station"` Location string `json:"location"` }
func LoadInstalledSensors ¶
func LoadInstalledSensors(path string) ([]InstalledSensor, error)
type InstalledSensorList ¶
type InstalledSensorList []InstalledSensor
func (InstalledSensorList) Len ¶
func (is InstalledSensorList) Len() int
func (InstalledSensorList) Less ¶
func (is InstalledSensorList) Less(i, j int) bool
func (InstalledSensorList) Swap ¶
func (is InstalledSensorList) Swap(i, j int)
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
KeyValue contains key value pairs and their labels.
type List ¶
type List interface { ListEncoder ListDecoder sort.Interface }
List is an interface the encapsulates the ListEncoder, ListDecoder and sort.Interface interfaces, suitable for reading and writing CSV files.
type ListDecoder ¶
type ListDecoder interface {
// contains filtered or unexported methods
}
ListDecoder is an interface for decoding a slice of string slices into a type, suitable for reading from a CSV file.
type ListEncoder ¶
type ListEncoder interface {
// contains filtered or unexported methods
}
ListEncoder is an interface for encoding a type into a slice of string slices, suitable for storing in a CSV file.
type MetSensorAccuracy ¶
type Monument ¶
type Monument struct { Span Mark string `json:"mark"` DomesNumber string `json:"domes-number"` MarkType string `json:"mark-type"` Type string `json:"type"` GroundRelationship float64 `json:"ground-relationship"` FoundationType string `json:"foundation-type"` FoundationDepth float64 `json:"foundation-depth"` Bedrock string `json:"bedrock"` Geology string `json:"geology"` // contains filtered or unexported fields }
func LoadMonuments ¶
type MonumentList ¶
type MonumentList []Monument
func (MonumentList) Len ¶
func (m MonumentList) Len() int
func (MonumentList) Less ¶
func (m MonumentList) Less(i, j int) bool
func (MonumentList) Swap ¶
func (m MonumentList) Swap(i, j int)
type Mount ¶
func LoadMounts ¶
type Network ¶
type Network struct { Code string `json:"network"` External string `json:"external"` Description string `json:"description"` Restricted bool `json:"restricted,omitempty"` }
func LoadNetworks ¶
type NetworkList ¶
type NetworkList []Network
func (NetworkList) Len ¶
func (n NetworkList) Len() int
func (NetworkList) Less ¶
func (n NetworkList) Less(i, j int) bool
func (NetworkList) Swap ¶
func (n NetworkList) Swap(i, j int)
type Offset ¶
type Offset struct { // Vertical represents an adjustment up or down, the exact interpretation will depend on the use case, // although it is assumed to have units of meters. Vertical float64 `json:"vertical,omitempty"` // North can be used to offset the installation to northwards, it is asusmed to have units of meters. North float64 `json:"north,omitempty"` // East can be used to offset the installation to eastwards, it is asusmed to have units of meters. East float64 `json:"east,omitempty"` // contains filtered or unexported fields }
Offset can be used to adjust an equipment installation relative to a given Position.
func (Offset) VerticalOk ¶
VerticalOk returns the Vertical offset and whether it has been set.
type Orientation ¶
type Orientation struct { // Dip represents the vertical deployment, with a zero value representing a horizontal installation, // a positive value indicating a installation downwards, whereas a negative value indicates an upward // facing installation. Dip float64 `json:"dip"` // Azimuth represents an equipment installation bearing, ideally with reference to true north. Azimuth float64 `json:"azimuth"` // Method can be used to indicate the method or measuring the azimuth. Method string `json:"method,omitempty"` // contains filtered or unexported fields }
Orientation is used to describe how a piece of installed equipment is aligned.
func (Orientation) AzimuthOk ¶
func (o Orientation) AzimuthOk() (float64, bool)
AzimuthOk returns the Azimuth and whether it has been set.
func (Orientation) DipOk ¶
func (o Orientation) DipOk() (float64, bool)
DipOk returns the Dip and whether it has been set.
type Placename ¶
type Placename struct { Name string Latitude float64 Longitude float64 Level int // contains filtered or unexported fields }
Placename is used to describe distances and azimuths to known places.
func LoadPlacenames ¶
func (Placename) Azimuth ¶
Azimuth returns the azimuth in degrees from the given latitude and longitude to the Placename.
func (Placename) BackAzimuth ¶
BackAzimuth returns the back-azimuth in degrees from the given latitude and longitude to the Placename.
type PlacenameList ¶
type PlacenameList []Placename
func (PlacenameList) Closest ¶
func (p PlacenameList) Closest(lat, lon float64) (Placename, bool)
Closest returns the Placename which is the closest to the given latitude and longitude taking into account the Placename level. The level is used to avoid small places taking precident over larger places at longer distances. Currently level three addresses will be used for distances within 20 km, level two within 100 km, level one within 500km, and level zero has no distance threshold.
func (PlacenameList) Description ¶
func (p PlacenameList) Description(lat, lon float64) string
Description returns a string representation of where a point location is relative to the nearest place.
func (PlacenameList) Len ¶
func (p PlacenameList) Len() int
func (PlacenameList) Less ¶
func (p PlacenameList) Less(i, j int) bool
func (PlacenameList) Swap ¶
func (p PlacenameList) Swap(i, j int)
type Point ¶
type Point struct { Position Span Sample string `json:"sample"` Location string `json:"location"` Survey string `json:"survey,omitempty"` }
func LoadPoints ¶
type Polarity ¶
type Polarity struct { Span Station string Location string Sublocation string Subsource string Primary bool Reversed bool Method string Citation string // contains filtered or unexported fields }
func LoadPolarities ¶
type PolarityList ¶
type PolarityList []Polarity
func (PolarityList) Len ¶
func (p PolarityList) Len() int
func (PolarityList) Less ¶
func (p PolarityList) Less(i, j int) bool
func (PolarityList) Swap ¶
func (p PolarityList) Swap(i, j int)
type Position ¶
type Position struct { // Latitude represents the location latitude, with negative values representing southern latitudes. Latitude float64 `json:"latitude"` // Longitude represents the location longitude, with negative values representing western longitudes. Longitude float64 `json:"longitude"` // Elevation represents the location height relative to the given datum. Elevation float64 `json:"elevation"` // Datum can be used to indicate the location measurement reference. Datum string `json:"datum,omitempty"` // Depth measures the depth of water at the measurement position, if appropriate. Depth float64 `json:"depth"` // contains filtered or unexported fields }
Position describes a measurement location geographically.
func (Position) ElevationOk ¶
ElevationOk returns the Elevation and whether it has been set.
type Preamp ¶
type Preamp struct { Span Station string Location string Subsource string ScaleFactor float64 // contains filtered or unexported fields }
Preamp describes when a datalogger is using an analogue pre-amplification gain setting to boost the input signal.
func LoadPreamps ¶
func (Preamp) Preamps ¶
Preamps returns a sorted slice of single Preamp entries by unpacking multiple subsources if present.
func (Preamp) Subsources ¶
Subsources returns a sorted slice of single byte defined components which allows unpacking multiple subsources.
type PreampList ¶
type PreampList []Preamp
func (PreampList) Len ¶
func (p PreampList) Len() int
func (PreampList) Less ¶
func (p PreampList) Less(i, j int) bool
func (PreampList) Swap ¶
func (p PreampList) Swap(i, j int)
type Reference ¶
type Reference struct { // Code is used to identify the measurement location. Code string `json:"code"` // Network can be used to group multiple measurement locations. Network string `json:"network"` // Name is used to label the measurement location. Name string `json:"name"` }
Reference describes a location where measurements can be taken.
type Sample ¶
Sample represents the location and time span of where data was manually collected.
func LoadSamples ¶
type SampleList ¶
type SampleList []Sample
SampleList is a slice of Samples and generally maps the associated file content.
func (SampleList) Len ¶
func (s SampleList) Len() int
func (SampleList) Less ¶
func (s SampleList) Less(i, j int) bool
func (SampleList) Swap ¶
func (s SampleList) Swap(i, j int)
type Scale ¶
type Scale struct { // Factor can be used to represent a change of scale of the recorded value. Factor float64 `json:"factor"` // Bias can be used to represent an offset to the recorded value. Bias float64 `json:"bias,omitempty"` // contains filtered or unexported fields }
Scale can be used to represent a non-linear installation, such as a pressure sensor installed in sea water rather than fresh water.
type Session ¶
type Session struct { Span Mark string Operator string Agency string Model string SatelliteSystem string Interval time.Duration ElevationMask float64 HeaderComment string Format string // contains filtered or unexported fields }
func LoadSessions ¶
type SessionList ¶
type SessionList []Session
func (SessionList) Len ¶
func (s SessionList) Len() int
func (SessionList) Less ¶
func (s SessionList) Less(i, j int) bool
func (SessionList) Swap ¶
func (s SessionList) Swap(i, j int)
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set allows for extracting and unmarshalling the base delta csv files, optional SetPathMap functions can be given to alter the expected default file paths prior to reading from the FS set. This is useful for testing or using a non-standard file layout.
func NewSet ¶
func NewSet(fsys fs.FS, maps ...SetPathMap) (*Set, error)
NewSet returns a Set pointer for the given FS and optional SetPathMap functions to manipulate the internal csv file paths.
func (Set) Calibrations ¶
func (s Set) Calibrations() []Calibration
Calibrations is a helper function to return a slice of Calibration values.
func (Set) Citation ¶
Citation is a helper function to return a Citation value and true if one exists.
func (*Set) Collections ¶
func (s *Set) Collections(site Site) []Collection
Collections decodes the stored sensor and datalogger installation times and builds a slice of overlapping time spans for the given site.
func (Set) Components ¶
Components is a helper function to return a slice of Component values.
func (Set) Connections ¶
func (s Set) Connections() []Connection
Connections is a helper function to return a slice of Connection values.
func (Set) Constituents ¶
func (s Set) Constituents() []Constituent
Constituents is a helper function to return a slice of Constituent values.
func (*Set) Corrections ¶
func (set *Set) Corrections(coll Collection) []Correction
Corrections returns a slice of Correction values for a given Collection.
func (*Set) DataloggerCalibrationCorrections ¶
func (s *Set) DataloggerCalibrationCorrections(coll Collection) []Correction
DataloggerCalibrationCorrections returns a slice of Correction values to account for any changes in DeployedDatalogger Calibration.
func (Set) DeployedDataloggers ¶
func (s Set) DeployedDataloggers() []DeployedDatalogger
DeployedDataloggers is a helper function to return a slice of DeployedDatalogger values.
func (Set) DeployedReceivers ¶
func (s Set) DeployedReceivers() []DeployedReceiver
DeployedReceivers is a helper function to return a slice of DeployedReceiver values.
func (Set) Doases ¶
func (s Set) Doases() []InstalledDoas
Doases is a helper function to return a slice of InstalledDoas values.
func (Set) FirmwareHistory ¶
func (s Set) FirmwareHistory() []FirmwareHistory
FirmwareHistory is a helper function to return a slice of FirmwareHistory values.
func (*Set) GainCorrections ¶
func (s *Set) GainCorrections(coll Collection) []Correction
GainCorrections returns a slice of Correction values to account for any changes in Gain.
func (Set) InstalledAntennas ¶
func (s Set) InstalledAntennas() []InstalledAntenna
InstalledAntennas is a helper function to return a slice of InstalledAntenna values.
func (Set) InstalledCameras ¶
func (s Set) InstalledCameras() []InstalledCamera
InstalledCameras is a helper function to return a slice of InstalledCamera values.
func (Set) InstalledMetSensors ¶
func (s Set) InstalledMetSensors() []InstalledMetSensor
InstalledMetSensors is a helper function to return a slice of InstalledMetSensor values.
func (Set) InstalledRadomes ¶
func (s Set) InstalledRadomes() []InstalledRadome
InstalledRadomes is a helper function to return a slice of InstalledRadome values.
func (Set) InstalledRecorders ¶
func (s Set) InstalledRecorders() []InstalledRecorder
InstalledRecorders is a helper function to return a slice of InstalledRecorder values.
func (Set) InstalledSensors ¶
func (s Set) InstalledSensors() []InstalledSensor
InstalledSensors is a helper function to return a slice of InstalledSensor values.
func (Set) Monument ¶
Monument is a helper function to return a Monument value and true if one exists.
func (Set) Placename ¶
Placename is a helper function to return a Placename value and true if one exists.
func (Set) Placenames ¶
Placenames is a helper function to return a slice of Placename values.
func (Set) Polarities ¶
Polarities is a helper function to return a slice of Polarity values.
func (*Set) PolarityCorrections ¶
func (s *Set) PolarityCorrections(coll Collection) []Correction
PolarityCorrections returns a slice of Correction values to account for any changes in Polarity.
func (*Set) PreampCorrections ¶
func (s *Set) PreampCorrections(coll Collection) []Correction
PreampCorrections returns a slice of Correction values to account for any changes in Preamp settings.
func (*Set) SensorCalibrationCorrections ¶
func (s *Set) SensorCalibrationCorrections(coll Collection) []Correction
SensornCalibrationCorrections returns a slice of Correction values to account for any changes in Sensor Calibration.
func (Set) Telemetries ¶
Telemetries is a helper function to return a slice of Telemetry values.
func (*Set) TelemetryCorrections ¶
func (s *Set) TelemetryCorrections(coll Collection) []Correction
TelemetryCorrections returns a slice of Correction values to account for any changes in Preamp settings.
func (*Set) TimingCorrections ¶
func (s *Set) TimingCorrections(coll Collection) []Correction
TimingCorrections returns a slice of Correction values to account for any changes in Timing.
func (Set) Visibilities ¶
func (s Set) Visibilities() []Visibility
Visibilities is a helper function to return a slice of Visibility values.
type SetPathMap ¶
SetPathMap is used to manipulate the filepath inside the Set.
type Site ¶
type Span ¶
type Span struct { // Start represents the beginning of the time window. Start time.Time `json:"start"` // End represents the stop time of the window. End time.Time `json:"end"` }
Span represents a time window.
type Station ¶
func LoadStations ¶
type StationList ¶
type StationList []Station
func (StationList) Len ¶
func (s StationList) Len() int
func (StationList) Less ¶
func (s StationList) Less(i, j int) bool
func (StationList) Swap ¶
func (s StationList) Swap(i, j int)
type Stream ¶
type Stream struct { Span Station string `json:"station"` Location string `json:"location"` Band string `json:"band"` Source string `json:"source"` SamplingRate float64 `json:"sampling-rate"` Axial string `json:"axial,omitempty"` Reversed bool `json:"reversed,omitempty"` Triggered bool `json:"triggered,omitempty"` // contains filtered or unexported fields }
func LoadStreams ¶
type StreamList ¶
type StreamList []Stream
func (StreamList) Len ¶
func (s StreamList) Len() int
func (StreamList) Less ¶
func (s StreamList) Less(i, j int) bool
func (StreamList) Swap ¶
func (s StreamList) Swap(i, j int)
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table holds internal settings suitable for automatic code generation.
func (Table) Encode ¶
func (t Table) Encode(list ListEncoder) [][]string
Encode returns the standard text listing of a table.
func (Table) HasDateTime ¶
HasDateTime returns whether there are any date columns in the table.
func (Table) IsDateTime ¶
IsDateTime returns whether the column is a date and may need extra formatting.
func (Table) IsForeign ¶
IsForeign returns whether a column is considered a foreign column, this is usually an indication that it will be uniquie together with any other primary columns.
func (Table) IsNative ¶
IsNative returns whether the column should be displayed without quotes, such as numbers.
func (Table) IsPrimary ¶
IsPrimary returns whether a column is considered a primary column, this is usually an indication that it will be uniquie together with any other primary columns.
type TableList ¶
type TableList struct { Table Table List ListEncoder }
TableList pairs together a Table and a ListEncoder.
type Telemetry ¶
type Telemetry struct { Span Station string Location string ScaleFactor float64 // contains filtered or unexported fields }
Telemetry describes when a datalogger is connected to a sensor via analogue telemetry (e.g. FM radio).
func LoadTelemetries ¶
type TelemetryList ¶
type TelemetryList []Telemetry
func (TelemetryList) Len ¶
func (t TelemetryList) Len() int
func (TelemetryList) Less ¶
func (t TelemetryList) Less(i, j int) bool
func (TelemetryList) Swap ¶
func (t TelemetryList) Swap(i, j int)
type Timing ¶
type Timing struct { Span Station string Location string Correction time.Duration // contains filtered or unexported fields }
func LoadTimings ¶
type TimingList ¶
type TimingList []Timing
func (TimingList) Len ¶
func (t TimingList) Len() int
func (TimingList) Less ¶
func (t TimingList) Less(i, j int) bool
func (TimingList) Swap ¶
func (t TimingList) Swap(i, j int)
type View ¶
type Visibility ¶
func LoadVisibilities ¶
func LoadVisibilities(path string) ([]Visibility, error)
type VisibilityList ¶
type VisibilityList []Visibility
func (VisibilityList) Len ¶
func (v VisibilityList) Len() int
func (VisibilityList) Less ¶
func (v VisibilityList) Less(i, j int) bool
func (VisibilityList) Swap ¶
func (v VisibilityList) Swap(i, j int)
Source Files ¶
- antenna.go
- asset.go
- calibration.go
- camera.go
- channel.go
- citation.go
- class.go
- collection.go
- component.go
- connection.go
- constituent.go
- correction.go
- dart.go
- datalogger.go
- doas.go
- doi.go
- feature.go
- firmware.go
- gain.go
- gauge.go
- headers.go
- list.go
- mark.go
- meta.go
- metsensor.go
- monument.go
- mount.go
- network.go
- number.go
- placenames.go
- point.go
- polarity.go
- preamp.go
- radome.go
- receiver.go
- recorder.go
- sample.go
- sensor.go
- session.go
- set.go
- set_auto.go
- site.go
- station.go
- streams.go
- table.go
- telemetry.go
- timing.go
- view.go
- visibility.go