Exemple #1
0
    def Init(self):
        self.sed = Sed.SED(self.target,
                           self.convolve,
                           pix2wgth=self.pix2wgth_coef,
                           plot=self.plot,
                           seeing_at_wght=self.seeing_at_wght)

        self.sed_wavelength, self.sed_flux = self.sed.smoothedSed()
 def Init(self, seeing_at_wght):
     self.sed = Sed.SED(self.target,
                        self.convolve,
                        pix2wgth=self.pix2wgth_coef,
                        ronchi=self.ronchi,
                        seeing_at_wght=seeing_at_wght)
     if self.sed.calspec:
         self.sed_wavelength, self.sed_flux = self.sed.SedModel(
             self.telescope)
         if (self.eval_above_telescope is True):
             self.sed_wavelength_noqe, self.sed_flux_noqe\
             = self.sed.SedModel(eval_above_telescope = True)
    k = 1
    while (k < narg):
        if (sys.argv[k] == "-r"):
            k += 1
            raw_spectrum = sys.argv[k]
            k += 1
        elif (sys.argv[k] == "-s"):
            k += 1
            SED = sys.argv[k]
            k += 1
        elif (sys.argv[k] == "-a"):
            k += 1
            atmosphere = sys.argv[k]
            k += 1

    sed = Sed.SED(SED)
    fig = pl.figure(2)
    pl.plot(sed.wavelength, sed.flux, color='black')
    pl.title('SED')
    pl.legend()
    fig.savefig("sed.pdf")

    fig = pl.figure(0)
    data = np.recfromtxt(atmosphere)
    pl.plot(data[:, 0], data[:, 1], color='black')
    pl.title('atmospheric opacity')
    pl.legend()
    fig.savefig("atmo.pdf")

    atmo = interp.griddata(data[:, 0], data[:, 1], sed.wavelength)
    sed.flux = sed.flux * atmo