include # GET_TIMES -- construct the time arrays for the task subsky. # Group keywords CRVAL1 and CD1_1 are used to construct a linear epoch array. # # input header keywords # --------------------- # "CRVAL1" time of the first pixel # "CD1_1" time span between pixels in the input data file # # Date Author Description # ---- ------ ----------- # 27-Mar-1990 J.-C. Hsu design and code #------------------------------------------------------------------------------ procedure get_times (ipin, ipsky1, ipsky2, nskyfiles, intime, skytime, npix, npsky1, npsky2) pointer ipin # input: file pointer of the input science file pointer ipsky1 # input: file pointer of the first sky file pointer ipsky2 # input: file pointer of the second sky file int nskyfiles # input: number of sky files double intime[npix] # output: input data's time array double skytime[npix] # output: input sky's time array int npix # input: number of input data points int npsky1 # input: number of first sky file data points int npsky2 # input: number of second sky file data points int i real cd1_1 # time between pixels, in seconds real imgetr() double imgetd() #============================================================================== begin # read the header keywords (group parameters) of CRVAL1 and CD1_1 # from the input files intime[1] = imgetd (ipin, "CRVAL1") cd1_1 = imgetr (ipin, "CD1_1") do i = 2, npix intime[i] = intime[1] + cd1_1 * (i-1) skytime[1] = imgetd (ipsky1, "CRVAL1") cd1_1 = imgetr (ipsky1, "CD1_1") do i = 2, npsky1 skytime[i] = skytime[1] + cd1_1 * (i-1) if (nskyfiles == 2) { skytime[npsky1+1] = imgetd (ipsky2, "CRVAL1") cd1_1 = imgetr (ipsky2, "CD1_1") do i = 2, npsky2 skytime[npsky1+i] = skytime[npsky1+1] + cd1_1 * (i-1) } end