Learn R Programming

celestial (version 1.4.6)

getpixscale: Get Pixel Scale

Description

Given a FITSio of astro header, calculate the image pixel scale.

Usage

getpixscale(header, CD1_1 = 1, CD1_2 = 0, CD2_1 = 0, CD2_2 = 1)

Arguments

header

Full FITS header in table or vector format. Legal table format headers are provided by the read.fitshdr function or the hdr list output of read.fits in the astro package; the hdr output of readFITS in the FITSio package or the header output of magcutoutWCS. Missing header keywords are printed out and other header option arguments are used in these cases. See xy2radec.

CD1_1

FITS header CD1_1 for the Tan Gnomonic projection system. Change in RA-Tan in degrees along x-Axis.

CD1_2

FITS header CD1_2 for the Tan Gnomonic projection system. Change in RA-Tan in degrees along y-Axis.

CD2_1

FITS header CD2_1 for the Tan Gnomonic projection system. Change in Dec-Tan in degrees along x-Axis.

CD2_2

FITS header CD2_2 for the Tan Gnomonic projection system. Change in Dec-Tan in degrees along y-Axis.

Value

Numeric scalar; the image pixscale in asec/pixel (so typically a value of 0.1-0.5 for modern survey instruments).

Details

In most cases users will simply provide a valid header to find the WCS, but you can enter the CD values explicitly. Calculating the pixel scale from the latter is almost trivial, but the option is there for the curious/lazy.

Examples

Run this code
# NOT RUN {
#The answer should be almost exactly 0.2 asec/pixel:

#Using FITSio and ProFit packages
image = readFITS(system.file("extdata", 'KiDS/G266035fitim.fits', package="ProFit"))
getpixscale(image$hdr)
#Using astro package
image = read.fits(system.file("extdata", 'KiDS/G266035fitim.fits', package="ProFit"))
getpixscale(image$hdr[[1]])
# }

Run the code above in your browser using DataLab