Skip to content

Commit

Permalink
Merge pull request #4171 from gemini-hlsw/separate-binning
Browse files Browse the repository at this point in the history
Separate X and Y binning
  • Loading branch information
rpiaggio authored Sep 26, 2024
2 parents 12dd435 + 87c141d commit 0553a80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
6 changes: 4 additions & 2 deletions common/src/main/scala/explore/model/reusability.scala
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ object reusability:
x.filter,
x.fpu,
x.centralWavelength,
(x.explicitXBin, x.explicitYBin).tupled,
x.explicitXBin,
x.explicitYBin,
x.explicitAmpReadMode.getOrElse(x.defaultAmpReadMode),
x.explicitAmpGain.getOrElse(x.defaultAmpGain),
x.explicitRoi.getOrElse(x.defaultRoi),
Expand All @@ -162,7 +163,8 @@ object reusability:
x.filter,
x.fpu,
x.centralWavelength,
(x.explicitXBin, x.explicitYBin).tupled,
x.explicitXBin,
x.explicitYBin,
x.explicitAmpReadMode.getOrElse(x.defaultAmpReadMode),
x.explicitAmpGain.getOrElse(x.defaultAmpGain),
x.explicitRoi.getOrElse(x.defaultRoi),
Expand Down
32 changes: 16 additions & 16 deletions model/shared/src/main/scala/explore/model/Observation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ case class Observation(
_,
_,
_,
explicitXBin,
explicitXBinning,
_,
explicitYBin,
explicitYBinning,
defaultAmpReadMode,
explicitAmpReadMode,
defaultAmpGain,
Expand All @@ -121,14 +121,14 @@ case class Observation(
_
) =>
profiles(targets).map: ps =>
val (xBinning, yBinning): (GmosXBinning, GmosYBinning) =
(explicitXBin, explicitYBin).tupled.getOrElse:
if (fpu.isIFU) (GmosXBinning.One, GmosYBinning.One)
else asterismBinning(ps.map(northBinning(fpu, _, constraints.imageQuality, grating)))
val (defaultXBinning, defaultYBinning) =
if (fpu.isIFU) (GmosXBinning.One, GmosYBinning.One)
else asterismBinning(ps.map(northBinning(fpu, _, constraints.imageQuality, grating)))

GmosSpectroscopyOverrides(
GmosCcdMode(
xBinning,
yBinning,
explicitXBinning.getOrElse(defaultXBinning),
explicitYBinning.getOrElse(defaultYBinning),
GmosAmpCount.Twelve,
explicitAmpGain.getOrElse(defaultAmpGain),
explicitAmpReadMode.getOrElse(defaultAmpReadMode)
Expand All @@ -145,9 +145,9 @@ case class Observation(
_,
_,
_,
explicitXBin,
explicitXBinning,
_,
explicitYBin,
explicitYBinning,
defaultAmpReadMode,
explicitAmpReadMode,
defaultAmpGain,
Expand All @@ -160,14 +160,14 @@ case class Observation(
_
) =>
profiles(targets).map: ps =>
val (xBinning, yBinning): (GmosXBinning, GmosYBinning) =
(explicitXBin, explicitYBin).tupled.getOrElse:
if (fpu.isIFU) (GmosXBinning.One, GmosYBinning.One)
else asterismBinning(ps.map(southBinning(fpu, _, constraints.imageQuality, grating)))
val (defaultXBinning, defaultYBinning) =
if (fpu.isIFU) (GmosXBinning.One, GmosYBinning.One)
else asterismBinning(ps.map(southBinning(fpu, _, constraints.imageQuality, grating)))

GmosSpectroscopyOverrides(
GmosCcdMode(
xBinning,
yBinning,
explicitXBinning.getOrElse(defaultXBinning),
explicitYBinning.getOrElse(defaultYBinning),
GmosAmpCount.Twelve,
explicitAmpGain.getOrElse(defaultAmpGain),
explicitAmpReadMode.getOrElse(defaultAmpReadMode)
Expand Down

0 comments on commit 0553a80

Please sign in to comment.