Skip to content

Commit

Permalink
Fixed incorrect if conditions to check for SCIENCE frames
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstolker committed Jan 12, 2024
1 parent f05dce9 commit bf093f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pycrires/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ def run_skycalc(self, pwv: float = 3.5) -> None:

science_index = np.where(self.header_data["DPR.CATG"] == "SCIENCE")[0]

if len(science_index) > 0:
if len(science_index) == 0:
raise RuntimeError("Cannot run skycalc: there are no SCIENCE frames")

# Requested PWV for observations
Expand Down Expand Up @@ -3759,8 +3759,8 @@ def obs_nodding(
indices = self.header_data["DPR.CATG"] == "SCIENCE"
science_idx = np.where(indices)[0]

if len(science_idx) > 0:
raise RuntimeError("Cannot run obs_staring: there are no SCIENCE frames")
if len(science_idx) == 0:
raise RuntimeError("Cannot run obs_nodding: there are no SCIENCE frames")

# Wavelength setting and DIT
science_wlen = self.header_data["INS.WLEN.ID"][science_idx[0]]
Expand Down Expand Up @@ -4307,7 +4307,7 @@ def obs_nodding_irregular(

science_idx = np.where(self.header_data["DPR.CATG"] == "SCIENCE")[0]

if len(science_idx) > 0:
if len(science_idx) == 0:
raise RuntimeError("Cannot run obs_nodding_irregular: there are no SCIENCE frames")

# Wavelength setting and DIT
Expand Down

0 comments on commit bf093f6

Please sign in to comment.