From a5bb6d615e92d80bac82a95177238c3ebf144dc7 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 19 Jun 2017 17:53:21 +0800 Subject: utils/cosmology: Add methods DL() and DA() --- fg21sim/utils/cosmology.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fg21sim') diff --git a/fg21sim/utils/cosmology.py b/fg21sim/utils/cosmology.py index 12e581a..906f7d8 100644 --- a/fg21sim/utils/cosmology.py +++ b/fg21sim/utils/cosmology.py @@ -75,6 +75,20 @@ class Cosmology: """ return self.H0 * self.E(z) + def DL(self, z): + """ + Luminosity distance at redshift z. + Unit: [Mpc] + """ + return self._cosmo.luminosity_distance(z).value + + def DA(self, z): + """ + Angular diameter distance at redshift z. + Unit: [Mpc] + """ + return self._cosmo.angular_diameter_distance(z).value + @property def hubble_time(self): """ -- cgit v1.2.2