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

lucuma.itc.client.json.SpectralDefinitionJson.scala Maven / Gradle / Ivy

There is a newer version: 0.23.0
Show newest version
// 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.client.json

import io.circe.Encoder
import io.circe.Json
import io.circe.syntax.*
import lucuma.core.model.SpectralDefinition

given [T]: Encoder[SpectralDefinition[T]] = {
  case bn @ SpectralDefinition.BandNormalized(_, _) =>
    Json.obj("bandNormalized" -> bn.asJson)

  case el @ SpectralDefinition.EmissionLines(_, _) =>
    Json.obj("emissionLines" -> el.asJson)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy