Exemplo n.º 1
0
    def test_caching_lc(self):
        with fitsio.FITS(self.fits_filename) as infile:
            lc = infile['flux'][0:1, :].ravel()

        store = DataStore.from_filename(self.fits_filename)
        store.get('flux', aperture=0)
        assert np.all(store._cache[('flux', 0)] == lc)
Exemplo n.º 2
0
    def test_caching_array(self):
        with fitsio.FITS(self.fits_filename) as infile:
            flux = infile['flux'].read()

        store = DataStore.from_filename(self.fits_filename)
        store.get('flux')
        assert np.all(store._cache[('flux', None)] == flux)
Exemplo n.º 3
0
 def test_get_and_bin(self):
     store = DataStore.from_filename(self.fits_filename)
     with mock.patch.object(store, 'get') as mock_get:
         mock_get.return_value = np.array([1, 1, 2, 2])
         value = store.get_and_bin('not used', npts=2, aperture=0)
     assert np.all(value[0] == np.array([1, 2]))
Exemplo n.º 4
0
 def test_get_timeseries(self):
     store = DataStore.from_filename(self.fits_filename)
     assert len(store.get('flux', aperture=0).shape) == 1
Exemplo n.º 5
0
 def test_get_array(self):
     store = DataStore.from_filename(self.fits_filename)
     assert len(store.get('flux').shape) == 2