Skip to content

Commit 76d353d

Browse files
committed
add makeProcessedBPM recipe tests for F2 and NIRI
1 parent fa028ee commit 76d353d

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

geminidr/f2/recipes/sq/tests/__init__.py

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
import pytest
3+
4+
import astrodata, gemini_instruments
5+
from astrodata.testing import ad_compare, download_from_archive
6+
from recipe_system.reduction.coreReduce import Reduce
7+
8+
9+
@pytest.mark.f2
10+
@pytest.mark.dragons_remote_data
11+
def test_make_processed_bpm(path_to_refs, change_working_dir):
12+
"""
13+
Test that we can make a processed bad pixel mask (BPM) from a F2 dataset.
14+
15+
The F2 recipe includes an addDQ(), which means there'll be a query to the
16+
caldb for the static BPM. We allow this to take place and return nothing.
17+
"""
18+
with change_working_dir():
19+
darks = [download_from_archive(f"S20131121S{i:04d}.fits")
20+
for i in range(369, 376)]
21+
flats = [download_from_archive(f"S20131126SS{i:04d}.fits")
22+
for i in range(1111, 1117)] + [download_from_archive(
23+
f"S20131129S{i:04d}.fits") for i in range(320, 324)]
24+
r = Reduce()
25+
r.files.extend(flats + darks)
26+
r.recipename = "makeProcessedBPM"
27+
r.runr()
28+
29+
adout = astrodata.open(r.output_filenames[0])
30+
adref = astrodata.open(os.path.join(path_to_refs, adout.filename))
31+
32+
assert ad_compare(adref, adout)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os
2+
import pytest
3+
4+
import astrodata, gemini_instruments
5+
from astrodata.testing import ad_compare, download_from_archive
6+
from recipe_system.reduction.coreReduce import Reduce
7+
8+
9+
@pytest.mark.niri
10+
@pytest.mark.dragons_remote_data
11+
def test_make_processed_bpm(path_to_refs, change_working_dir):
12+
"""
13+
Test that we can make a processed bad pixel mask (BPM) from a NIRI dataset.
14+
"""
15+
with change_working_dir():
16+
darks = [download_from_archive(f"N20160103S{i:04d}.fits")
17+
for i in range(463, 473)]
18+
flats = [download_from_archive(f"N20160102S{i:04d}.fits")
19+
for i in range(363, 383)]
20+
r = Reduce()
21+
r.files.extend(flats + darks)
22+
r.recipename = "makeProcessedBPM"
23+
r.runr()
24+
25+
adout = astrodata.open(r.output_filenames[0])
26+
adref = astrodata.open(os.path.join(path_to_refs, adout.filename))
27+
28+
assert ad_compare(adref, adout)

0 commit comments

Comments
 (0)