models

package
v0.0.0-...-d3098e7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllMeasurements

type AllMeasurements struct {
	MeasurementTimeseries []MeasurementTimeseries
}

func (AllMeasurements) GetLatestMeasurementByName

func (am AllMeasurements) GetLatestMeasurementByName(param string) MeasurementTVP

Returns the most recent MeasurementTVP for the given measurement. For example, GetLatestMeasurementByName("t2m") would return the latest air temperature measurement.

func (AllMeasurements) GetMeasurementTimeseriesByName

func (am AllMeasurements) GetMeasurementTimeseriesByName(param string) []MeasurementTVP

Returns all MeasurementTVPs for the given measurement. For example, GetMeasurementTimeseriesByName("t2m") would return all air temperature measurements in the AllMeasurements.

func (AllMeasurements) GetMeasurementTimeseriesNames

func (am AllMeasurements) GetMeasurementTimeseriesNames() []string

Returns the names of measurements in the AllMeasurements struct

type BsWfsElement

type BsWfsElement struct {
	XMLName        xml.Name `xml:"BsWfsElement"`
	Time           string   `xml:"Time"`
	ParameterName  string   `xml:"ParameterName"`
	ParameterValue string   `xml:"ParameterValue"`
}

type ExplainedParam

type ExplainedParam struct {
	Label          string        `xml:"label"`
	BasePhenomenon string        `xml:"basePhenomenon"`
	UOM            UnitOfMeasure `xml:"uom"`
}

type MeasurementTVP

type MeasurementTVP struct {
	XMLName xml.Name `xml:"MeasurementTVP"`
	Time    string   `xml:"time"`
	Value   string   `xml:"value"`
}

Measurement Time-Value Pair. Includes the measurement's time and value

func (MeasurementTVP) GetTime

func (mtvp MeasurementTVP) GetTime() (time.Time, error)

Returns the time a MeasurementTVP was measured.

func (MeasurementTVP) GetValue

func (mtvp MeasurementTVP) GetValue() (float64, error)

Returns the MeasurementTVP's value as a float64.

type MeasurementTimeseries

type MeasurementTimeseries struct {
	Name         string
	XMLName      xml.Name         `xml:"MeasurementTimeseries"`
	Measurements []MeasurementTVP `xml:"point>MeasurementTVP"`
}

Measurement timeseries includes measurement name, e.g. tday, and an array of measurement points.

type Query

type Query interface {
	ToString() string
}

type StoredQuery

type StoredQuery struct {
	Id           string
	StartTime    string
	EndTime      string
	Parameters   []string
	Timestep     int
	Bbox         string
	LatLon       string
	Place        string
	Fmisid       int
	MaxLocations int
}

func (*StoredQuery) SetBoundingBox

func (q *StoredQuery) SetBoundingBox(bbox string)

Bbox format is 22,64,24,68. First two numbers are the coordinates of the lower left corner, the last two are top right corner

func (*StoredQuery) SetEndTime

func (q *StoredQuery) SetEndTime(endTime time.Time)

Requires year, month, day, hour, minutes and seconds.

func (*StoredQuery) SetFmisid

func (q *StoredQuery) SetFmisid(fmisid int)

func (*StoredQuery) SetLatLon

func (q *StoredQuery) SetLatLon(latlon string)

LatLon format is 60.11,19.90.

func (*StoredQuery) SetMaxLocations

func (q *StoredQuery) SetMaxLocations(maxLocations int)

func (*StoredQuery) SetParameters

func (q *StoredQuery) SetParameters(parameters []string)

func (*StoredQuery) SetPlace

func (q *StoredQuery) SetPlace(place string)

func (*StoredQuery) SetStartTime

func (q *StoredQuery) SetStartTime(startTime time.Time)

Requires year, month, day, hour, minutes and seconds.

func (*StoredQuery) SetTimestep

func (q *StoredQuery) SetTimestep(timestep int)

Timestep is in minutes.

func (*StoredQuery) ToString

func (q *StoredQuery) ToString() string

Returns a string which is a URL created based on the StoredQuery struct's field values. The URL can then be used in GETing FMI open data

type UnitOfMeasure

type UnitOfMeasure struct {
	Value string `xml:"uom,attr"`
}

Jump to

Keyboard shortcuts

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