Beispiel #1
0
    def loadfpring(self):

        date = os.getcwd().split('/')[-1]
        
        self.getFitsHeader()
        fits = "mbxpP%s%04d.fits" % (date, self.filenumber)
        if self.flatnumber != 0:
            flat = "mbxpP%s%04d.fits" % (date, self.flatnumber)
        else:
            flat="/home/ccd/erc/FP_utils/DefaultNeFlat.fits"

        ffits='f'+fits
        fpfile='p'+ffits
        maskedfile='m'+fpfile


        if (not os.path.isfile(maskedfile)): 
             saltflat(fits,ffits,'',flat, clobber='yes',verbose='no')
             
             saltfpprep(ffits,fpfile,'',clobber='yes',verbose='no')
             
             saltfpmask(fpfile,maskedfile,'',axc=798*4/self.xbin,ayc=503*4/self.ybin,arad=450*4/self.xbin,clobber='yes', verbose='no')

        self.good, self.rsq, self.prof, self.fit, self.pars = fit_rings(maskedfile)
        self.resid = self.prof - self.fit
        self.rms = self.resid.std()

        self.saveFitToFile()
        
        return
Beispiel #2
0
    def loadfpring(self):

        date = os.getcwd().split('/')[-1]

        self.getFitsHeader()
        fits = "mbxpP%s%04d.fits" % (date, self.filenumber)
        if self.flatnumber != 0:
            flat = "mbxpP%s%04d.fits" % (date, self.flatnumber)
        else:
            flat = "/home/ccd/erc/FP_utils/DefaultNeFlat.fits"

        ffits = 'f' + fits
        fpfile = 'p' + ffits
        maskedfile = 'm' + fpfile

        if (not os.path.isfile(maskedfile)):
            saltflat(fits, ffits, '', flat, clobber='yes', verbose='no')

            saltfpprep(ffits, fpfile, '', clobber='yes', verbose='no')

            saltfpmask(fpfile,
                       maskedfile,
                       '',
                       axc=798 * 4 / self.xbin,
                       ayc=503 * 4 / self.ybin,
                       arad=450 * 4 / self.xbin,
                       clobber='yes',
                       verbose='no')

        self.good, self.rsq, self.prof, self.fit, self.pars = fit_rings(
            maskedfile)
        self.resid = self.prof - self.fit
        self.rms = self.resid.std()

        self.saveFitToFile()

        return
        date = os.getcwd().split('/')[-1]

        fits = "mbxgpP%s%04d.fits" % (date, filenum)
        flat = "mbxgpP%s%04d.fits" % (date, flatnum)

        ffits='f'+fits
        fpfile='p'+ffits
        maskedfile='m'+fpfile
        

        if (not os.path.isfile(maskedfile)): 
             saltflat(fits,ffits,'',flat, clobber='yes',verbose='no')

             saltfpprep(ffits,fpfile,'',clobber='yes',verbose='no')

             saltfpmask(fpfile,maskedfile,'',axc=798,ayc=503,arad=450,clobber='yes', verbose='no')

          

        good, rsq, prof, fit, pars = fit_rings(maskedfile)
        resid = prof - fit
        rms = resid.std()

             
        hdu = pyfits.open(fits)
        (data, header) = (hdu[0].data, hdu[0].header)
        etalon = int(header['ET-STATE'].split()[3])
        hetalon_x = "ET%dX" % etalon
        hetalon_y = "ET%dY" % etalon
        hetalon_z = "ET%dZ" % etalon
Beispiel #4
0
        exit()

    date = os.getcwd().split('/')[-1]

    fits = "mbxgpP%s%04d.fits" % (date, filenum)
    flat = "mbxgpP%s%04d.fits" % (date, 22)

    ffits='f'+fits
    print flat
    saltflat(fits,ffits,'',flat, clobber='yes',verbose='no')

    fpfile='p'+ffits
    saltfpprep(ffits,fpfile,'',clobber='yes',verbose='no')

    maskedfile='m'+fpfile
    saltfpmask(fpfile,maskedfile,'',axc=798,ayc=503,arad=450,clobber='yes', verbose='no')

    good, rsq, prof, fit, pars = fit_rings(maskedfile)
    resid = prof - fit
    rms = resid.std()
    print "\tR = %.3f, Amp = %.3f, RMS = %.3f, Gamma = %.3f, FWHM = %.3f" % \
          (pars['R'][0],
           pars['Amplitude'][0],
           rms,
           pars['Gamma'][0],
           pars['FWHM'][0])
    pl.figure()
    pl.subplot(211)
    pl.plot(rsq, prof, label="Profile")
    pl.plot(rsq, fit, label="Fit")
    pl.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,