Skip to content

Commit

Permalink
Merge pull request #1490 from gemini-hlsw/itc
Browse files Browse the repository at this point in the history
Support emission lines in ITC
  • Loading branch information
rpiaggio authored Nov 27, 2024
2 parents 6d63d28 + 8a2e245 commit 29ca745
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ val http4sJdkHttpClientVersion = "0.9.1"
val jwtVersion = "5.0.0"
val logbackVersion = "1.5.11"
val log4catsVersion = "2.7.0"
val lucumaCatalogVersion = "0.48.7"
val lucumaItcVersion = "0.23.0"
val lucumaCoreVersion = "0.108.0"
val lucumaCatalogVersion = "0.48.8"
val lucumaItcVersion = "0.24.0"
val lucumaCoreVersion = "0.109.0"
val lucumaGraphQLRoutesVersion = "0.8.15"
val lucumaSsoVersion = "0.6.28"
val lucumaSsoVersion = "0.6.29"
val munitVersion = "0.7.29" // check test output if you attempt to update this
val munitCatsEffectVersion = "1.0.7" // check test output if you attempt to update this
val munitDisciplineVersion = "1.0.9" // check test output if you attempt to update this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object Acquisition:
val DefaultIntegrationTime: TargetIntegrationTime =
TargetIntegrationTime(
Zipper.one(IntegrationTime(TimeSpan.fromSeconds(1).get, 1.refined, AcquisitionSN)),
Band.R // Band is meaningless here, but we need to provide one
Band.R.asLeft // Band is meaningless here, but we need to provide one
)

val MinExposureTime = 1.secondTimeSpan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import eu.timepit.refined.types.numeric.*
import lucuma.core.data.Zipper
import lucuma.core.enums.Band
import lucuma.core.math.SignalToNoise
import lucuma.core.math.Wavelength
import lucuma.core.util.TimeSpan
import lucuma.itc.AsterismIntegrationTimeOutcomes
import lucuma.itc.IntegrationTime
Expand All @@ -39,7 +40,7 @@ object TestItcClient {
exposureTime: TimeSpan,
exposureCount: Int,
signalToNoise: BigDecimal,
band: Band,
bandOrLine: Either[Band, Wavelength],
graphResult: (NonEmptyList[ItcCcd], NonEmptyList[GraphResult])
): ItcClient[F] =
withResult[F](
Expand All @@ -48,13 +49,13 @@ object TestItcClient {
PosInt.unsafeFrom(exposureCount),
SignalToNoise.unsafeFromBigDecimalExact(signalToNoise)
),
band,
bandOrLine,
graphResult
)

def withResult[F[_]: Applicative](
result: IntegrationTime,
band: Band,
bandOrLine: Either[Band, Wavelength],
graphResult: (NonEmptyList[ItcCcd], NonEmptyList[GraphResult])
): ItcClient[F] =
new ItcClient[F] {
Expand All @@ -69,7 +70,7 @@ object TestItcClient {
NonEmptyChain.fromSeq(
List.fill(input.asterism.length)(
TargetIntegrationTimeOutcome(
TargetIntegrationTime(Zipper.fromNel(NonEmptyList.one(result)), band).asRight
TargetIntegrationTime(Zipper.fromNel(NonEmptyList.one(result)), bandOrLine).asRight
)
)
).get
Expand All @@ -86,7 +87,7 @@ object TestItcClient {
NonEmptyChain.fromSeq(
List.fill(input.asterism.length)(
TargetIntegrationTimeOutcome(
TargetIntegrationTime(Zipper.of(result, result), band).asRight
TargetIntegrationTime(Zipper.of(result, result), bandOrLine).asRight
)
)
).get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import lucuma.core.data.EmailAddress
import lucuma.core.data.Zipper
import lucuma.core.enums.Band
import lucuma.core.math.SignalToNoise
import lucuma.core.math.Wavelength
import lucuma.core.model.User
import lucuma.core.syntax.timespan.*
import lucuma.core.util.Gid
Expand Down Expand Up @@ -160,8 +161,8 @@ abstract class OdbSuite(debug: Boolean = false) extends CatsEffectSuite with Tes
val FakeItcVersions: ItcVersions =
ItcVersions("foo", "bar".some)

val FakeBand: Band =
Band.B
val FakeBandOrLine: Either[Band, Wavelength] =
Band.B.asLeft

val FakeItcResult: IntegrationTime =
IntegrationTime(
Expand All @@ -187,7 +188,7 @@ abstract class OdbSuite(debug: Boolean = false) extends CatsEffectSuite with Tes
NonEmptyChain.fromSeq(
List.fill(input.asterism.length)(
TargetIntegrationTimeOutcome(
TargetIntegrationTime(Zipper.one(fakeItcImagingResult), FakeBand).asRight
TargetIntegrationTime(Zipper.one(fakeItcImagingResult), FakeBandOrLine).asRight
)
)
).get
Expand All @@ -208,7 +209,7 @@ abstract class OdbSuite(debug: Boolean = false) extends CatsEffectSuite with Tes
NonEmptyChain.fromSeq(
List.fill(input.asterism.length)(
TargetIntegrationTimeOutcome(
TargetIntegrationTime(Zipper.one(fakeItcSpectroscopyResult), FakeBand).asRight
TargetIntegrationTime(Zipper.one(fakeItcSpectroscopyResult), FakeBandOrLine).asRight
)
)
).get
Expand Down

0 comments on commit 29ca745

Please sign in to comment.