VIRCAM Pipeline 2.3.12
Functions
casu_wcsutils

These are support routines used for defining and manipulating image and table world coordinate system information. More...

Functions

void casu_xytoradec (cpl_wcs *wcs, double x, double y, double *ra, double *dec)
 
void casu_radectoxy (cpl_wcs *wcs, double ra, double dec, double *x, double *y)
 
void casu_xytoxy_list (cpl_wcs *wcs1, cpl_wcs *wcs2, int nc, double *x_1, double *y_1, double *x_2, double *y_2)
 
void casu_radectoxieta (cpl_wcs *wcs, double ra, double dec, double *xi, double *eta)
 
int casu_coverage (cpl_propertylist *plist, int fudge, double *ra1, double *ra2, double *dec1, double *dec2, int *status)
 
int casu_crpixshift (cpl_propertylist *p, double scalefac, double sh[])
 
int casu_rescalecd (cpl_propertylist *p, double scalefac)
 
int casu_diffxywcs (cpl_wcs *wcs, cpl_wcs *wcsref, float *xoff, float *yoff, int *status)
 
int casu_removewcs (cpl_propertylist *p, int *status)
 
int casu_tabwcs (cpl_propertylist *p, int xcol, int ycol, int *status)
 

Detailed Description

These are support routines used for defining and manipulating image and table world coordinate system information.

Author
Jim Lewis, CASU

Function Documentation

◆ casu_coverage()

int casu_coverage ( cpl_propertylist *  plist,
int  fudge,
double *  ra1,
double *  ra2,
double *  dec1,
double *  dec2,
int *  status 
)
Name:
casu_coverage
Purpose:
Get coverage in ra,dec of a frame
Description:
Given a property list (presumably from an input FITS image) this routine works out the min and max equatorial coordinates covered by the image.
Language:
C
Parameters
plistInput property list
fudgePercentage fudge factor
ra1Lower RA
ra2Upper RA
dec1Lower Dec
dec2Upper Dec
statusStandard input and output casu status variable
Returns
Standard casu status variable
Author
Jim Lewis, CASU

Definition at line 345 of file casu_wcsutils.c.

References casu_xytoradec().

Referenced by casu_getstds(), and casu_imstack().

◆ casu_crpixshift()

int casu_crpixshift ( cpl_propertylist *  p,
double  scalefac,
double  sh[] 
)
Name:
casu_crpixshift
Purpose:
Shift and scale the values of CRPIXn in a header
Description:
The values of CRPIXn are rescaled by a given factor and offset by a given value for each axis. This will fail for anything other than 2d images. This routine is useful for output images that have been resampled and shifted. The axes will be transformed in the following way: crpixnew[i] = (crpixold[i] - sh[i])/scalefac - 1.0;
Language:
C
Parameters
pThe property list defining the header for the file. This must have a valid FITS WCS.
scalefacThe scaling factor for both axes.
shThe shift for both axes
Returns
Standard casu status variable
Author
Jim Lewis, CASU

Definition at line 464 of file casu_wcsutils.c.

Referenced by vircam_interleave().

◆ casu_diffxywcs()

int casu_diffxywcs ( cpl_wcs *  wcs,
cpl_wcs *  wcsref,
float *  xoff,
float *  yoff,
int *  status 
)
Name:
casu_diffxywcs
Purpose:
Work out the cartesian offsets between two images using their WCSs
Description:
The wcs of two images is used to define the cartesian offsets between them. The sense of the offset is that xoff = xprog - xref.
Language:
C
Parameters
wcsThe wcs structure of the programme image
wcsrefThe wcs structure of the reference image
xoffThe X offset
yoffThe Y offset
statusStandard input and output casu status variable
Returns
Standard casu status variable
Author
Jim Lewis, CASU

Definition at line 650 of file casu_wcsutils.c.

References casu_radectoxy(), and casu_xytoradec().

Referenced by vircam_jmp_dither_offsets().

◆ casu_radectoxieta()

void casu_radectoxieta ( cpl_wcs *  wcs,
double  ra,
double  dec,
double *  xi,
double *  eta 
)
Name:
casu_radectoxieta
Purpose:
Convert ra,dec --> xi,eta
Description:
A WCS structure is used to convert input equatorial coordinates to standard coordinates
Language:
C
Parameters
wcsInput WCS structure
raInput RA
decInput Dec
xiOutput xi in radians
etaOutput eta in radians
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 281 of file casu_wcsutils.c.

Referenced by casu_platesol().

◆ casu_radectoxy()

void casu_radectoxy ( cpl_wcs *  wcs,
double  ra,
double  dec,
double *  x,
double *  y 
)
Name:
casu_radectoxy
Purpose:
Convert ra,dec --> x,y
Description:
A WCS structure is used to convert input equatorial coordinates to x,y.
Language:
C
Parameters
wcsInput WCS structure
raInput RA
decInput Dec
xOutput X
yOutput Y
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 151 of file casu_wcsutils.c.

Referenced by casu_diffxywcs(), casu_getstds(), and vircam_jmp_interleave().

◆ casu_removewcs()

int casu_removewcs ( cpl_propertylist *  p,
int *  status 
)
Name:
casu_removewcs
Purpose:
Remove FITS image WCS keywords from a propertylist
Description:
Remove FITS WCS keywords from a propertylist. This is sometimes necessary if a FITS table header has been based on an image header.
Language:
C
Parameters
pThe input propertylist
statusStandard input and output casu status variable
Returns
Standard casu status variable
Author
Jim Lewis, CASU

Definition at line 713 of file casu_wcsutils.c.

Referenced by casu_tabwcs(), vircam_jmp_save_catalogue(), and vircam_jmp_save_illum().

◆ casu_rescalecd()

int casu_rescalecd ( cpl_propertylist *  p,
double  scalefac 
)
Name:
casu_rescalecd
Purpose:
Scale the values of the CD matrix
Description:
The values of CDi_j are rescaled by a given amount each. The elements will each be multiplied by the same given scale factor. This routine is useful for output images that have been resampled.
Language:
C
Parameters
pThe property list defining the header for the file. This must have a valid FITS WCS.
scalefacThe scaling factor for both axes.
Returns
Standard casu status variable
Author
Jim Lewis, CASU

Definition at line 554 of file casu_wcsutils.c.

Referenced by vircam_interleave().

◆ casu_tabwcs()

int casu_tabwcs ( cpl_propertylist *  p,
int  xcol,
int  ycol,
int *  status 
)
Name:
casu_tabwcs
Purpose:
Remove FITS image WCS keywords from a propertylist and replace with tabular keywords
Description:
Replace the FITS image WCS keywords in a propertylist with the relevant table FITS keyword. This is not very general
Language:
C
Parameters
pThe input propertylist
xcolThe column number for the X position
ycolThe column number for the Y position
statusStandard input and output casu status variable
Returns
Standard casu status variable
Author
Jim Lewis, CASU

Definition at line 761 of file casu_wcsutils.c.

References casu_removewcs(), and casu_rename_property().

Referenced by imcore_conf().

◆ casu_xytoradec()

void casu_xytoradec ( cpl_wcs *  wcs,
double  x,
double  y,
double *  ra,
double *  dec 
)
Name:
casu_xytoradec
Purpose:
Convert x,y -> ra,dec
Description:
A WCS structure is used to convert input x,y coordinates to equatorial coordinates.
Language:
C
Parameters
wcsInput WCS structure
xInput X
yInput Y
raOutput RA
decOutput Dec
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 93 of file casu_wcsutils.c.

Referenced by casu_coverage(), casu_diffxywcs(), casu_platesol(), vircam_jmp_interleave(), and vircam_jmp_wcsfit().

◆ casu_xytoxy_list()

void casu_xytoxy_list ( cpl_wcs *  wcs1,
cpl_wcs *  wcs2,
int  nc,
double *  x_1,
double *  y_1,
double *  x_2,
double *  y_2 
)
Name:
casu_xytoxy_list
Purpose:
Convert x,y on one frame to x,y on another
Description:
The WCS structures of two images is used to convert a list of x,y positions on one image to the frame of reference of the other
Language:
C
Parameters
wcs1Input WCS structure for the first image
wcs2Input WCS structure for the second image
ncThe number of input coordinates
x_1Input X coordinate list
y_1Input Y coordinate list
x_2The output X coordinate list
y_2The output Y coordinate list
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 212 of file casu_wcsutils.c.

Referenced by casu_pawsky_minus(), and vircam_grout().