Exemple #1
0
    def test_main(self):
        if self.data_unavailable:
            self.skipTest("Failed to download test data.")
        argstr = [
            '--fiberflat', self.testflat,
            '--arcfile', self.testarc,
            '--outfile', self.testout,
            '--qafile', self.qafile,
        ]
        args = bootscript.parse(options=argstr)
        bootscript.main(args)
        
        #- Ensure the PSF class can read that file
        from desispec.psf import PSF
        psf = PSF(self.testout)
        
        #- While we're at it, test some PSF accessor functions
        w = psf.wavelength()
        w = psf.wavelength(ispec=0)
        w = psf.wavelength(ispec=[0,1])
        w = psf.wavelength(ispec=[0,1], y=0)
        w = psf.wavelength(ispec=[0,1], y=[0,1])
        
        x = psf.x()
        x = psf.x(ispec=0)
        x = psf.x(ispec=[0,1])
        x = psf.x(ispec=None, wavelength=psf.wmin)
        x = psf.x(ispec=1, wavelength=psf.wmin)
        x = psf.x(ispec=[0,1], wavelength=psf.wmin)
        x = psf.x(ispec=[0,1], wavelength=[psf.wmin, psf.wmin+1])

        y = psf.y(ispec=None, wavelength=psf.wmin)
        y = psf.y(ispec=0, wavelength=psf.wmin)
        y = psf.y(ispec=[0,1], wavelength=psf.wmin)
        y = psf.y(ispec=[0,1], wavelength=[psf.wmin, psf.wmin+1])
        
        t = psf.invert()        
Exemple #2
0
    def test_main(self):
        if self.data_unavailable:
            self.skipTest("Failed to download test data.")
        argstr = [
            '--fiberflat',
            self.testflat,
            '--arcfile',
            self.testarc,
            '--outfile',
            self.testout,
            '--qafile',
            self.qafile,
        ]
        args = bootscript.parse(options=argstr)
        bootscript.main(args)

        #- Ensure the PSF class can read that file
        from desispec.psf import PSF
        psf = PSF(self.testout)

        #- While we're at it, test some PSF accessor functions
        w = psf.wavelength()
        w = psf.wavelength(ispec=0)
        w = psf.wavelength(ispec=[0, 1])
        w = psf.wavelength(ispec=[0, 1], y=0)
        w = psf.wavelength(ispec=[0, 1], y=[0, 1])

        x = psf.x()
        x = psf.x(ispec=0)
        x = psf.x(ispec=[0, 1])
        x = psf.x(ispec=None, wavelength=psf.wmin)
        x = psf.x(ispec=1, wavelength=psf.wmin)
        x = psf.x(ispec=[0, 1], wavelength=psf.wmin)
        x = psf.x(ispec=[0, 1], wavelength=[psf.wmin, psf.wmin + 1])

        y = psf.y(ispec=None, wavelength=psf.wmin)
        y = psf.y(ispec=0, wavelength=psf.wmin)
        y = psf.y(ispec=[0, 1], wavelength=psf.wmin)
        y = psf.y(ispec=[0, 1], wavelength=[psf.wmin, psf.wmin + 1])

        t = psf.invert()