Struct WCSProj

Source
pub struct WCSProj { /* private fields */ }

Implementations§

Source§

impl WCSProj

Source

pub fn new(naxis1: i64, naxis2: i64, params: &WCSParams) -> Result<Self, Error>

Create a WCS from a specific fits header parsed with fitsrs

§Param
  • naxis1 - Size of the image in its first dimension (in pixels)
  • naxis2 - Size of the image in its second dimension (in pixels)
  • params - Header unit coming from fitsrs. This contains all the cards of one HDU.
Source

pub fn proj_lonlat(&self, lonlat: &LonLat) -> Option<ImgXY>

Project a (lon, lat) given in ICRS frame to get its corresponding location on the image

The result is given a (X, Y) tuple expressed in pixel coordinates.

§Arguments
  • lonlat: a coo expressed as (lon, lat) tuple given in degrees and in ICRS system
Source

pub fn proj_xyz(&self, xyz: &(f64, f64, f64)) -> Option<ImgXY>

Source

pub fn unproj_xyz(&self, img_pos: &ImgXY) -> Option<XYZ>

Source

pub fn unproj_lonlat(&self, img_pos: &ImgXY) -> Option<LonLat>

Unproject a (X, Y) point from the image space to get its corresponding location on the sphere

The result is (lon, lat) tuple expressed in degrees in ICRS

§Arguments
  • img_pos: the image space point expressed as a (X, Y) tuple given en pixels
Source

pub fn coo_system(&self) -> &CooSystem

Getter of the coordinate system

Trait Implementations§

Source§

impl Debug for WCSProj

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.