Bugfix: use correct wavelength bins
This commit is contained in:
parent
e52fcdd71b
commit
5ef9300353
@ -34,6 +34,9 @@ class BlackBodyTarget(ATarget):
|
|||||||
Desired apparent magnitude of the point source
|
Desired apparent magnitude of the point source
|
||||||
band : str
|
band : str
|
||||||
Band used for fitting the planck curve to a star of 0th magnitude
|
Band used for fitting the planck curve to a star of 0th magnitude
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
"""
|
"""
|
||||||
if band not in self.band_wl.keys():
|
if band not in self.band_wl.keys():
|
||||||
error("Band has to be one of '[" + ", ".join(list(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
|
# Calculate the correction factor for a star of 0th magnitude using the spectral flux density
|
||||||
# for the central wavelength of the given band
|
# 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
|
# 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)
|
sfd = bb(wl_bins) * factor * 10 ** (- 2 / 5 * mag / u.mag)
|
||||||
|
|
||||||
# Initialize super class
|
# Initialize super class
|
||||||
super().__init__(SpectralQty(self.band_wl, sfd))
|
super().__init__(SpectralQty(wl_bins, sfd))
|
||||||
|
Loading…
Reference in New Issue
Block a user