From f1f7ec90064ed176a5136c5f6275cf3584e0e2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Piaggio?= Date: Wed, 25 Sep 2024 15:52:24 -0300 Subject: [PATCH 1/2] separate reusability --- common/src/main/scala/explore/model/reusability.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/main/scala/explore/model/reusability.scala b/common/src/main/scala/explore/model/reusability.scala index 87dcf44990..523d66c1bb 100644 --- a/common/src/main/scala/explore/model/reusability.scala +++ b/common/src/main/scala/explore/model/reusability.scala @@ -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), @@ -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), From 87c141daa5dd9bd02f448b8456721b7201b575ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Piaggio?= Date: Wed, 25 Sep 2024 19:23:42 -0300 Subject: [PATCH 2/2] separate X and Y binning --- .../scala/explore/model/Observation.scala | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/model/shared/src/main/scala/explore/model/Observation.scala b/model/shared/src/main/scala/explore/model/Observation.scala index 5063178e61..0449beb737 100644 --- a/model/shared/src/main/scala/explore/model/Observation.scala +++ b/model/shared/src/main/scala/explore/model/Observation.scala @@ -106,9 +106,9 @@ case class Observation( _, _, _, - explicitXBin, + explicitXBinning, _, - explicitYBin, + explicitYBinning, defaultAmpReadMode, explicitAmpReadMode, defaultAmpGain, @@ -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) @@ -145,9 +145,9 @@ case class Observation( _, _, _, - explicitXBin, + explicitXBinning, _, - explicitYBin, + explicitYBinning, defaultAmpReadMode, explicitAmpReadMode, defaultAmpGain, @@ -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)