Accept target magnitude as string or as quantity

This commit is contained in:
Lukas Klass 2020-04-27 09:17:57 +02:00
parent 67e08c2788
commit 2e6df65928

View File

@ -52,7 +52,7 @@ class RadiantFactory:
attribs["wl_bins"] = self.__wl_bins attribs["wl_bins"] = self.__wl_bins
if options.type == "BlackBodyTarget": if options.type == "BlackBodyTarget":
# Black Body Target # Black Body Target
if "mag" in attribs: if "mag" in attribs and type(attribs["mag"]) == str:
attribs["mag"] = float(attribs["mag"]) * u.mag attribs["mag"] = float(attribs["mag"]) * u.mag
return tg.BlackBodyTarget(**attribs) return tg.BlackBodyTarget(**attribs)
elif options.type == "FileTarget": elif options.type == "FileTarget":