proxy.golang.org : github.com/sbinet/cosmo
Package cosmo implements basic cosmology calculations in Go. FLRW is the basic interface type that defines the key cosmological functions common to all supported cosmologies. The Friedmann-Lemaître-Robertson-Walker (FLRW) metric is the general form that all homogenous, isotropic, connected cosmologies follow. https://en.wikipedia.org/wiki/Friedmann-Lema%C3%AEtre-Robertson-Walker_metric Provides: Equations and numerical formulae based on Organizational thoughts based on code in astropy.cosmology Performance Notes: 1. Calculating a single line-of-sight comoving distance takes from 890ns - 260µs, depending on the complexity of the cosmology. Analytic cases take ~1µs, while explicit integration is ~200µs. These numbers are based on the output of `go test -bench ComovingDistance` run on a 2015 MacBook Air: dual-core 2.2 GHz Intel Core i7, 8 GB 1600 MHz DDR3; with Mac OS X 10.13.2 and go 1.9.2 2. The current types FlatLCDM, LambdaCDM, WCDM, WACDM implement their methods as value receivers. There's a mild performance hit for using value receivers instead of pointer receivers. This performance penalty is 40% for individual calls to E or Einv but this penalty is only 1-2% for calls to the general *Distance methods. For now the use case model seems more amenable to value receivers -- conceptually, the cosmologies should be immutable -- and the performance penalty is acceptable.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/sbinet/cosmo
License: MIT
Latest release: over 7 years ago
First release: over 7 years ago
Namespace: github.com/sbinet
Last synced: 3 months ago