cosmo.el — Cosmological Calculator
Copyright (C) 2017 Francesco Montanari <[email protected]>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Cosmological calculator for the Emacs text editor.
This package provides a cosmological calculator for Lambda-CDM models. Such a framework describes a homogeneous and isotropic universe containing a cosmological constant (Lambda) and a Cold Dark Matter (CDM) component, besides ordinary species. The model is characterized by the following parameters:
- H_0
- Hubble parameter (expansion rate) today.
- Omega_m0
- Matter density parameter today.
- Omega_Lambda
- Cosmological constant density parameter.
- Omega_r0
- Relativistic species (e.g., photons plus neutrinos) density parameter today.
- Omega_k0
- Curvature density parameter today. This
parameter is derived from the others above
according to Friedmann’s equation
Omega_m0 + Omega_Lambda + Omega_r0 + Omega_k0 = 1
.
All cosmological quantities are computed at a given redshift value:
- redshift
- Gravitational redshift of photons frequency due to the expansion of the Universe.
Definitions follow Hogg (1999) [arXiv:astro-ph/9905116]. The
cosmo-calculator
command is based on Gnuastro astcosmiccal
program (v0.2).
The package is available on the MELPA repository. Enable the repository following the related instructions, then type:
M-x package-list-packages
Select the cosmo
package for installation.
Download or clone the git repository:
git clone [email protected]:montanari/cosmo-el.git
Copy the cosmo.el
file into a sub-folder under your Emacs
configuration directory. (In general this directory can be
accessed from Emacs, independently from the operating system,
by typing the command C-x C-f ~/.emacs.d/
.) E.g., on Unix
systems:
mkdir ~/.emacs.d/cosmo-el
cp cosmo.el ~/.emacs.d/cosmo-el
Add the path to the cosmo.el
package folder into your Emacs
configuration file (e.g., ~/.emacs
on Unix systems):
;; Cosmological calculator
(add-to-list 'load-path "~/.emacs.d/cosmo-el/")
(require 'cosmo)
Open Emacs and type M-x cosmo-command
, where the command
name varies depending on the desired computation:
- cosmo-age
- Display age of the Universe in mini-buffer. (This command may take a few seconds.)
- cosmo-angular-diameter-distance
- Display angular diameter distance in mini-buffer.
- cosmo-calculator
- Compute cosmology and display summary
table in a new buffer. The following illustrates a
possible output:
Cosmology calculator. Input Parameters ---------------- - Redshift: 0.1 - Hubble constant, now [km/s/Mpc]: 70.0 - Matter fractional density, now: 0.3 <...> Cosmography at required redshift ------------------------------- - Hubble parameter [km/s/Mpc]: 73.39325582095401 <...>
- cosmo-comoving-volume
- Display comoving volume in mini-buffer.
- cosmo-hubble
- Display Hubble parameter in mini-buffer.
- cosmo-hubble-distance
- Display Hubble distance c/H0 in mini-buffer.
- cosmo-hubble-time
- Display Hubble time 1/H0 in mini-buffer.
- cosmo-lookback-time
- Display lookback time in mini-buffer.
- cosmo-los-comoving-distance
- Display line-of-sight comoving distance in mini-buffer.
- cosmo-luminosity-distance
- Display luminosity distance in mini-buffer.
- cosmo-parallax-distance
- Display parallax distance in mini-buffer.
- cosmo-set-params
- Change the values of cosmological parameters.
- cosmo-transverse-comoving-distance
- Display transverse comoving distance in mini-buffer.
Use the command M-x customize
to set variables related to
internal implementation details (e.g., the precision of
numerical integrals), under the Cosmo
group.
To interrupt an ongoing computation press C-g
.
Bugs and issues are tracked through the git repository page. Please see this page about how to report bugs effectively.
Any kind of contribution is welcome.
For small contributions simple patches are welcome (the preferred way is to follow, e.g., org-mode conventions). For more substantial contributions the following workflow may be considered:
- Fork the repository.
- Do the changes on a new branch (the master branch should only be used to pull updates from the original repository, added as a git remote).
- Notify via the issue tracker or email about the modifications (please provide the git address and branch name to be merged).