All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lucuma.itc.search.TargetData.scala Maven / Gradle / Ivy

// Copyright (c) 2016-2023 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package lucuma.itc.search

import cats.Hash
import cats.derived.*
import lucuma.core.enums.Band
import lucuma.core.math.Redshift
import lucuma.core.math.Wavelength
import lucuma.core.model.SourceProfile
import lucuma.itc.search.hashes.given

case class TargetData(
  sourceProfile: SourceProfile,
  redshift:      Redshift
) derives Hash:
  def bandFor(wavelength: Wavelength): Band =
    sourceProfile
      .nearestBand(wavelength)
      .map(_._1)
      .getOrElse(throw new RuntimeException("No brightness measures provided for target."))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy