diff --git a/geminidr/core/primitives_visualize.py b/geminidr/core/primitives_visualize.py index 9c9e33935e..929b04f189 100644 --- a/geminidr/core/primitives_visualize.py +++ b/geminidr/core/primitives_visualize.py @@ -123,7 +123,8 @@ def display(self, adinputs=None, **params): threshold = None else: # addDQ operates in place so deepcopy to preserve input - ad = self.addDQ([deepcopy(ad)])[0] + ad = self.addDQ([deepcopy(ad)], + add_illum_mask=False, static_bpm = None)[0] copied = True if remove_bias: diff --git a/geminidr/core/tests/test_visualize.py b/geminidr/core/tests/test_visualize.py index b717fe69f5..8618f9f182 100644 --- a/geminidr/core/tests/test_visualize.py +++ b/geminidr/core/tests/test_visualize.py @@ -11,6 +11,7 @@ from astrodata.testing import download_from_archive from geminidr.core import primitives_visualize from geminidr.gmos.primitives_gmos_image import GMOSImage +from geminidr.gmos.primitives_gmos_longslit import GMOSLongslit single_aperture_data = [ @@ -89,6 +90,28 @@ def test_tile_arrays_does_not_raise_different_gain_warning_from_display(astrofak p.display() assert sum(["have different gains" in rec.msg for rec in caplog.records]) == 0 +def test_display_does_not_align_or_add_illum(astrofaker, caplog, monkeypatch): + ad = astrofaker.create('GMOS-N', ['IMAGE']) + ad.init_default_extensions(overscan=False) + p = GMOSLongslit([ad]) + + def mock_illum_throw(*args, **kwargs): + raise AssertionError("Method should not be called.") + + # There is error recovery around the invocation of get_process_bpm, so we + # must track its invocation via a closure instead of relying on throwing to + # fail the test. + get_bpm_called = False + def mock_get_bpm_log_throw(*args, **kwargs): + nonlocal get_bpm_called + get_bpm_called = True + raise AssertionError("Method should not be called.") + + monkeypatch.setattr(p, "addIllumMaskToDQ", mock_illum_throw) + monkeypatch.setattr(p.caldb, "get_processed_bpm", mock_get_bpm_log_throw) + + p.display() + assert not get_bpm_called def test_tile_arrays_creates_average_read_noise(astrofaker): ad = astrofaker.create('GMOS-N', ['IMAGE']) @@ -177,7 +200,6 @@ def create_inputs(): """ import glob import os - from geminidr.gmos.primitives_gmos_longslit import GMOSLongslit from gempy.utils import logutils from recipe_system.reduction.coreReduce import Reduce from recipe_system.utils.reduce_utils import normalize_ucals