Exemplo n.º 1
0
    def test__get_polyfit_filename_errors(self, data__get_polyfit_filename):
        """
        Check passing an invalid calib. type throws an error
        """
        ad, tmpsubdir = data__get_polyfit_filename
        os.chdir(os.path.join(tmpsubdir.dirname, tmpsubdir.basename))
        ad.phu.set('SMPNAME', 'HI_ONLY')
        ad.phu.set('CAMERA', 'RED')
        ad.phu.set('UTSTART',
                   datetime.datetime.now().time().strftime('%H:%M:%S'))
        ad.phu.set('DATE-OBS',
                   datetime.datetime.now().date().strftime('%Y-%m-%d'))

        gs = GHOSTSpect([])
        polyfit_file = gs._get_polyfit_filename(ad, 'not-a-cal-type')
        assert polyfit_file is None, "_get_polyfit_filename didn't return " \
                                     "None when asked for a bogus " \
                                     "model type"
Exemplo n.º 2
0
    def test__get_polyfit_filename(self, arm, res, caltype,
                                   data__get_polyfit_filename):
        """
        Checks to make:

        - Provide a set of input (arm, res, ) arguments, see if a/ name is
          returned
        """
        ad, tmpsubdir = data__get_polyfit_filename
        os.chdir(os.path.join(tmpsubdir.dirname, tmpsubdir.basename))
        ad.phu.set('SMPNAME', res)
        ad.phu.set('CAMERA', arm)
        ad.phu.set('UTSTART',
                   datetime.datetime.now().time().strftime('%H:%M:%S'))
        ad.phu.set('DATE-OBS',
                   datetime.datetime.now().date().strftime('%Y-%m-%d'))

        gs = GHOSTSpect([])
        polyfit_file = gs._get_polyfit_filename(ad, caltype)

        assert polyfit_file is not None, "Could not find polyfit file"