models

package
v0.0.0-...-aa17705 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmedasStation

type AmedasStation struct {
	ID        int     `json:"id"`
	Name      string  `json:"name"`
	Region    string  `json:"region"`
	Location  string  `json:"location"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	URL       string  `json:"-"`
}

func (*AmedasStation) GetWeatherData

func (a *AmedasStation) GetWeatherData(fromDate time.Time, toDate time.Time) (h HistoricalWeatherObservations, err error)

type AmedasStations

type AmedasStations struct {
	URL      string
	Stations []AmedasStation
}
var Stations AmedasStations

func (*AmedasStations) GetStations

func (a *AmedasStations) GetStations(url string, weatherUrl string) error

func (*AmedasStations) GetWeatherObservation

func (a *AmedasStations) GetWeatherObservation(lat float64, lon float64, fromDate time.Time, toDate time.Time) (h HistoricalWeatherObservations, err error)

type HistoricalWeatherObservations

type HistoricalWeatherObservations struct {
	Station      *AmedasStation        `json:"station"`
	Latitude     float64               `json:"latitude"`
	Longitude    float64               `json:"longitude"`
	FromDate     time.Time             `json:"from_date"`
	ToDate       time.Time             `json:"to_date"`
	Observations []*WeatherObservation `json:"observations"`
}

func (*HistoricalWeatherObservations) ConvertToCsv

func (w *HistoricalWeatherObservations) ConvertToCsv() (string, error)

func (*HistoricalWeatherObservations) ConvertToWtd

func (w *HistoricalWeatherObservations) ConvertToWtd() string

type WeatherObservation

type WeatherObservation struct {
	Date      time.Time `csv:"date" json:"date"`
	DayOfYear int       `csv:"doy" json:"-"`
	Year      int       `csv:"year" json:"-"`
	Month     int       `csv:"month" json:"-"`
	Day       int       `csv:"day" json:"-"`

	AverageAirTemperature      float32 `csv:"T" json:"average_air_temperature"`
	MaximumAirTemperature      float32 `csv:"Tmax" json:"maximum_air_temperature"`
	MinimumAirTemperature      float32 `csv:"Tmin" json:"minimum_air_temperature"`
	Precipitation              float32 `csv:"Pr" json:"precipitation"`
	AtmosphericPressure        float32 `csv:"P" json:"atmospheric_pressure"`
	VaporPressure              float32 `csv:"e" json:"vapor_pressure"`
	VaporPressureDeficit       float32 `csv:"VPD" json:"vapor_pressure_deficit"`
	AverageRelativeHumidity    float32 `csv:"RH" json:"average_relative_humidity"`
	MinimumRelativeHumidity    float32 `csv:"RHmin" json:"minimum_relative_humidity"`
	AverageWindSpeed           float32 `csv:"u" json:"average_wind_speedValues"`
	MaximumWindSpeed           float32 `csv:"u10max" json:"maximum_wind_speed"`
	SunshineDuration           float32 `csv:"N" json:"sunshine_duration"`
	SolarIrradianceEstimate    float32 `csv:"Sd" json:"solar_irradiance_estimate"`
	DownwardLongwaveIrradiance float32 `csv:"Ld" json:"downward_longwave_irradiance"`
	PotentialEvaporation       float32 `csv:"EP" json:"potential_evaporation"`
	EvapotranspirationFAO      float32 `csv:"ET0" json:"evapotranspiration_FAO"`
	WaterTemperatureTw0        float32 `csv:"Tw0" json:"water_temperature_tw0"`
	WaterTemperatureTwinf      float32 `csv:"Twinf" json:"water_temperature_twinf"`
}

Jump to

Keyboard shortcuts

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