# COADD -- Perform synchronous co-addition for time series data. # # Module Number: 10.3.6.2 # # Module Name: H Synchronous Co-addition # # Keyphrase: # ---------- # Perform synchronous co-addition for HSP time series # # Description: # ------------ # HSP observations are collected into bins based on user-specified values # for the period of variability, the epoch date, and the width of the bins. # The data are expected in order of increasing fractional phase, i.e., # it is required that the data have been so ordered by the task ORDERPHASE. # Synchronous co-addition is effected by calculating the average value of the # data contained in each fractional phase interval. # # Data masks associated with the input time series are accommodated, and a # corresponding data mask will be available for the output data in which # fractional phase is the independent parameter. # # Usage Note: # ----------- # Before employing this procedure, it may be necessary to correct the input # time series for the effect of the light delay time. This is accomplished # through the use of the task DELAYTIME. This correction is important if # the light delay time is a significant fraction of the # period of variablility. For example, pulsar data should be reduced to the # solar system barycenter before invoking ORDERPHASE and COADD. # # Date Author Description # ---- ------ ----------- # 04-12-85 C. D. Biemesderfer Original # 02-19-90 J.-C. Hsu rewrite in SPP # ------------------------------------------------------------------------------ procedure coadd () pointer fin, fphase, finmask, fout, ferror, foutmask # file template pointers int nfin, nfout # number of input and output files int nbins # number of bins in the output files real fillval # fill value for the invalid pixels in # the output files bool maskflag # is there input mask file? #============================================================================== begin # announce start of the task call printf ("*** COADD - Version 1.0 ***\n") # get CL parameters and related quantities call coadd_get (fin, fphase, finmask, fout, ferror, foutmask, nfin, nfout, nbins, maskflag, fillval) # case 1: each input file is coadded to a corresponding output file if (nfout > 1 || nfin == 1) { call coadd_nton (fin, fphase, finmask, fout, ferror, foutmask, nfin, nbins, maskflag, fillval) # case 2: many input files but only one output file } else if (nfin > 1 && nfout == 1) { call coadd_nto1 (fin, fphase, finmask, fout, ferror, foutmask, nfin, nbins, maskflag, fillval) } else { call error (1, "illegal number of files") } # close file templates call imtclose (fin) call imtclose (fphase) call imtclose (finmask) call imtclose (fout) call imtclose (ferror) call imtclose (foutmask) # announce completion of task call printf ("phase coaddition task completed with no error\n") end