Struct wcs::WCS

source ·
pub struct WCS { /* private fields */ }

Implementations§

source§

impl WCS

Main object structure descripting a WCS object Once created, the user can proceed two operation on it

  • The projection of a (lon, lat) tuple onto the image space. Results are given in pixels
  • The unprojection of a (x, y) tuple given in pixel coordinates onto the sphere. Results are given as a (lon, lat) tuple expressed in degrees
source

pub fn new(header: &Header<Image>) -> Result<Self, Error>

Create a WCS from a specific fits header parsed with fitsrs

Param
  • header: Header unit coming from fitsrs. This contains all the cards of one HDU.
source

pub fn img_dimensions(&self) -> (u64, u64)

Returns the dimensions of the image given by the NAXIS1 x NAXIS2 keyword

source

pub fn field_of_view(&self) -> (f64, f64)

source

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

Project a (lon, lat) 3D sphere position to get its corresponding location on the image The result is given a (X, Y) tuple expressed in pixel coordinates.

Param
  • lonlat: the 3D sphere vertex expressed as a (lon, lat) tuple given in degrees
source

pub fn unproj(&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 given a (lon, lat) tuple expressed in degrees.

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

Methods from Deref<Target = WCSProj>§

source

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

Project a (lon, lat) 3D sphere position to get its corresponding location on the image The result is given a (X, Y) tuple expressed in pixel coordinates.

Param
  • lonlat: the 3D sphere vertex expressed as a (lon, lat) tuple given in degrees
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 given a (lon, lat) tuple expressed in degrees.

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

Trait Implementations§

source§

impl Deref for WCS

§

type Target = WCSProj

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl RefUnwindSafe for WCS

§

impl Send for WCS

§

impl Sync for WCS

§

impl Unpin for WCS

§

impl UnwindSafe for WCS

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.