seiscompml07

package
v0.0.0-...-14215d6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrivalFormat

func ArrivalFormat() (m map[string]string)

ArrivalFormat describes the values that are in the map returned by ArrivalMap. This can be used for query validation and documentation.

func Get

func Get(eventid []string) (seiscompml map[string]Event)

Get retrives SeisCompML for each EventID. Errors are logged but not returned.

func PickFormat

func PickFormat() (m map[string]string)

PickFormat describes the values that are in the map returned by PickMap. This can be used for query validation and documentation.

Types

type Arrival

type Arrival struct {
	PickID       string  `xml:"pickID"`
	Phase        string  `xml:"phase"`
	Azimuth      float64 `xml:"azimuth"`
	Distance     float64 `xml:"distance"`
	TimeResidual float64 `xml:"timeResidual"`
	TimeWeight   float64 `xml:"weight"`
	Pick         *Pick
}

Arrival for unmarshalling SeisCompML

type Event

type Event struct {
	PreferredOriginID    string `xml:"preferredOriginID"`
	PreferredMagnitudeID string `xml:"preferredMagnitudeID"`
	PreferredOrigin      *Origin
	PreferredMagnitude   *Magnitude
	Picks                map[string]*Pick
	Origins              map[string]*Origin
	Magnitudes           map[string]*Magnitude
	// Copy these from EventParameters so that the api will be the same as for
	// SeisCompML 1.2
	O []Origin
	M []Magnitude
	P []Pick
}

Event for unmarshalling SeisCompML

func (*Event) PickMap

func (e *Event) PickMap() (m []map[string]string)

PickMap remaps the Pick information in the SeisCompML to allow for user selectable output.

type EventParameters

type EventParameters struct {
	Event Event    `xml:"event"`
	O     []Origin `xml:"origin"`
	P     []Pick   `xml:"pick"`
}

EventParameters for unmarshalling SeisCompML

type Mag

type Mag struct {
	Value       float64 `xml:"value"`
	Uncertainty float64 `xml:"uncertainty"`
}

Mag for unmarshalling SeisCompML

type Magnitude

type Magnitude struct {
	PublicID     string `xml:"publicID,attr"`
	Mag          Mag    `xml:"magnitude"`
	Type         string `xml:"type"`
	MethodID     string `xml:"methodID"`
	StationCount int    `xml:"stationCount"`
}

Magnitude for unmarshalling SeisCompML

type Origin

type Origin struct {
	PublicID string      `xml:"publicID,attr"`
	Time     TimeValue   `xml:"time"`
	Arrivals []Arrival   `xml:"arrival"`
	M        []Magnitude `xml:"magnitude"`
}

Origin for unmarshalling SeisCompML

func (*Origin) ArrivalMap

func (o *Origin) ArrivalMap() (m []map[string]string)

ArrivalMap remaps the Arrival information in the SeisCompML to allow for user selectable output.

type Pick

type Pick struct {
	PublicID         string     `xml:"publicID,attr"`
	Time             TimeValue  `xml:"time"`
	WaveformID       WaveformID `xml:"waveformID"`
	PhaseHint        string     `xml:"phaseHint"`
	EvaluationMode   string     `xml:"evaluationMode"`
	EvaluationStatus string     `xml:"evaluationStatus"`
}

Pick for unmarshalling SeisCompML

type Seiscomp

type Seiscomp struct {
	EventParameters EventParameters `xml:"EventParameters"`
}

Seiscomp the top level container for unmarshalling SeisCompML

Reflection is used in parsing so if case doesn't match the names then have to name the corresponding element. Tried changing case of the elements in the XML but it got problematic with namespaces.

type TimeValue

type TimeValue struct {
	Value       time.Time `xml:"value"`
	Uncertainty float64   `xml:"uncertainty"`
}

TimeValue for unmarshalling SeisCompML

type Value

type Value struct {
	Value       float64 `xml:"value"`
	Uncertainty float64 `xml:"uncertainty"`
}

Value for unmarshalling SeisCompML

type WaveformID

type WaveformID struct {
	NetworkCode  string `xml:"networkCode,attr"`
	StationCode  string `xml:"stationCode,attr"`
	LocationCode string `xml:"locationCode,attr"`
	ChannelCode  string `xml:"channelCode,attr"`
}

WaveformID for unmarshalling SeisCompML

Jump to

Keyboard shortcuts

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