Expand description
A struct containing a Right Ascension and Declination. All units are in radians.
Fields
ra: f64
Right ascension [radians]
dec: f64
Declination [radians]
Implementations
sourceimpl RADec
impl RADec
sourcepub fn new_degrees(ra_deg: f64, dec_deg: f64) -> RADec
pub fn new_degrees(ra_deg: f64, dec_deg: f64) -> RADec
Make a new RADec struct from values in degrees.
sourcepub fn from_hadec(hadec: HADec, lst_rad: f64) -> Self
pub fn from_hadec(hadec: HADec, lst_rad: f64) -> Self
sourcepub fn weighted_average(radecs: &[Self], weights: &[f64]) -> Option<Self>
pub fn weighted_average(radecs: &[Self], weights: &[f64]) -> Option<Self>
From a collection of RADec coordinates and weights, find the average RADec position. The lengths of both collection must be the same to get sensible results. Not providing any RADec coordinates will make this function return None.
This function accounts for Right Ascension coordinates that range over 360 degrees.
sourcepub fn separation(&self, b: Self) -> f64
pub fn separation(&self, b: Self) -> f64
Calculate the distance between two sets of coordinates [radians].
Uses ERFA.
sourcepub fn from_mwalib_phase_center(context: &MetafitsContext) -> Option<RADec>
pub fn from_mwalib_phase_center(context: &MetafitsContext) -> Option<RADec>
Given an mwalib::MetafitsContext
, make an Option(ra|dec)_phase_center_degrees
if these are available, otherwise
None.
sourcepub fn from_mwalib_tile_pointing(context: &MetafitsContext) -> RADec
pub fn from_mwalib_tile_pointing(context: &MetafitsContext) -> RADec
Given an mwalib::MetafitsContext
, make a RADec from the
(ra|dec)_tile_pointing_degrees
.
sourcepub fn from_mwalib_phase_or_pointing(context: &MetafitsContext) -> RADec
pub fn from_mwalib_phase_or_pointing(context: &MetafitsContext) -> RADec
Given an mwalib::MetafitsContext
, make a RADec from the
(ra|dec)_phase_center_degrees
if these are available, otherwise use
the (ra|dec)_tile_pointing_degrees
.
Trait Implementations
impl Copy for RADec
impl StructuralPartialEq for RADec
Auto Trait Implementations
impl RefUnwindSafe for RADec
impl Send for RADec
impl Sync for RADec
impl Unpin for RADec
impl UnwindSafe for RADec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more