diff --git a/glue_astronomy/translators/tests/test_trace.py b/glue_astronomy/translators/tests/test_trace.py index 7bd69af..00e42f4 100644 --- a/glue_astronomy/translators/tests/test_trace.py +++ b/glue_astronomy/translators/tests/test_trace.py @@ -1,5 +1,4 @@ import numpy as np -import pytest from specreduce import tracing from specreduce.utils.synth_data import make_2dspec_image @@ -14,8 +13,8 @@ def test_trace(): data_collection = DataCollection() - data_collection['trace'] = trace - data = data_collection['trace'] + data_collection['dc_trace'] = trace + data = data_collection['dc_trace'] assert isinstance(data, Data) assert np.all(data['trace'] == trace.trace) @@ -28,8 +27,3 @@ def test_trace(): trace_from_data = data.get_object() assert isinstance(trace_from_data, tracing.ArrayTrace) assert np.all(trace_from_data.trace == new_trace) - - # error raised if the x changes - data.update_components({data.get_component('x'): np.ones_like(trace.trace)}) - with pytest.raises(ValueError): - trace_from_data = data.get_object() diff --git a/glue_astronomy/translators/trace.py b/glue_astronomy/translators/trace.py index 6baaa1f..c9ac626 100644 --- a/glue_astronomy/translators/trace.py +++ b/glue_astronomy/translators/trace.py @@ -18,7 +18,7 @@ def to_data(self, obj): obj : `specreduce.tracing.Trace` The Trace object to convert """ - data = Data(x=obj.image[0], trace=obj.trace) + data = Data(trace=obj.trace) if hasattr(obj, 'meta'): data.meta.update(obj.meta) data.meta['Trace'] = obj @@ -42,11 +42,6 @@ def to_object(self, data, attribute=None): raise TypeError("data is not of a valid specreduce Trace object") trace = data.meta['Trace'] - trace_x = np.asarray(trace.image[0]) - # NOTE: glue does not allow changing the shape of data components, so we can assume - # these arrays are still the appropriate length - if not np.all(trace_x == data['x']): - raise ValueError("x-values have changed") if not np.all(trace.trace[1] == data['trace']): trace = ArrayTrace(trace.image, data['trace'])