aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-06-19 17:53:21 +0800
committerAaron LI <aly@aaronly.me>2017-06-19 17:53:21 +0800
commita5bb6d615e92d80bac82a95177238c3ebf144dc7 (patch)
treed8768812e6f26ec88327085c8480ed3ffddc572a
parent8da5833dcb8365568673944afdea7d1a9c334bff (diff)
downloadfg21sim-a5bb6d615e92d80bac82a95177238c3ebf144dc7.tar.bz2
utils/cosmology: Add methods DL() and DA()
-rw-r--r--fg21sim/utils/cosmology.py14
1 files changed, 14 insertions, 0 deletions
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):
"""