gw

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 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 reads LIGO, Virgo, and Kagra catalogue events from the Gravitational Wave Open Science Center, called the centre here. Estimates and credible intervals are converted to SI as they are read; event times become sky.Instant values on the GPS scale.

Parameters retain the centre’s names. A caller chooses which estimates to interpret; the reader does not guess their meaning. Missing values remain absent rather than becoming zero, and missing interval bounds remain unknown.

Unit strings such as M_sun and Mpc use explicit conversions. Unknown unit strings return an error instead of leaving a value in ambiguous units.

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 stores a catalogue value in SI with its reported 90% credible interval. Bounds are offsets below and above the central value; a missing bound leaves the interval unknown.

func (*Estimate) Interval

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

Interval returns absolute lower and upper limits and whether both bounds were reported. If either is missing, both returned endpoints equal Value and known is false.

func (*Estimate) String

func (estimate *Estimate) String() string

String formats the central value, lower and upper offsets, and unit.

func (*Estimate) Unit

func (estimate *Estimate) Unit() string

Unit returns kg, m, s^-1, J, W, sr, or an empty string for a dimensionless value.

func (*Estimate) Value

func (estimate *Estimate) Value() float64

Value returns the estimate in the SI unit named by Unit.

type Estimator

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

Estimator supplies estimates by the centre’s parameter names. Event implements it; callers can use the generated mock to test estimate handling separately from catalogue parsing.

type Event

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

Event holds one versioned catalogue event: name, catalogue, GPS time, and estimates under the centre’s original parameter names.

func ReadEvents

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

ReadEvents parses the centre’s event-API JSON and returns events in key order. It rejects malformed or empty event objects, missing names or GPS times, unsupported units, and bounds on the wrong side of their estimates. Invalid GPS times retain the sky conversion error.

func (*Event) At

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

At returns the event time as a GPS-scale instant.

func (*Event) Catalog

func (event *Event) Catalog() string

Catalog returns the centre’s short catalogue name.

func (*Event) Estimate

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

Estimate looks up a reported parameter. A blank or absent value returns an error rather than an invented zero.

func (*Event) Parameters

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

Parameters returns estimated parameter names in sorted order.

func (*Event) String

func (event *Event) String() string

String returns the centre’s event key, such as GW150914-v3.

Jump to

Keyboard shortcuts

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