Documentation ¶
Index ¶
- type ArrivalDepthandDurationEvent
- func (h ArrivalDepthandDurationEvent) ArrivalTime() time.Time
- func (h ArrivalDepthandDurationEvent) DV() float64
- func (h ArrivalDepthandDurationEvent) Depth() float64
- func (h ArrivalDepthandDurationEvent) Duration() float64
- func (h ArrivalDepthandDurationEvent) Erosion() float64
- func (ad ArrivalDepthandDurationEvent) Has(p Parameter) bool
- func (d ArrivalDepthandDurationEvent) MarshalJSON() ([]byte, error)
- func (ad ArrivalDepthandDurationEvent) Parameters() Parameter
- func (h ArrivalDepthandDurationEvent) Qualitative() string
- func (h ArrivalDepthandDurationEvent) Salinity() bool
- func (h *ArrivalDepthandDurationEvent) SetArrivalTime(t time.Time)
- func (h *ArrivalDepthandDurationEvent) SetDepth(d float64)
- func (h *ArrivalDepthandDurationEvent) SetDuration(d float64)
- func (h ArrivalDepthandDurationEvent) Velocity() float64
- func (h ArrivalDepthandDurationEvent) WaveHeight() float64
- type ArrivalandDurationEvent
- func (h ArrivalandDurationEvent) ArrivalTime() time.Time
- func (h ArrivalandDurationEvent) DV() float64
- func (h ArrivalandDurationEvent) Depth() float64
- func (h ArrivalandDurationEvent) Duration() float64
- func (h ArrivalandDurationEvent) Erosion() float64
- func (ad ArrivalandDurationEvent) Has(p Parameter) bool
- func (d ArrivalandDurationEvent) MarshalJSON() ([]byte, error)
- func (ad ArrivalandDurationEvent) Parameters() Parameter
- func (h ArrivalandDurationEvent) Qualitative() string
- func (h ArrivalandDurationEvent) Salinity() bool
- func (h *ArrivalandDurationEvent) SetArrivalTime(t time.Time)
- func (h *ArrivalandDurationEvent) SetDuration(d float64)
- func (h ArrivalandDurationEvent) Velocity() float64
- func (h ArrivalandDurationEvent) WaveHeight() float64
- type CoastalEvent
- func (h CoastalEvent) ArrivalTime() time.Time
- func (h CoastalEvent) DV() float64
- func (h CoastalEvent) Depth() float64
- func (h CoastalEvent) Duration() float64
- func (h CoastalEvent) Erosion() float64
- func (ad CoastalEvent) Has(p Parameter) bool
- func (d CoastalEvent) MarshalJSON() ([]byte, error)
- func (ad CoastalEvent) Parameters() Parameter
- func (h CoastalEvent) Qualitative() string
- func (h CoastalEvent) Salinity() bool
- func (h *CoastalEvent) SetDepth(d float64)
- func (h *CoastalEvent) SetErosion(e float64)
- func (h *CoastalEvent) SetSalinity(d bool)
- func (h *CoastalEvent) SetWaveHeight(d float64)
- func (h CoastalEvent) Velocity() float64
- func (h CoastalEvent) WaveHeight() float64
- type DepthEvent
- func (h DepthEvent) ArrivalTime() time.Time
- func (h DepthEvent) DV() float64
- func (h DepthEvent) Depth() float64
- func (h DepthEvent) Duration() float64
- func (h DepthEvent) Erosion() float64
- func (h DepthEvent) Has(p Parameter) bool
- func (d DepthEvent) MarshalJSON() ([]byte, error)
- func (h DepthEvent) Parameters() Parameter
- func (h DepthEvent) Qualitative() string
- func (h DepthEvent) Salinity() bool
- func (h *DepthEvent) SetDepth(d float64)
- func (h DepthEvent) Velocity() float64
- func (h DepthEvent) WaveHeight() float64
- type DepthandDVEvent
- func (h DepthandDVEvent) ArrivalTime() time.Time
- func (h DepthandDVEvent) DV() float64
- func (h DepthandDVEvent) Depth() float64
- func (h DepthandDVEvent) Duration() float64
- func (h DepthandDVEvent) Erosion() float64
- func (ad DepthandDVEvent) Has(p Parameter) bool
- func (d DepthandDVEvent) MarshalJSON() ([]byte, error)
- func (ad DepthandDVEvent) Parameters() Parameter
- func (h DepthandDVEvent) Qualitative() string
- func (h DepthandDVEvent) Salinity() bool
- func (h *DepthandDVEvent) SetDV(value float64)
- func (h *DepthandDVEvent) SetDepth(value float64)
- func (h DepthandDVEvent) Velocity() float64
- func (h DepthandDVEvent) WaveHeight() float64
- type HazardData
- type HazardEvent
- type MultiParameterEvent
- func (h MultiParameterEvent) ArrivalTime() time.Time
- func (h MultiParameterEvent) DV() float64
- func (h MultiParameterEvent) Depth() float64
- func (h MultiParameterEvent) Duration() float64
- func (h MultiParameterEvent) Erosion() float64
- func (h MultiParameterEvent) Has(p Parameter) bool
- func (d MultiParameterEvent) MarshalJSON() ([]byte, error)
- func (h MultiParameterEvent) Parameters() Parameter
- func (h MultiParameterEvent) Qualitative() string
- func (h MultiParameterEvent) Salinity() bool
- func (h *MultiParameterEvent) SetDepth(d float64)
- func (h MultiParameterEvent) Velocity() float64
- func (h MultiParameterEvent) WaveHeight() float64
- type Parameter
- func SetHasArrivalTime(h Parameter) Parameter
- func SetHasDV(h Parameter) Parameter
- func SetHasDepth(h Parameter) Parameter
- func SetHasDuration(h Parameter) Parameter
- func SetHasErosion(h Parameter) Parameter
- func SetHasHighVelocity(h Parameter) Parameter
- func SetHasHighWaveHeight(h Parameter) Parameter
- func SetHasLongDuration(h Parameter) Parameter
- func SetHasMediumWaveHeight(h Parameter) Parameter
- func SetHasModerateVelocity(h Parameter) Parameter
- func SetHasQualitative(h Parameter) Parameter
- func SetHasSalinity(h Parameter) Parameter
- func SetHasVelocity(h Parameter) Parameter
- func SetHasWaveHeight(h Parameter) Parameter
- type QualitativeEvent
- func (h QualitativeEvent) ArrivalTime() time.Time
- func (h QualitativeEvent) DV() float64
- func (h QualitativeEvent) Depth() float64
- func (h QualitativeEvent) Duration() float64
- func (h QualitativeEvent) Erosion() float64
- func (q QualitativeEvent) Has(p Parameter) bool
- func (d QualitativeEvent) MarshalJSON() ([]byte, error)
- func (q QualitativeEvent) Parameters() Parameter
- func (h QualitativeEvent) Qualitative() string
- func (h QualitativeEvent) Salinity() bool
- func (h *QualitativeEvent) SetQualitative(message string)
- func (h QualitativeEvent) Velocity() float64
- func (h QualitativeEvent) WaveHeight() float64
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrivalDepthandDurationEvent ¶
type ArrivalDepthandDurationEvent struct {
// contains filtered or unexported fields
}
ArrivalandDurationEvent describes an event with an arrival time, depth and a duration in days
func (ArrivalDepthandDurationEvent) ArrivalTime ¶
func (h ArrivalDepthandDurationEvent) ArrivalTime() time.Time
func (ArrivalDepthandDurationEvent) DV ¶
func (h ArrivalDepthandDurationEvent) DV() float64
func (ArrivalDepthandDurationEvent) Depth ¶
func (h ArrivalDepthandDurationEvent) Depth() float64
func (ArrivalDepthandDurationEvent) Duration ¶
func (h ArrivalDepthandDurationEvent) Duration() float64
func (ArrivalDepthandDurationEvent) Erosion ¶
func (h ArrivalDepthandDurationEvent) Erosion() float64
func (ArrivalDepthandDurationEvent) Has ¶
func (ad ArrivalDepthandDurationEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (ArrivalDepthandDurationEvent) MarshalJSON ¶
func (d ArrivalDepthandDurationEvent) MarshalJSON() ([]byte, error)
func (ArrivalDepthandDurationEvent) Parameters ¶
func (ad ArrivalDepthandDurationEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (ArrivalDepthandDurationEvent) Qualitative ¶
func (h ArrivalDepthandDurationEvent) Qualitative() string
func (ArrivalDepthandDurationEvent) Salinity ¶
func (h ArrivalDepthandDurationEvent) Salinity() bool
func (*ArrivalDepthandDurationEvent) SetArrivalTime ¶
func (h *ArrivalDepthandDurationEvent) SetArrivalTime(t time.Time)
func (*ArrivalDepthandDurationEvent) SetDepth ¶
func (h *ArrivalDepthandDurationEvent) SetDepth(d float64)
func (*ArrivalDepthandDurationEvent) SetDuration ¶
func (h *ArrivalDepthandDurationEvent) SetDuration(d float64)
func (ArrivalDepthandDurationEvent) Velocity ¶
func (h ArrivalDepthandDurationEvent) Velocity() float64
func (ArrivalDepthandDurationEvent) WaveHeight ¶
func (h ArrivalDepthandDurationEvent) WaveHeight() float64
type ArrivalandDurationEvent ¶
type ArrivalandDurationEvent struct {
// contains filtered or unexported fields
}
ArrivalandDurationEvent describes an event with an arrival time and a duration in days
func (ArrivalandDurationEvent) ArrivalTime ¶
func (h ArrivalandDurationEvent) ArrivalTime() time.Time
func (ArrivalandDurationEvent) DV ¶
func (h ArrivalandDurationEvent) DV() float64
func (ArrivalandDurationEvent) Depth ¶
func (h ArrivalandDurationEvent) Depth() float64
func (ArrivalandDurationEvent) Duration ¶
func (h ArrivalandDurationEvent) Duration() float64
func (ArrivalandDurationEvent) Erosion ¶
func (h ArrivalandDurationEvent) Erosion() float64
func (ArrivalandDurationEvent) Has ¶
func (ad ArrivalandDurationEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (ArrivalandDurationEvent) MarshalJSON ¶
func (d ArrivalandDurationEvent) MarshalJSON() ([]byte, error)
func (ArrivalandDurationEvent) Parameters ¶
func (ad ArrivalandDurationEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (ArrivalandDurationEvent) Qualitative ¶
func (h ArrivalandDurationEvent) Qualitative() string
func (ArrivalandDurationEvent) Salinity ¶
func (h ArrivalandDurationEvent) Salinity() bool
func (*ArrivalandDurationEvent) SetArrivalTime ¶
func (h *ArrivalandDurationEvent) SetArrivalTime(t time.Time)
func (*ArrivalandDurationEvent) SetDuration ¶
func (h *ArrivalandDurationEvent) SetDuration(d float64)
func (ArrivalandDurationEvent) Velocity ¶
func (h ArrivalandDurationEvent) Velocity() float64
func (ArrivalandDurationEvent) WaveHeight ¶
func (h ArrivalandDurationEvent) WaveHeight() float64
type CoastalEvent ¶
type CoastalEvent struct {
// contains filtered or unexported fields
}
CoastalEvent describes a coastal event
func NewCoastalEvent ¶
func NewCoastalEvent(c CoastalEvent) *CoastalEvent
func (CoastalEvent) ArrivalTime ¶
func (h CoastalEvent) ArrivalTime() time.Time
func (CoastalEvent) DV ¶
func (h CoastalEvent) DV() float64
func (CoastalEvent) Depth ¶
func (h CoastalEvent) Depth() float64
func (CoastalEvent) Duration ¶
func (h CoastalEvent) Duration() float64
func (CoastalEvent) Erosion ¶
func (h CoastalEvent) Erosion() float64
func (CoastalEvent) Has ¶
func (ad CoastalEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (CoastalEvent) MarshalJSON ¶
func (d CoastalEvent) MarshalJSON() ([]byte, error)
func (CoastalEvent) Parameters ¶
func (ad CoastalEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (CoastalEvent) Qualitative ¶
func (h CoastalEvent) Qualitative() string
func (CoastalEvent) Salinity ¶
func (h CoastalEvent) Salinity() bool
func (*CoastalEvent) SetDepth ¶
func (h *CoastalEvent) SetDepth(d float64)
func (*CoastalEvent) SetErosion ¶
func (h *CoastalEvent) SetErosion(e float64)
func (*CoastalEvent) SetSalinity ¶
func (h *CoastalEvent) SetSalinity(d bool)
func (*CoastalEvent) SetWaveHeight ¶
func (h *CoastalEvent) SetWaveHeight(d float64)
func (CoastalEvent) Velocity ¶
func (h CoastalEvent) Velocity() float64
func (CoastalEvent) WaveHeight ¶
func (h CoastalEvent) WaveHeight() float64
type DepthEvent ¶
type DepthEvent struct {
// contains filtered or unexported fields
}
DepthEvent describes a Hazard with Depth Only
Example ¶
package main import ( "fmt" "github.com/USACE/go-consequences/hazards" ) func main() { d := hazards.DepthEvent{} d.SetDepth(2.5) fmt.Println(d.Has(hazards.Depth)) fmt.Println(d.Has(hazards.Velocity)) fmt.Println(d.Depth()) }
Output: true false 2.5
func (DepthEvent) ArrivalTime ¶
func (h DepthEvent) ArrivalTime() time.Time
func (DepthEvent) DV ¶
func (h DepthEvent) DV() float64
func (DepthEvent) Depth ¶
func (h DepthEvent) Depth() float64
func (DepthEvent) Duration ¶
func (h DepthEvent) Duration() float64
func (DepthEvent) Erosion ¶
func (h DepthEvent) Erosion() float64
func (DepthEvent) Has ¶
func (h DepthEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (DepthEvent) MarshalJSON ¶
func (d DepthEvent) MarshalJSON() ([]byte, error)
func (DepthEvent) Parameters ¶
func (h DepthEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (DepthEvent) Qualitative ¶
func (h DepthEvent) Qualitative() string
func (DepthEvent) Salinity ¶
func (h DepthEvent) Salinity() bool
func (*DepthEvent) SetDepth ¶
func (h *DepthEvent) SetDepth(d float64)
func (DepthEvent) Velocity ¶
func (h DepthEvent) Velocity() float64
func (DepthEvent) WaveHeight ¶
func (h DepthEvent) WaveHeight() float64
type DepthandDVEvent ¶
type DepthandDVEvent struct {
// contains filtered or unexported fields
}
DepthandDVEvent describes an event with an arrival time and a duration in days
func (DepthandDVEvent) ArrivalTime ¶
func (h DepthandDVEvent) ArrivalTime() time.Time
func (DepthandDVEvent) DV ¶
func (h DepthandDVEvent) DV() float64
func (DepthandDVEvent) Depth ¶
func (h DepthandDVEvent) Depth() float64
func (DepthandDVEvent) Duration ¶
func (h DepthandDVEvent) Duration() float64
func (DepthandDVEvent) Erosion ¶
func (h DepthandDVEvent) Erosion() float64
func (DepthandDVEvent) Has ¶
func (ad DepthandDVEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (DepthandDVEvent) MarshalJSON ¶
func (d DepthandDVEvent) MarshalJSON() ([]byte, error)
func (DepthandDVEvent) Parameters ¶
func (ad DepthandDVEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (DepthandDVEvent) Qualitative ¶
func (h DepthandDVEvent) Qualitative() string
func (DepthandDVEvent) Salinity ¶
func (h DepthandDVEvent) Salinity() bool
func (*DepthandDVEvent) SetDV ¶
func (h *DepthandDVEvent) SetDV(value float64)
func (*DepthandDVEvent) SetDepth ¶
func (h *DepthandDVEvent) SetDepth(value float64)
func (DepthandDVEvent) Velocity ¶
func (h DepthandDVEvent) Velocity() float64
func (DepthandDVEvent) WaveHeight ¶
func (h DepthandDVEvent) WaveHeight() float64
type HazardData ¶
type HazardData struct { Depth float64 Velocity float64 ArrivalTime time.Time Erosion float64 Duration float64 WaveHeight float64 Salinity bool Qualitative string DV float64 }
func (*HazardData) SetParameter ¶
func (hd *HazardData) SetParameter(p Parameter, value any)
type HazardEvent ¶
type HazardEvent interface { //parameters? Depth() float64 Velocity() float64 ArrivalTime() time.Time Erosion() float64 Duration() float64 WaveHeight() float64 Salinity() bool Qualitative() string DV() float64 //values? //hazardType? Parameters() Parameter Has(p Parameter) bool }
HazardEvent is an interface I am trying to make to describe all Hazard Events
type MultiParameterEvent ¶
type MultiParameterEvent struct {
// contains filtered or unexported fields
}
DepthEvent describes a Hazard with Depth Only
func HazardDataToMultiParameter ¶
func HazardDataToMultiParameter(hd HazardData) MultiParameterEvent
func (MultiParameterEvent) ArrivalTime ¶
func (h MultiParameterEvent) ArrivalTime() time.Time
func (MultiParameterEvent) DV ¶
func (h MultiParameterEvent) DV() float64
func (MultiParameterEvent) Depth ¶
func (h MultiParameterEvent) Depth() float64
func (MultiParameterEvent) Duration ¶
func (h MultiParameterEvent) Duration() float64
func (MultiParameterEvent) Erosion ¶
func (h MultiParameterEvent) Erosion() float64
func (MultiParameterEvent) Has ¶
func (h MultiParameterEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (MultiParameterEvent) MarshalJSON ¶
func (d MultiParameterEvent) MarshalJSON() ([]byte, error)
func (MultiParameterEvent) Parameters ¶
func (h MultiParameterEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (MultiParameterEvent) Qualitative ¶
func (h MultiParameterEvent) Qualitative() string
func (MultiParameterEvent) Salinity ¶
func (h MultiParameterEvent) Salinity() bool
func (*MultiParameterEvent) SetDepth ¶
func (h *MultiParameterEvent) SetDepth(d float64)
func (MultiParameterEvent) Velocity ¶
func (h MultiParameterEvent) Velocity() float64
func (MultiParameterEvent) WaveHeight ¶
func (h MultiParameterEvent) WaveHeight() float64
type Parameter ¶
type Parameter uint //switch to uint64 if we hit 32 slots and need another.
Parameter is a bitflag enum
const ( Default Parameter = 0 //0 Depth Parameter = 1 //1 Velocity Parameter = 2 //2 ArrivalTime Parameter = 4 //3 ArrivalTime2ft Parameter = 8 //4 Erosion Parameter = 16 //5 Duration Parameter = 32 //6 WaveHeight Parameter = 64 //7 MediumWaveHeight Parameter = 128 //8 HighWaveHeight Parameter = 256 //9 Salinity Parameter = 512 //10 Qualitative Parameter = 1024 //11 DV Parameter = 2048 //12 ModerateVelocity Parameter = 4096 //13 HighVelocity Parameter = 8192 //14 LongDuration Parameter = 16384 //15 )
Parameter types describe different parameters for hazards
func SetHasArrivalTime ¶
SetHasArrivalTime turns on a bitflag for the Parameter Arrival Time
func SetHasDepth ¶
SetHasDepth turns on a bitflag for the Parameter Depth
func SetHasDuration ¶
SetHasDuration turns on a bitflag for the Parameter Duration
func SetHasErosion ¶
SetHasErosion turns on a bitflag for the Parameter Erosion
func SetHasHighVelocity ¶
SetHasHighVelocity turns on a bitflag for the Parameter Velocity
func SetHasHighWaveHeight ¶
func SetHasLongDuration ¶
SetHasDuration turns on a bitflag for the Parameter Duration
func SetHasMediumWaveHeight ¶
func SetHasModerateVelocity ¶
SetHasModerateVelocity turns on a bitflag for the Parameter Velocity
func SetHasQualitative ¶
SetHasSalinity turns on a bitflag for the Parameter Salinity
func SetHasSalinity ¶
SetHasSalinity turns on a bitflag for the Parameter Salinity
func SetHasVelocity ¶
SetHasVelocity turns on a bitflag for the Parameter Velocity
func SetHasWaveHeight ¶
SetHasWaveHeight turns on a bitflag for the Parameter WaveHeight
func (Parameter) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string
func (*Parameter) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted, comma separated string to the parameter value
type QualitativeEvent ¶
type QualitativeEvent struct {
// contains filtered or unexported fields
}
ArrivalandDurationEvent describes an event with an arrival time, depth and a duration in days
func (QualitativeEvent) ArrivalTime ¶
func (h QualitativeEvent) ArrivalTime() time.Time
func (QualitativeEvent) DV ¶
func (h QualitativeEvent) DV() float64
func (QualitativeEvent) Depth ¶
func (h QualitativeEvent) Depth() float64
func (QualitativeEvent) Duration ¶
func (h QualitativeEvent) Duration() float64
func (QualitativeEvent) Erosion ¶
func (h QualitativeEvent) Erosion() float64
func (QualitativeEvent) Has ¶
func (q QualitativeEvent) Has(p Parameter) bool
Has implements the HazardEvent Interface
func (QualitativeEvent) MarshalJSON ¶
func (d QualitativeEvent) MarshalJSON() ([]byte, error)
func (QualitativeEvent) Parameters ¶
func (q QualitativeEvent) Parameters() Parameter
Parameters implements the HazardEvent interface
func (QualitativeEvent) Qualitative ¶
func (h QualitativeEvent) Qualitative() string
func (QualitativeEvent) Salinity ¶
func (h QualitativeEvent) Salinity() bool
func (*QualitativeEvent) SetQualitative ¶
func (h *QualitativeEvent) SetQualitative(message string)
func (QualitativeEvent) Velocity ¶
func (h QualitativeEvent) Velocity() float64
func (QualitativeEvent) WaveHeight ¶
func (h QualitativeEvent) WaveHeight() float64