Skip to content

Commit

Permalink
Started adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dallas committed Jan 8, 2025
1 parent 002a4fb commit ee1045c
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions tests/test_ocrreject_exam.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,23 @@ class TestOcrrejectExam(BaseSTIS):
input_loc = 'ocrreject_exam'
ref_loc = 'ocrreject_exam/ref'

input_list = ["o58i01q7q_flt.fits", "o58i01q8q_flt.fits"]
input_list = ["odvkl1040_flt.fits", "odvkl1040_sx1.fits"]

# Make input file string
input_file_string = ", ".join(input_list)

def test_ocrrject_lev2(self):
def test_ocrrject_exam(self):
"""
This regression test for this level of this task is different than
level three in two ways. Two parameters are set to give an initial
guess to the sky value and define a sky subraction method. It also
removes cosmic rays from 14 STIS/CCD images and creates a single
'clean' image which is compared to a reference file using 'FITSDIFF'.
This regression test runs the task on the known problematic dataset odvkl1040.
The resulting output dictionary is compared to a
reference file using 'FITSDIFF'. COULD I JUST PULL OUT THE KEY/VAL PAIRS AND CHECK IF THEY'RE SIMILAR?
"""

# Prepare input files.
for filename in self.input_list:
self.get_input_file("input", filename)

# Run ocrreject
ocrreject(self.input_file_string, output="ocrreject_lev2_crj.fits",
initgues="med", skysub="mode")

# Compare results
outputs = [("ocrreject_lev2_crj.fits", "ocrreject_lev2_crj_ref.fits")]
self.compare_outputs(outputs)

def test_ocrrject_lev3(self):
"""
This regression test for this level on this task is a simple default
parameter execution of the task. It attempts to remove cosmic rays
from 14 STIS/CCD images. The resulting calibration is compared to a
reference file using 'FITSDIFF'.
"""

# Prepare input files.
for filename in self.input_list:
self.get_input_file("input", filename)

# Run ocrreject
# Run ocrreject_exam
ocrreject(self.input_file_string, output="ocrreject_lev3_crj.fits")

# Compare results
Expand Down

0 comments on commit ee1045c

Please sign in to comment.