gw

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gw is gravitational waves as the LIGO, Virgo and Kagra detectors publish them through the gravitational wave open science centre, called the centre here: the events of its catalogues, each with its estimates and their credible intervals, read into si units.

gw knows the centre's format, not its parameters' meanings: an event holds every estimate the centre gives under the centre's own name for it, and a caller asks for one by that name. A value the centre leaves blank is absent, never nought, and a bound it leaves blank is unknown.

Units arrive as strings, M_sun or Mpc; each is turned into si as it is read, by a table of the strings the centre writes, and a string not in the table is refused. Time is the event's gps time, as a sky.Instant.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAbsent

func ErrAbsent() error

ErrAbsent is a parameter an event has no estimate for: the centre left it blank, or never gave it.

func ErrEvents

func ErrEvents() error

ErrEvents is a file that is not the centre's event json, or an event in it without its name or its gps time.

func ErrUnit

func ErrUnit() error

ErrUnit is a unit string the centre wrote that is not in gw's table, so the value cannot be put in si.

Types

type Estimate

type Estimate struct {
	// contains filtered or unexported fields
}

Estimate is a value the centre publishes for an event, in si units, and its credible interval, as the centre states it: how far below and above the value the interval runs. the centre gives ninety per cent intervals. A bound it leaves blank is unknown.

func (*Estimate) Interval

func (estimate *Estimate) Interval() (lowest, highest float64, known bool)

Interval is the lowest and highest the credible interval reaches, and whether the centre gave both its bounds. When it did not, the interval is not known and the two are the value.

func (*Estimate) String

func (estimate *Estimate) String() string

String is the estimate as the centre writes it: the value, the interval's reach below and above, and the unit.

func (*Estimate) Unit

func (estimate *Estimate) Unit() string

Unit is the si unit the estimate is in, as written: kg, m, s^-1, J, W, sr, or nothing for a pure number.

func (*Estimate) Value

func (estimate *Estimate) Value() float64

Value is the estimate, in the si unit Unit names.

type Estimator

type Estimator interface {
	Estimate(parameter string) (*Estimate, error)
}

Estimator gives an event's estimates, by the centre's name for each parameter: an Event is one. A caller that works from an event's estimates takes an Estimator, so its tests stand a mock in (celestial/mocks) and expect its calls.

type Event

type Event struct {
	// contains filtered or unexported fields
}

Event is a merger as a the centre catalogue lists it: its name and version, the catalogue it is in, its gps time, and every estimate the centre gives for it, by the centre's name for the parameter.

func ReadEvents

func ReadEvents(raw []byte) ([]*Event, error)

ReadEvents is every event in the centre's event json, as its event api gives it: an object of events, each keyed by its name and version. It refuses a file that is not that, an event without its name or gps time, and a unit gw has no conversion for, and then gives none.

func (*Event) At

func (event *Event) At() sky.Instant

At is the event's gps time, as the centre gives it.

func (*Event) Catalog

func (event *Event) Catalog() string

Catalog is the short name of the catalogue the event is in.

func (*Event) Estimate

func (event *Event) Estimate(parameter string) (*Estimate, error)

Estimate is the event's estimate of a parameter, by the centre's name for it. It refuses a parameter the event has no estimate for, and then gives none.

func (*Event) Parameters

func (event *Event) Parameters() []string

Parameters is the name of every parameter the event has an estimate for, in order.

func (*Event) String

func (event *Event) String() string

String is the event's name and version, as the centre keys it: GW150914-v3.

Jump to

Keyboard shortcuts

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