noaa

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

README

noaa

noaa is a Go module that was built to facilitate rapid discovery of new data from NOAA and NDBC.

Documentation

Overview

Package noaa retrieves and parses data from National Oceanic and Atmospheric Administration ("NOAA"). This also includes data from the National Data Buoy Center ("NDBC").

Index

Constants

View Source
const (
	ActiveStations = baseUrlNDBC + "activestations"
	Realtime       = baseUrlNDBC + "data/realtime2"
)

NDBC Endpoints

View Source
const (
	DATASPEC = "data_spec"
	OCEAN    = "ocean"
	SPEC     = "spec"
	SUPL     = "supl"
	SWDIR    = "swdir"
	SWDIR2   = "swdir2"
	SWR1     = "swr1"
	SWR2     = "swr2"
	TXT      = "txt"
)

Realtime Datasets

There are nine different data sources:
  - data_spec     Raw Spectral Wave Data
  - ocean         Oceanographic Data
  - spec          Spectral Wave Summary Data
  - supl          Supplemental Measurements Data
  - swdir         Spectral Wave Data (alpha1)
  - swdir2        Spectral Wave Data (alpha2)
  - swr1          Spectral Wave Data (r1)
  - swr2          Spectral Wave Data (r2)
  - txt           Standard Meteorological Data
View Source
const (

	// National Digital Forecast Database
	Forecasts = baseUrlNOAA + "xml/sample_products/browser_interface/ndfdXMLclient.php"
)

NOAA Endpoints

Variables

This section is empty.

Functions

func GetActiveStations

func GetActiveStations() string

func GetRealtime

func GetRealtime(stationId string) string

TODO: add support for other realtime datasets and different return signatures (json, struct)

Types

type MeteorologicalObservation

type MeteorologicalObservation struct {
	Datetime            time.Time `json:"datetime"`
	WindDirection       int16     `json:"wind_direction"`
	WindSpeed           float32   `json:"wind_speed"`
	WindGust            float32   `json:"wind_gust"`
	WaveHeight          float32   `json:"wave_height"`
	DominantWavePeriod  float32   `json:"dominant_wave_period"`
	AverageWavePeriod   float32   `json:"average_wave_period"`
	WaveDirection       int16     `json:"wave_direction"`
	SeaLevelPressure    float32   `json:"sea_level_pressure"`
	PressureTendency    float32   `json:"pressure_tendency"`
	AirTemperature      float32   `json:"air_temperature"`
	WaterTemperature    float32   `json:"water_temperature"`
	DewpointTemperature float32   `json:"dewpoint_temperature"`
	Visibility          float32   `json:"visibility"`
	Tide                float32   `json:"tide"`
}

func (MeteorologicalObservation) MarshalJSON

func (o MeteorologicalObservation) MarshalJSON() ([]byte, error)

Encodes time.Time object to ISODateString

type Station

type Station struct {
	XMLName      xml.Name `xml:"station"`
	ID           string   `xml:"id,attr"`
	Lat          float32  `xml:"lat,attr"`
	Lon          float32  `xml:"lon,attr"`
	Name         string   `xml:"name,attr"`
	Owner        string   `xml:"owner,attr"`
	Type         string   `xml:"type,attr"`
	Met          string   `xml:"met,attr"`
	Currents     string   `xml:"currents,attr"`
	WaterQuality string   `xml:"waterquality,attr"`
}

type Stations

type Stations struct {
	XMLName  xml.Name  `xml:"stations"`
	Stations []Station `xml:"station"`
}

type WaveSummaryObservation

type WaveSummaryObservation struct {
	Datetime              time.Time `json:"datetime"`
	SignificantWaveHeight float32   `json:"significant_wave_height"`
	SwellHeight           float32   `json:"swell_height"`
	SwellPeriod           float32   `json:"swell_period"`
	WindWaveHeight        float32   `json:"wind_wave_height"`
	WindWavePeriod        float32   `json:"wind_wave_period"`
	SwellDirection        string    `json:"swell_direction"`
	WindWaveDirection     float32   `json:"wind_wave_direction"`
	Steepness             string    `json:"steepness"`
	AverageWavePeriod     float32   `json:"average_wave_period"`
	DominantWaveDirection int16     `json:"dominant_wave_direction"`
}

Jump to

Keyboard shortcuts

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