pub struct ObservatoryContext<'a> { /* private fields */ }Implementations§
Source§impl<'a> ObservatoryContext<'a>
impl<'a> ObservatoryContext<'a>
pub fn new(ut1: &'a UT1, tt: &'a TT, location: &'a Location) -> Self
Sourcepub fn observatory_location(observatory_name: &str) -> TimeResult<Location>
pub fn observatory_location(observatory_name: &str) -> TimeResult<Location>
Get location for a famous observatory
Provides quick access to well-known observatory locations.
Returns an owned Location that can be used with new().
§Supported Observatories
"mauna_kea"- Mauna Kea Observatory, Hawaii"greenwich"- Royal Observatory Greenwich, UK"palomar"- Palomar Observatory, California"vlt"- Very Large Telescope, Chile"keck"- W. M. Keck Observatory, Hawaii
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = ObservatoryContext::observatory_location("mauna_kea").unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);Sourcepub fn gmst(&self) -> TimeResult<GMST>
pub fn gmst(&self) -> TimeResult<GMST>
Calculate Greenwich Mean Sidereal Time (GMST)
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
let gmst = observatory.gmst().unwrap();Sourcepub fn gast(&self) -> TimeResult<GAST>
pub fn gast(&self) -> TimeResult<GAST>
Calculate Greenwich Apparent Sidereal Time (GAST)
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
let gast = observatory.gast().unwrap();Sourcepub fn lmst(&self) -> TimeResult<LMST>
pub fn lmst(&self) -> TimeResult<LMST>
Calculate Local Mean Sidereal Time (LMST)
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
let lmst = observatory.lmst().unwrap();Sourcepub fn last(&self) -> TimeResult<LAST>
pub fn last(&self) -> TimeResult<LAST>
Calculate Local Apparent Sidereal Time (LAST)
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
let last = observatory.last().unwrap();Sourcepub fn all_sidereal_times(&self) -> TimeResult<(GMST, GAST, LMST, LAST)>
pub fn all_sidereal_times(&self) -> TimeResult<(GMST, GAST, LMST, LAST)>
Get all sidereal times at once
Returns a tuple of (GMST, GAST, LMST, LAST) for convenience.
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
let (gmst, gast, lmst, last) = observatory.all_sidereal_times().unwrap();Sourcepub fn hour_angle_to_target(&self, target_ra_hours: f64) -> TimeResult<f64>
pub fn hour_angle_to_target(&self, target_ra_hours: f64) -> TimeResult<f64>
Calculate hour angle to a target right ascension
Uses Local Apparent Sidereal Time for the most accurate hour angle calculation.
§Arguments
target_ra_hours- Target right ascension in hours
§Returns
Hour angle in hours, normalized to [-12, 12) range
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
let hour_angle = observatory.hour_angle_to_target(6.0).unwrap(); // RA = 6hSourcepub fn info(&self) -> String
pub fn info(&self) -> String
Get observatory information as a formatted string
Useful for logging and debugging.
§Examples
use celestial_time::{UT1, TT};
use celestial_time::sidereal::ObservatoryContext;
use celestial_core::Location;
let ut1 = UT1::j2000();
let tt = TT::j2000();
let location = Location::from_degrees(19.8283, -155.4783, 4145.0).unwrap();
let observatory = ObservatoryContext::new(&ut1, &tt, &location);
println!("{}", observatory.info());Trait Implementations§
Source§impl<'a> Clone for ObservatoryContext<'a>
impl<'a> Clone for ObservatoryContext<'a>
Source§fn clone(&self) -> ObservatoryContext<'a>
fn clone(&self) -> ObservatoryContext<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ObservatoryContext<'a>
impl<'a> Debug for ObservatoryContext<'a>
Source§impl<'a> Display for ObservatoryContext<'a>
impl<'a> Display for ObservatoryContext<'a>
impl<'a> Copy for ObservatoryContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for ObservatoryContext<'a>
impl<'a> RefUnwindSafe for ObservatoryContext<'a>
impl<'a> Send for ObservatoryContext<'a>
impl<'a> Sync for ObservatoryContext<'a>
impl<'a> Unpin for ObservatoryContext<'a>
impl<'a> UnwindSafe for ObservatoryContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more