Commit 672a9e5a authored by Francesco Montanari's avatar Francesco Montanari

Add comoving-volume command

* cosmo.el (cosmo-comoving-volume): Add interactive command for the
  comoving volume. Still need tests.

* Fix doc strings.
parent 045c8d37
......@@ -370,7 +370,10 @@ Optional argument JMAX maximum number of steps."
(cosmo-get-parallax-distance z)))))
(defun cosmo--get-comoving-volume-nonflat (DM DH ocurvature)
"Return the comoving volume for non-vanishing curvature."
"Return the comoving volume for non-vanishing curvature.
Argument DM comoving distance (transverse).
Argument DH Hubble distance
Argument OCURVATURE curvature density parameter"
(let* ((DM-over-DH (/ DM DH))
(sqrt-ok (sqrt (abs (cosmo-get-ocurvature))))
(pref (* 2.0 float-pi (/ (expt DH 3.0) ocurvature)))
......@@ -394,6 +397,13 @@ Optional argument JMAX maximum number of steps."
(* (/ 4.0 3.0) float-pi (expt DM 3.0))
(cosmo--get-comoving-volume-nonflat DM DH ocurvature))))
(defun cosmo-comoving-volume ()
"Display comoving volume in mini-buffer."
(interactive)
(let ((z (cosmo--read-param "redshift")))
(message (format "%s Mpc^3"
(cosmo-get-comoving-volume z)))))
;;; Handle output.
(defun cosmo--write-calc-header ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment