From 5ef9300353e96854a8c09a4aa23eb17bcfb4d545 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Wed, 8 Apr 2020 17:29:55 +0200 Subject: [PATCH] Bugfix: use correct wavelength bins --- esbo_etc/classes/target/BlackBodyTarget.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esbo_etc/classes/target/BlackBodyTarget.py b/esbo_etc/classes/target/BlackBodyTarget.py index 35646ed..6f77314 100644 --- a/esbo_etc/classes/target/BlackBodyTarget.py +++ b/esbo_etc/classes/target/BlackBodyTarget.py @@ -34,6 +34,9 @@ class BlackBodyTarget(ATarget): Desired apparent magnitude of the point source band : str Band used for fitting the planck curve to a star of 0th magnitude + + Returns + ------- """ if band not in self.band_wl.keys(): error("Band has to be one of '[" + ", ".join(list(self.band_wl.keys())) + "]'") @@ -42,9 +45,9 @@ class BlackBodyTarget(ATarget): # Calculate the correction factor for a star of 0th magnitude using the spectral flux density # for the central wavelength of the given band - factor = self.band_sfd[band] / (bb(self.band_wl[band]) * u.sr) + factor = self.band_sfd[band] / (bb(self.band_wl[band]) * u.sr) * u.sr # Calculate spectral flux density for the given wavelengths and scale it for a star of the given magnitude sfd = bb(wl_bins) * factor * 10 ** (- 2 / 5 * mag / u.mag) # Initialize super class - super().__init__(SpectralQty(self.band_wl, sfd)) + super().__init__(SpectralQty(wl_bins, sfd))