Documentation
¶
Index ¶
- Constants
- Variables
- func Bearing(point, otherPoint IPoint) float64
- func Contains(poly IPolygon, point IPoint) bool
- func Distance(point, otherPoint IPoint) float64
- func GetWarningTexts(url string, number int) (warningTexts []string, err error)
- type Cache
- type Cacher
- type CellData
- type HailReport
- type HailReportsCacher
- type IPoint
- type IPolygon
- type IProductInfo
- type LatLng
- type LatLngBounds
- type MesoCell
- type MesoCellData
- type MovementVector
- type Mover
- type ProductDescriptionBlock
- type RadarHeaderBlock
- type RadarStation
- type Report
- type SortByWarningName
- type StationLocation
- type StormCell
- type StormCellData
- type TornadoReport
- type TornadoReportsCacher
- type TvsCell
- type TvsCellData
- type Warning
- type WarningCache
- type WarningStatus
- type Watch
- type WatchCache
- type WindReport
- type WindReportsCacher
Constants ¶
View Source
const ( IMGWIDTH = 600 IMGHEIGHT = 550 MILESPERPIXHEIGHT = IMGHEIGHT NMPERDEGLATEQUATOR = 60.10774 )
View Source
const ( STORMCELLREG = "[A-Z][0-9][ ]+[0-9]+/( *|[0-9])[0-9]+" MESOCELLREG = "[0-9]+/[ ]*[0-9]+ +[0-9]?[0-9][L| ]" TVSCELLREG = "[A-Z][0-9][ ]+[0-9]+/[ ]*[0-9]+" WARNINGFILEREGEXP = "warnings_[0-9]+_[0-9]+\\.txt" )
View Source
const ( TORNREPORTURL = "http://www.spc.noaa.gov/climo/reports/today_torn.csv" WINDREPORTURL = "http://www.spc.noaa.gov/climo/reports/today_wind.csv" HAILREPORTURL = "http://www.spc.noaa.gov/climo/reports/today_hail.csv" )
View Source
const ( NEW WarningStatus = "O.NEW" EXPIRED = "O.EXP" CONTINUE = "O.CON" CANCEL = "O.CAN" )
View Source
const ( WATCHREGEX = "<strong>.*watch/ww(.*)\\.html" WATCHNUMREGEXP = "WWP(.*)" LATLONREGEXP = "[0-9]{8}" WATCHTYPEREGEXP = "\n\n(.*WATCH)" EXPIREREGEXP = "- ([0-9]{6})Z" )
Variables ¶
View Source
var Stations map[string]*StationLocation
var Stations map[string][]interface{}
Functions ¶
Types ¶
type CellData ¶
type CellData struct {
StormCellData *StormCellData
MesoCellData *MesoCellData
TvsCellData *TvsCellData
}
type HailReport ¶
func GetHailReports ¶
func GetHailReports() (hailReports []HailReport, err error)
type HailReportsCacher ¶
type HailReportsCacher struct{}
func (HailReportsCacher) GetLatest ¶
func (rt HailReportsCacher) GetLatest() (interface{}, error)
type IPolygon ¶
type IPolygon interface {
//Needs to be a polygon that has the points in order to draw a polygon.
//For instance, with four points, they would go: Nw Ne Se Sw to draw a rectangle
GetPolygon() []LatLng
}
type IProductInfo ¶
type LatLngBounds ¶
type LatLngBounds struct {
Sw, Ne LatLng
}
func (*LatLngBounds) GetPolygon ¶
func (llb *LatLngBounds) GetPolygon() []LatLng
type MesoCellData ¶
type MesoCellData struct {
Cells []MesoCell
IProductInfo
}
type MovementVector ¶
type MovementVector struct {
// contains filtered or unexported fields
}
type Mover ¶
type Mover interface {
Movement() MovementVector
}
type ProductDescriptionBlock ¶
type ProductDescriptionBlock struct {
Divider int16 //-1
LatitudeOfRadar int32 //Latitude*1000, + is north
LongitudeOfRadar int32 //Longitude*1000, + is east
HeightAboveSea int16 //In Feet
ProductCode int16 //Radar Product Number
OperationalMode int16 // 0=Maintenance 1=Clear air, 2=Precipitation/Severe Weather
VolumeScanPattern int16 //RDA volume coverage pattern
SequenceNumber int16 // Sequence number of the request that generated the product
VolumeScanNumber int16 //Counter, cycles 1 to 80
VolumeScanDate int16
VolumeScanTime int32
ProductGenDate int16
ProductGenTime int32
P1 int16 //Product Specific Code
P2 int16 //Product Specific Code
ElevNum int16 //Elevation scan within volume scan
P3 int16
DataThreshold [32]byte //Data Thresholds 16, 2 byte halfwords
P4 int16
P5 int16
P6 int16
P7 int16
P8 int16
P9 int16
P10 int16
NumberOfMaps int16
OffsetSymbologyBlock int32 //Number of halfwords (2 bytes) from start of product to block
OffsetGraphicBlock int32
OffsetTabularBlock int32
}
func (*ProductDescriptionBlock) GetProductGenDate ¶
func (pd *ProductDescriptionBlock) GetProductGenDate() time.Time
func (*ProductDescriptionBlock) GetVolumeScanDate ¶
func (pd *ProductDescriptionBlock) GetVolumeScanDate() time.Time
type RadarHeaderBlock ¶
type RadarHeaderBlock struct {
MessageCode int16
Days int16 //Number of days since 1 Jan 1970
MidnightHours int32 // Number of seconds since midnight
LengthOfMessage int32
SourceID int16
DestinationID int16
NumberOfBlocks int16
ProductDescriptionBlock
}
func GetRadarHeader ¶
func GetRadarHeader(data []byte) (*RadarHeaderBlock, error)
func (*RadarHeaderBlock) GetDate ¶
func (rh *RadarHeaderBlock) GetDate() time.Time
func (*RadarHeaderBlock) IsDue ¶
func (rh *RadarHeaderBlock) IsDue() bool
func (*RadarHeaderBlock) IsOld ¶
func (rh *RadarHeaderBlock) IsOld() bool
func (*RadarHeaderBlock) ScanDuration ¶
func (rh *RadarHeaderBlock) ScanDuration() time.Duration
Source wikipedia https://en.wikipedia.org/wiki/NEXRAD
about Volume Coverage Patterns (VCP)
11: Has the best overall volume converage
211: Improves range-obscured velocity data over VCP 11
12: Focuses on lower elevations to better sample the lower levels of storms.
212: Improves range-obscured velocity data over VCP 12
121: Scans lower cuts multiple times with varying pulse repetition to greatly
enhance velocity data
21: Rarely used for convenction due to sparse elevation data and long completion time
221: Improves range-obscured velocity data over VCP 121
31: Long-pulse
32: Short-pulse
type RadarStation ¶
type RadarStation struct {
Id string
LeftEdgeLon, TopEdgeLat float64
LatLng
// contains filtered or unexported fields
}
func NewRadarStation ¶
func NewRadarStation(stationId string) (*RadarStation, error)
func (RadarStation) Degrees ¶
func (rs RadarStation) Degrees() LatLng
func (RadarStation) GetLatest ¶
func (rs RadarStation) GetLatest() (interface{}, error)
This will retrieve all of the station's storm cell data and return it as a celldata this will implement the Cacher interface
func (*RadarStation) ParseMesoCells ¶
func (rs *RadarStation) ParseMesoCells() (*MesoCellData, error)
func (*RadarStation) ParseStormCells ¶
func (rs *RadarStation) ParseStormCells() (*StormCellData, error)
TODO: Maybe include the radar status message? from http://weather.noaa.gov/pub/SL.us008001/DF.of/DC.radar/DS.75ftm/
func (*RadarStation) ParseTvsCells ¶
func (rs *RadarStation) ParseTvsCells() (*TvsCellData, error)
type Report ¶
type Report struct {
Time time.Time
Location string
County string
State string
*LatLng
Comments string
SpecAttr string `json:"-"`
}
func GetReports ¶
type SortByWarningName ¶
type SortByWarningName []Warning
func (SortByWarningName) Len ¶
func (w SortByWarningName) Len() int
func (SortByWarningName) Less ¶
func (w SortByWarningName) Less(i, j int) bool
func (SortByWarningName) Swap ¶
func (w SortByWarningName) Swap(i, j int)
type StationLocation ¶
type StationLocation struct {
LatLng
LatLngBounds
}
type StormCellData ¶
type StormCellData struct {
Cells []StormCell
IProductInfo
}
type TornadoReport ¶
func GetTornadoReports ¶
func GetTornadoReports() (tornadoReports []TornadoReport, err error)
type TornadoReportsCacher ¶
type TornadoReportsCacher struct{}
func (TornadoReportsCacher) GetLatest ¶
func (rt TornadoReportsCacher) GetLatest() (interface{}, error)
type TvsCellData ¶
type TvsCellData struct {
Cells []TvsCell
IProductInfo
}
type Warning ¶
type Warning struct {
ExpireTime string
WarningName, WarningType, Description string
Polygon []LatLng
}
func GetNWSWarnings ¶
func GetNWSWarnings() []Warning
func (Warning) GetPolygon ¶
type WarningCache ¶
type WarningCache struct{}
func (WarningCache) GetLatest ¶
func (wc WarningCache) GetLatest() (interface{}, error)
type WarningStatus ¶
type WarningStatus string
func GetWarningStatus ¶
func GetWarningStatus(text string) WarningStatus
type WatchCache ¶
type WatchCache struct{}
func (WatchCache) GetLatest ¶
func (w WatchCache) GetLatest() (interface{}, error)
type WindReport ¶
func GetWindReports ¶
func GetWindReports() (windReports []WindReport, err error)
type WindReportsCacher ¶
type WindReportsCacher struct{}
func (WindReportsCacher) GetLatest ¶
func (rt WindReportsCacher) GetLatest() (interface{}, error)
Click to show internal directories.
Click to hide internal directories.