示例#1
0
 def test__interp_spect_invalid_type(self, data__interp_spect):
     wavl, data, new_wavl = data__interp_spect
     gs = GHOSTSpect([])
     with pytest.raises(NotImplementedError):
         new_data = gs._interp_spect(data,
                                     wavl,
                                     new_wavl,
                                     interp='no-such-method')
示例#2
0
    def test__interp_spect(self, interp, data__interp_spect):
        """
        Checks to make:

        - New wavelength array appears in output
        - Any point in output can be interpolated from surrounding points in
          input
        - Verify allowed values for kwarg 'interp'
        """
        wavl, data, new_wavl = data__interp_spect

        gs = GHOSTSpect([])
        new_data = gs._interp_spect(data, wavl, new_wavl, interp='linear')

        assert new_data.shape == new_wavl.shape, "Data was not successfully " \
                                                 "reshaped to the new " \
                                                 "wavelength scale " \
                                                 "(expected {}, " \
                                                 "have {})".format(
            new_wavl.shape, new_data.shape,
        )