gw

package
v0.0.3 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

This section is empty.

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 estimates by the centre's name for each parameter. Event is one. A caller that reads estimates takes an Estimator, so its tests can stand the generated mock in for an event.

type Event

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

Event is one merger in one of the centre's catalogues:

  • its name and version
  • the catalogue it is in
  • its gps time
  • every estimate the centre gives for it, each under the centre's own 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 serves it: an object of events, each keyed by name and version, read in the order of their keys. returns nil and error for:

  • a file that is not that json, or holds no events
  • an event without its name or gps time, or a gps time sky refuses
  • a value without a unit, or in a unit gw has no conversion for
  • a bound on the wrong side of its value

func (*Event) At

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

At is the event's gps time.

func (*Event) Catalog

func (event *Event) Catalog() string

Catalog is the short name of the event's catalogue, as the centre writes it.

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. returns nil and error for a parameter the event has none of, whether the centre left it blank or never gave it.

func (*Event) Parameters

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

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

func (*Event) String

func (event *Event) String() string

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

Jump to

Keyboard shortcuts

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