define SZ_SPEC 3 # ORDERPHASE -- Order time series observations by fractional phase # # Module Number: 10.3.6.4 # # Module Name: H Order Observation Phases # # Description: # ------------ # For each observation, the phase is computed from the time of measurement, # the period of variability, and the epoch date. A single-cycle light curve # is produced by reordering all points according to their fractional phase. # The data can be examined as a single-cycle light curve in order to # evaluate choice of period or to remove discrepant data. Both an output # science file (containing the single-cycle light curve data) and an # independent variable (IV) file (containing the fractional phases) # are produced. # # 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 H Correct for Light Delay Time (10.2.5). This correc- # tion 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 H Synchronous Co-addition. # # Date Author Description # ---- ------ ----------- # 05-10-85 C. D. Biemesderfer Original module # 11-APR-86 D.L. BALL Change COPYPARM calling sequence # 25-Jan-1990 J.-C. Hsu rewrite in SPP # 23-Jun-1994 J.-C. Hsu change from FPKTTIME to EXPSTART (v1.1) #------------------------------------------------------------------------------ procedure orderphase () pointer fin, fout, fphase, ftime, finmask, foutmask # file template pointers int nfin, nfout # number of files in each template double period # Light-curve period double epoch0 # Light-curve epoch char epoch0_spec[SZ_SPEC] # how zero phase epoch is specified? bool maskflag # is input mask file specified? bool timeflag # is time file specified? #============================================================================== begin # get input parameters call orderph_get (fin, fout, fphase, ftime, finmask, foutmask, nfin, nfout, period, epoch0, epoch0_spec, maskflag, timeflag) # announce start of the task call printf ("*** ORDERPHASE - Version 1.1 ***\n") # case 1: each input file is sorted to a corresponding output file if (nfout > 1 || nfin == 1) { call orderph_nton (fin, fout, fphase, ftime, finmask, foutmask, nfin, period, epoch0, epoch0_spec, maskflag, timeflag) # case 2: many input files but only one output file } else if (nfin > 1 && nfout == 1) { call orderph_nto1 (fin, fout, fphase, ftime, finmask, foutmask, nfin, period, epoch0, epoch0_spec, maskflag, timeflag) } else { call error (1, "illegal number of files") } # close file templates call imtclose (fin) call imtclose (fout) call imtclose (fphase) call imtclose (ftime) call imtclose (finmask) call imtclose (foutmask) # announce completion of task call printf ("order phase task completed with no error\n") end