Skip to content

Commit

Permalink
Bugfix multiple amplifiers keywords are now independent of the order …
Browse files Browse the repository at this point in the history
…inside the header
  • Loading branch information
AWehrhahn committed Jun 2, 2022
1 parent 5d7b00d commit 1a8a6d7
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions pyreduce/combine_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,19 @@ def combine_frames(
# section(s) of the detector to process, x_low, x_high, y_low, y_high
# head["e_xlo*"] will find all entries with * as a wildcard
# we also ensure that we will have one dimensional arrays (not just the value)
x_low = [c[1] for c in head["e_xlo*"].cards]
x_high = [c[1] for c in head["e_xhi*"].cards]
y_low = [c[1] for c in head["e_ylo*"].cards]
y_high = [c[1] for c in head["e_yhi*"].cards]

gain = [c[1] for c in head["e_gain*"].cards]
readnoise = [c[1] for c in head["e_readn*"].cards]
cards = sorted(head["e_xlo*"].cards, key=lambda c: c[0])
x_low = [c[1] for c in cards]
cards = sorted(head["e_xhi*"].cards, key=lambda c: c[0])
x_high = [c[1] for c in cards]
cards = sorted(head["e_ylo*"].cards, key=lambda c: c[0])
y_low = [c[1] for c in cards]
cards = sorted(head["e_yhi*"].cards, key=lambda c: c[0])
y_high = [c[1] for c in cards]

cards = sorted(head["e_gain*"].cards, key=lambda c: c[0])
gain = [c[1] for c in cards]
cards = sorted(head["e_readn*"].cards, key=lambda c: c[0])
readnoise = [c[1] for c in cards]
total_exposure_time = sum(h.get("exptime", 0) for h in heads)

# Scaling for image data
Expand Down

0 comments on commit 1a8a6d7

Please sign in to comment.