Example #1
0
    def Load_Atmosphere(self, airmass=1.2):

        self.airmass = airmass
        if self.airmass > 0.:
            atmosphere = Bandpass()

            #official atmospheric simulation
            if not self.libradtran:
                path_atmos = os.path.join(self.atmosDir,
                                          'atmos_%d.dat' % (self.airmass * 10))
                if os.path.exists(path_atmos):
                    atmosphere.readThroughput(
                        os.path.join(self.atmosDir,
                                     'atmos_%d.dat' % (self.airmass * 10)))
                else:
                    atmosphere.readThroughput(
                        os.path.join(self.atmosDir, 'atmos.dat'))
                self.atmos = Bandpass(wavelen=atmosphere.wavelen,
                                      sb=atmosphere.sb)
            else:  # with libradtran
                path, thefile = ProcessSimulationaer(airmass, atm_pwv,
                                                     atm_ozone, atm_wl0,
                                                     atm_aer)
                #path,thefile=ProcessSimulation(am,pwv,ozone)
                atmdata = np.loadtxt(os.path.join(path, thefile))
                wl = atmdata[:, 0]
                atm = atmdata[:, 1]
                func = interp1d(wl, atm, kind='linear')
                transm = func(WL)
                atmosphere.wavelen = WL
                atmosphere.sb = transm
                self.atmos = Bandpass(wavelen=WL, sb=transm)

            for f in self.filterlist:
                wavelen, sb = self.lsst_system[f].multiplyThroughputs(
                    atmosphere.wavelen, atmosphere.sb)
                self.lsst_atmos[f] = Bandpass(wavelen=wavelen, sb=sb)

            if self.aerosol:
                atmosphere_aero = Bandpass()
                atmosphere_aero.readThroughput(
                    os.path.join(self.atmosDir,
                                 'atmos_%d_aerosol.dat' % (self.airmass * 10)))
                self.atmos_aerosol = Bandpass(wavelen=atmosphere_aero.wavelen,
                                              sb=atmosphere_aero.sb)

                for f in self.filterlist:
                    wavelen, sb = self.lsst_system[f].multiplyThroughputs(
                        atmosphere_aero.wavelen, atmosphere_aero.sb)
                    self.lsst_atmos_aerosol[f] = Bandpass(wavelen=wavelen,
                                                          sb=sb)
        else:
            for f in self.filterlist:
                self.lsst_atmos[f] = self.lsst_system[f]
                self.lsst_atmos_aerosol[f] = self.lsst_system[f]
Example #2
0
    def Set_Atmosphere(self, airmass, wavelenatm, transmatm):

        self.airmass = airmass
        if self.airmass > 0.:
            atmosphere = Bandpass()

            # interpolation
            func = interp1d(wavelenatm, transmatm, kind='linear')
            transm = func(WL)

            atmosphere.wavelen = WL
            atmosphere.sb = transm
            self.atmos = Bandpass(wavelen=WL, sb=transm)

            # loop on filters to update effective throughput
            for f in self.filterlist:
                wavelen, sb = self.lsst_system[f].multiplyThroughputs(
                    atmosphere.wavelen, atmosphere.sb)
                self.lsst_atmos[f] = Bandpass(wavelen=wavelen, sb=sb)