COSMOS subroutines

Back to Table of Contents

COSMOS subroutines

Focal Plane transformation routines Other Routines

Focal Plane transformation routines

ccd8

SUMMARY:
Transforms pixel coordinates to accurate full 8-chip scale
USAGE:
ccd8( int chip, float xccd, float yccd, float* x8, float* y8)
chipchip
xccd,yccdpixel coordinate on chip
x8,y88-chip coordinates
RETURN:
0

fp2ccd

SUMMARY:
Transforms from focal plane to CCD coordinates
USAGE:
fp2ccd(float xfp, float yfp, float* xccd, float* yccd, float lambda, char cam[])
xfp, yfpfocal plane coordinates
xccd, yccdCCD coordinates
lambdawavelength
camcamera = LONG/SHORT
RETURN:
CCD chip #. 0 => position not on a CCD

Getchipdat

SUMMARY:
Returns data on chip arrangement and dewar offset
USAGE:
Getchipdat(int* nc, int* xc, int* yc, float* scale, float* theta, int* sx14, int* sy14, int* sx58, int* sy58)
ncnumber of chips
xc,ycx,y coordinates of chip corners
scalescale
thetadewar rotation angle
sx,y14x,y coordinate sign for chips 1-4
sx,y58x,y coordinate sign for chips 5-8
RETURN:
none

mspos

SUMMARY:
Transforms pixel coordinates to mosaic coordinates
USAGE:
ccd8( int chip, float xccd, float yccd, float* x8, float* y8)
chipchip
xccd,yccdpixel coordinate on chip
x8,y8mosaic coordinates
RETURN:
0

Readcdf

SUMMARY:
Reads in camera definition file. Must be called before first call to fp2ccd, Getchipdat, ccd8, or mspos.
USAGE:
Readcd(char filename[])
filenamename of camera definition file (e.g. 'SITE')
RETURN:
0if successful
1if unsuccessful

Readcof

SUMMARY:
Reads in dewar offset file. Must be called before first call to fp2ccd, Getchipdat, ccd8, or mspos
USAGE:
Readcof(char filename[])
filenamename of dewar offset file
RETURN:
0if successful
1if unsuccessful

Other Routines

interpol

SUMMARY:
Interpolates within a 2-d data array. f_interpol interpolates in a float array, i_interpol in an integer array.
USAGE:
f_interpol(float** array, long naxes[], float xpos, float ypos)
i_interpol(int** array, long naxes[], float xpos, float ypos)

naxes is an array containing axis dimensions
RETURN:
interpolated value

OpenCosParm

SUMMARY:
Opens COSMOS parameter files from COSMOS_PAR_DIR evironmental variable.
USAGE:
OpenCosParm(char* program-name)

read in parameter values with ReadParm_x
RETURN:
0if successful
1if unsuccessful

OpenFitsFile

SUMMARY:
Uses fitsio routines to open a fits file. Returns a file pointer, and a data structure with file information.
USAGE:
OpenFitsFile(char* filename, fitsfile* fileptr, fitsdef* fitsdata);

fitsdef contains the following elements:
intnaxisnumber of axes
intnaxes[n]size of each axis
intbitpixbits/pixel
intbinningbinning
intsubrstrsubraster?1=yes 0=no
intsubx[2]x subraster indices
intsuby[2]y subraster indices
intoverscannumber of overscan columns
intbiaslinsnumber of bias rows
chardewarori[2]dewar orientation Nor NS
intnshuffle# of pixels of shuffle 0 if not n&s mode
floatranodra nod, in arc sec
floatdecnoddec nod, in arc sec
RETURN:
0if successful
1if unsuccessful

ReadObsDef

SUMMARY:
Reads data from an observation definition file and returns in a data structure
USAGE:
ReadobsDef(char* obsdeffilename,obsdef* obssdata);

obsdef containes the following elements:
intgr_ordernumber of axes
intgr_anglesize of each axis
floattemptemperature
chargrating[20]grating
chardewoff[80]dewar offset filename
charcamera[6]LONG or SHORT
charmode[7]DIRECT or SPEC
charmask[80]SMF filename
chardewar[5]SITE
intnshuffle# of pixels of shuffle 0 if not n&s mode
floatranodra nod, in arc sec
floatdecnoddec nod, in arc sec
RETURN:
0if successful
1if unsuccessful

ReadParm

SUMMARY:
Reads parameter values from parameter file opened with OpenCosParm
USAGE:
ReadParm_s(char* paramname, char* paramval) for strings
ReadParm_i(char* paramname, int* paramval) for integers
Readparm_r(char* paramname, float* paramval) for reals
RETURN:
0if successful
1if unsuccessful

Back to Table of Contents