Skip to content

Commit

Permalink
Merge pull request #786 from gemini-hlsw/parallactic-angle
Browse files Browse the repository at this point in the history
Method to calculate parallctic anglee for a given object
  • Loading branch information
cquiroz authored Aug 18, 2023
2 parents a5cd43d + 856b8de commit 897f6d4
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ extension (r: TimeRange)
def start: Long = r._1
def end: Long = r._2

// Calculate the parallactic angle for the given object at the given time.
def parallacticAngle(site: Site, tracking: ObjectTracking, vizTime: Instant): Angle = {
val skycalc = new ImprovedSkyCalc(site.place)

val c = tracking
.at(vizTime)
.map(_.value)
.getOrElse(tracking.baseCoordinates)
skycalc.calculate(c, vizTime, false).parallacticAngle
}

def averageParallacticAngle(site: Site, tracking: ObjectTracking, vizTime: Instant): Option[Angle] =
val defined: TimeRange = (vizTime.toEpochMilli(), vizTime.toEpochMilli() + 1.hour.toMillis)
val rate: Long = 30.seconds.toMillis
Expand Down

0 comments on commit 897f6d4

Please sign in to comment.