diff --git a/lcviz/tests/test_parser.py b/lcviz/tests/test_parser.py index 4bac62dc..190b4480 100644 --- a/lcviz/tests/test_parser.py +++ b/lcviz/tests/test_parser.py @@ -3,7 +3,7 @@ from glue.core.roi import XRangeROI, YRangeROI from astropy.time import Time from astropy.utils.data import download_file -from lightkurve import LightCurve, search_targetpixelfile +from lightkurve import LightCurve, KeplerTargetPixelFile, search_targetpixelfile from lightkurve.io import kepler import astropy.units as u @@ -58,6 +58,7 @@ def test_kepler_tpf_via_lightkurve(helper): quarter=10).download() helper.load_data(tpf) assert helper.get_data().shape == (4447, 4, 6) # (time, x, y) + assert helper.app.data_collection[0].get_object(cls=KeplerTargetPixelFile).shape == (4447, 4, 6) def test_synthetic_lc(helper): diff --git a/lcviz/utils.py b/lcviz/utils.py index c6344a60..a61dc1d9 100644 --- a/lcviz/utils.py +++ b/lcviz/utils.py @@ -1,6 +1,7 @@ from glue.config import data_translator from glue.core import Data, Subset from ipyvue import watch +import warnings import os from glue.core.coordinates import Coordinates @@ -438,7 +439,10 @@ def to_object(self, data_or_subset): values = values.value setattr(tpf_factory, attr, values) - tpf = tpf_factory.get_tpf() + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', + message='Could not detect filetype as TESSTargetPixelFile or KeplerTargetPixelFile, returning generic TargetPixelFile instead.') # noqa + tpf = tpf_factory.get_tpf() for attr in self.meta_attrs: # if this attribute exists and can be set: