Class: Wcs::WorldCoor

Inherits:
Object
  • Object
show all
Defined in:
lib/wcs/libdoc.rb

Instance Method Summary collapse

Constructor Details

#initiallize(cra, cdec, secpix, xrpix, yrpix, nxpix, nypix, rotate, equinox, proj) ⇒ WorldCoor #initialize(naxis1, naxis2, ctype1, ctype2, crpix1, crpix2, crval1, crval2, cd, cdelt1, cdelt2, crota, equinox, epoch) ⇒ WorldCoor #initialize(hstring, wcsname) ⇒ WorldCoor

set up a WCS structure from arguments

Overloads:

  • #initiallize(cra, cdec, secpix, xrpix, yrpix, nxpix, nypix, rotate, equinox, proj) ⇒ WorldCoor

    Parameters:

    • cra (Float)

      Center right ascension in degrees

    • cdec (Float)

      Center declination in degrees

    • secpix (Float)

      Number of arcseconds per pixel

    • xrpix (Float)

      Reference pixel X coordinate

    • yrpix (Float)

      Reference pixel X coordinate

    • nxpix (Integer)

      Number of pixels along x-axis

    • nypix (Integer)

      Number of pixels along y-axis

    • rotate (Float)

      Rotation angle (clockwise positive) in degrees

    • equinox (Integer)

      Equinox of coordinates, 1950 and 2000 supported

    • epoch (Float)

      Epoch of coordinates, for FK4/FK5 conversion, no effect if 0

    • proj (String)

      Projection

  • #initialize(naxis1, naxis2, ctype1, ctype2, crpix1, crpix2, crval1, crval2, cd, cdelt1, cdelt2, crota, equinox, epoch) ⇒ WorldCoor

    Parameters:

    • naxis1 (Integer)

      Number of pixels along x-axis

    • naxis2 (Integer)

      Number of pixels along y-axis

    • ctype1 (String)

      FITS WCS projection for axis 1

    • ctype2 (String)

      FITS WCS projection for axis 2

    • crpix1 (Float)

      Reference pixel coordinates

    • crpix2 (Float)

      Reference pixel coordinates

    • crval1 (Float)

      Coordinate at reference pixel in degrees

    • crval2 (Float)

      Coordinate at reference pixel in degrees

    • cd (Float)

      Rotation matrix, used if not NULL

    • cdelt1 (Float)

      scale in degrees/pixel, if cd is NULL

    • cdelt2 (Float)

      scale in degrees/pixel, if cd is NULL

    • crota (Float)

      Rotation angle in degrees, if cd is NULL

    • equinox (Integer)

      Equinox of coordinates, 1950 and 2000 supported

    • epoch (Float)

      Epoch of coordinates, for FK4/FK5 conversion

  • #initialize(hstring, wcsname) ⇒ WorldCoor

    Parameters:

    • hstring (String)

      FITS header

    • wcsname (String)

      WCS name



36
37
# File 'lib/wcs/libdoc.rb', line 36

def initialize(*args)
end

Instance Method Details

#getradecsysString

Returns name of image coordinate system.

Returns:

  • (String)

    name of image coordinate system



174
175
# File 'lib/wcs/libdoc.rb', line 174

def getradecsys
end

#getwcsinString

Return current input coordinate system

Returns:

  • (String)

    Return current input coordinate system



198
199
# File 'lib/wcs/libdoc.rb', line 198

def getwcsin
end

#getwcsoutString

Return current output coordinate system

Returns:

  • (String)

    Return current output coordinate system



186
187
# File 'lib/wcs/libdoc.rb', line 186

def getwcsout
end

#iswcsBoolean

Returns 1 if wcs structure set, else 0

Returns:

  • (Boolean)

    Returns 1 if wcs structure set, else 0



49
50
# File 'lib/wcs/libdoc.rb', line 49

def iswcs
end

#nowcsBoolean

Returns 0 if wcs structure set, else 1

Returns:

  • (Boolean)

    Returns 0 if wcs structure set, else 1



53
54
# File 'lib/wcs/libdoc.rb', line 53

def nowcs
end

#pix2wcs(xpix, ypix) ⇒ [xpos,ypos]

Convert pixel coordinates to World Coordinates

Parameters:

  • xpix (Float)

    Image horizontal coordinate in pixels

  • ypix (Float)

    Image vertical coordinate in pixels

Returns:

  • ([xpos,ypos])

    RA and Dec in degrees



70
71
72
# File 'lib/wcs/libdoc.rb', line 70

def pix2wcs(xpix,ypix)
  # This function is defined in C
end

#pix2wcst(xpix, ypix) ⇒ String

Convert pixel coordinates to World Coordinate string

Parameters:

  • xpix (Float)

    Image horizontal coordinate in pixels

  • ypix (Float)

    Image vertical coordinate in pixels

Returns:

  • (String)

    World coordinate string



61
62
63
# File 'lib/wcs/libdoc.rb', line 61

def pix2wcst(xpix,ypix)
  # This function is defined in C
end

#setwcsdeg(degout) ⇒ Integer

Set WCS coordinate output format

Parameters:

  • degout (Integer)

    1= degrees, 0= hh:mm:ss dd:mm:ss

Returns:

  • (Integer)


205
206
207
# File 'lib/wcs/libdoc.rb', line 205

def setwcsdeg(degout)
  # This function is defined in C
end

#setwcslin(mode) ⇒ Integer

Set pix2wcst() mode for LINEAR coordinates

Parameters:

  • mode (Integer)

    0: x y linear, 1: x units x units, 2: x y linear units

Returns:

  • (Integer)


242
243
# File 'lib/wcs/libdoc.rb', line 242

def setwcslin(mode)
end

#wcs2pix(xpos, ypos) ⇒ [xpix,ypix,offscl]

Convert World Coordinates to pixel coordinates

Parameters:

  • xpos (Float)

    Longitude/Right Ascension in degrees

  • ypos (Float)

    Latitude/Declination in degrees

Returns:

  • ([xpix,ypix,offscl])
    • xpix: Image horizontal coordinate in pixels

    • ypix: Image vertical coordinate in pixels

    • offscl: 0 if within bounds, else off scale



94
95
# File 'lib/wcs/libdoc.rb', line 94

def wcs2pix(xpos,ypos)
end

#wcsc2pix(xpos, ypos, coorsys) ⇒ [xpix,ypix,offscl]

Convert World Coordinates to pixel coordinates

Parameters:

  • xpos (Float)

    Longitude/Right Ascension in degrees

  • ypos (Float)

    Latitude/Declination in degrees

  • coorsys (String)

    Coordinate system (FK4, FK5, B1950, J2000, GALACTIC, ECLIPTIC)

Returns:

  • ([xpix,ypix,offscl])
    • xpix: Image horizontal coordinate in pixels

    • ypix: Image vertical coordinate in pixels

    • offscl: 0 if within bounds, else off scale



83
84
# File 'lib/wcs/libdoc.rb', line 83

def wcsc2pix(xpos,ypos,coorsys)
end

#wcscdset(cd) ⇒ nil

Set scaling and rotation from CD matrix

Parameters:

  • cd (Array)

    CD matrix, (2x2 array) ignored if NULL

Returns:

  • (nil)


149
150
151
# File 'lib/wcs/libdoc.rb', line 149

def wcscdset(cd)
  # This function is defined in C
end

#wcscentnil

Print the image center and size in WCS units

Returns:

  • (nil)


120
121
# File 'lib/wcs/libdoc.rb', line 120

def wcscent
end

#wcsdeltset(cdelt1, cdelt2, crota) ⇒ nil

set scaling, rotation from CDELTi, CROTA2

Parameters:

  • cdelt1 (Float)

    degrees/pixel in first axis (or both axes)

  • cdelt2 (Float)

    degrees/pixel in second axis if nonzero

  • crota (Float)

    Rotation counterclockwise in degrees

Returns:

  • (nil)


159
160
161
# File 'lib/wcs/libdoc.rb', line 159

def wcsdeltset(cdelt1,cdelt2,crota)
  # This function is defined in C
end

#wcseqset(equinox) ⇒ nil

Change equinox of reference pixel coordinates in WCS

Parameters:

  • equinox (Float)

    Desired equinox as fractional year

Returns:

  • (nil)


234
235
236
# File 'lib/wcs/libdoc.rb', line 234

def wcseqset(equinox)
  # This function is defined in C
end

#wcsfull[ra,dec,width,height]

Return RA and Dec of image center, size in degrees

Returns:

  • ([ra,dec,width,height])
    • ra: Right ascension of image center (deg)

    • dec: Declination of image center (deg)

    • width: Width in degrees

    • height: Height in degrees



114
115
116
# File 'lib/wcs/libdoc.rb', line 114

def wcsfull
  # This function is defined in C
end

#wcsininit(coorsys) ⇒ nil

Set input coordinate system for wcs2pix

Parameters:

  • coorsys (String)

    Coordinate system (B1950, J2000, etc)

Returns:

  • (nil)


193
194
195
# File 'lib/wcs/libdoc.rb', line 193

def wcsininit(coorsys)
  # This function is defined in C
end

#wcsndecObject

Set or get number of output decimal places

Parameters:

  • ndec (Integer)

    Number of decimal places in output string. if < 0, return current ndec unchanged



212
213
# File 'lib/wcs/libdoc.rb', line 212

def wcsndec
end

#wcsoutinit(coorsys) ⇒ nil

Set output coordinate system for pix2wcs

Parameters:

  • coorsys (String)

    Coordinate system (B1950, J2000, etc)

Returns:

  • (nil)


181
182
183
# File 'lib/wcs/libdoc.rb', line 181

def wcsoutinit(coorsys)
  # This function is defined in C
end

#wcspcset(cdelt1, cdelt2, pc) ⇒ nil

set scaling, rotation from CDELTs and PC matrix

Parameters:

  • cdelt1 (Float)

    degrees/pixel in first axis (or both axes)

  • cdelt2 (Float)

    degrees/pixel in second axis if nonzero

  • pc (Array)

    Rotation matrix, ignored if NULL

Returns:

  • (nil)


169
170
171
# File 'lib/wcs/libdoc.rb', line 169

def wcspcset(cdelt1,cdelt2,pc)
  # This function is defined in C
end

#wcsrange[ra1,ra2,dec1,dec1]

Return min and max RA and Dec of image in degrees

Returns:

  • ([ra1,ra2,dec1,dec1])
    • ra1: Min. right ascension of image (deg)

    • ra2: Max. right ascension of image (deg)

    • dec1: Min. declination of image (deg)

    • dec2: Max. declination of image (deg)



141
142
143
# File 'lib/wcs/libdoc.rb', line 141

def wcsrange
  # This function is defined in C
end

#wcsreset(crpix1, crpix2, crval1, crval2, cdelt1, cdelt2, crota, cd) ⇒ Integer

Change WCS using arguments

Parameters:

  • crpix1 (Float)

    Horizontal reference pixel

  • crpix2 (Float)

    Vertical reference pixel

  • crval1 (Float)

    Reference pixel horizontal coordinate in degrees

  • crval2 (Float)

    Reference pixel vertical coordinate in degrees

  • cdelt1 (Float)

    Horizontal scale in degrees/pixel, ignored if cd is not NULL

  • cdelt2 (Float)

    Vertical scale in degrees/pixel, ignored if cd is not NULL

  • crota (Float)

    Rotation angle in degrees, ignored if cd is not NULL

  • cd (Array)

    Rotation matrix, used if not NULL

Returns:

  • (Integer)


226
227
228
# File 'lib/wcs/libdoc.rb', line 226

def wcsreset(crpix1,crpix2,crval1,crval2,cdelt1,cdelt2,crota,cd)
  # This function is defined in C
end

#wcsshift(cra, cdec, coorsys) ⇒ nil

Change center of WCS

Parameters:

  • cra (Float)

    New center right ascension in degrees

  • cdec (Float)

    New center declination in degrees

  • coorsys (String)

    FK4 or FK5 coordinates (1950 or 2000)

Returns:

  • (nil)


103
104
105
# File 'lib/wcs/libdoc.rb', line 103

def wcsshift(cra,cdec,coorsys)
  # This function is defined in C
end

#wcssize[cra,cdec,hwra,hwdec]

Return image center and size in RA and Dec

Returns:

  • ([cra,cdec,hwra,hwdec])
    • cra: Right ascension of image center (deg)

    • cdec: Declination of image center (deg)

    • hwra: Half-width in right ascension (deg)

    • hwdec: Half-width in declination (deg)



130
131
132
# File 'lib/wcs/libdoc.rb', line 130

def wcssize
  # This function is defined in C
end

#wcstype(ctype1, ctype2) ⇒ Integer

Set projection type from header CTYPEs

Parameters:

  • ctype1 (String)

    FITS WCS projection for axis 1

  • ctype2 (String)

    FITS WCS projection for axis 2

Returns:

  • (Integer)


44
45
46
# File 'lib/wcs/libdoc.rb', line 44

def wcstype(ctype1,ctype2)
  # This function is defined in C
end

#wcszoutInteger

Return coordinate in third dimension

Returns:

  • (Integer)


248
249
250
# File 'lib/wcs/libdoc.rb', line 248

def wcszout
  # This function is defined in C
end