diff --git a/esbo_etc/classes/target/FileTarget.py b/esbo_etc/classes/target/FileTarget.py index 8819529..f1b84c3 100644 --- a/esbo_etc/classes/target/FileTarget.py +++ b/esbo_etc/classes/target/FileTarget.py @@ -26,7 +26,10 @@ class FileTarget(ATarget): Wavelengths used for binning """ # Create spectral quantity from file - sfd = SpectralQty.fromFile(file, u.nm, u.W / (u.m ** 2 * u.nm)).rebin(wl_bins) + try: + sfd = SpectralQty.fromFile(file, u.nm, u.W / (u.m ** 2 * u.nm)).rebin(wl_bins) + except: + sfd = SpectralQty.fromFile(file, u.nm, u.W / (u.m ** 2 * u.nm * u.sr)).rebin(wl_bins) # Initialize the super class super().__init__(sfd, wl_bins)