version 1.5, 2012/05/09 03:56:14
|
version 1.6, 2012/05/12 00:47:14
|
|
|
fftwf_plan plan; | fftwf_plan plan; |
int num_sections, *sections; | int num_sections, *sections; |
float *ar_coeff=NULL; | float *ar_coeff=NULL; |
int ndt; |
|
float *datarr, *datptr, *outptr; | float *datarr, *datptr, *outptr; |
float *datahold; | float *datahold; |
char tstartstr[100]; | char tstartstr[100]; |
|
|
int errbufstat=setvbuf(stderr, NULL, _IONBF, BUFSIZ); | int errbufstat=setvbuf(stderr, NULL, _IONBF, BUFSIZ); |
int outbufstat=setvbuf(stdout, NULL, _IONBF, BUFSIZ); | int outbufstat=setvbuf(stdout, NULL, _IONBF, BUFSIZ); |
| |
double tstart, tstartsave, tstop, tstopsave, tstep, tstartout, tstopout; |
double tstart, tstartsave, tstop, tstopsave, cadence, tstartout, tstopout; |
double wt0, wt1, wt2, wt3, wt; | double wt0, wt1, wt2, wt3, wt; |
double ut0, ut1, ut2, ut3, ut; | double ut0, ut1, ut2, ut3, ut; |
double st0, st1, st2, st3, st; | double st0, st1, st2, st3, st; |
|
|
} | } |
} | } |
| |
ndt=drms_getkey_int(inrec, "NDT", NULL); |
cadence=drms_getkey_float(inrec, "T_STEP", NULL); //assume constant across all input records |
tstep=drms_getkey_float(inrec, "T_STEP", NULL); //assume constant across all input records |
tsample=cadence; |
tsample=tstep; |
tstartsave=drms_getkey_time(inrec, "T_START", NULL); //must be constant across all input records unless GAPFILE is implemented differently |
| |
int mflipin=drms_getkey_int(inrec, "MFLIPPED", &status); | int mflipin=drms_getkey_int(inrec, "MFLIPPED", &status); |
if (status != DRMS_SUCCESS) mflipin=0; | if (status != DRMS_SUCCESS) mflipin=0; |
|
|
} | } |
lmode=lmin; | lmode=lmin; |
| |
tstart=tstartsave=drms_getkey_time(inrec, "T_START", NULL); |
tstart=drms_getkey_time(inrec, "T_START", NULL); |
tstop =tstopsave =drms_getkey_time(inrec, "T_STOP", NULL); |
tstop =drms_getkey_time(inrec, "T_STOP", NULL); |
tstep=drms_getkey_float(inrec, "T_STEP", NULL); |
cadence=drms_getkey_float(inrec, "T_STEP", NULL); |
|
if (tstart != tstartsave) |
|
{ |
|
// to lift this restriction must be able to specify multiple gap files/records as input |
|
sprint_time(tstartstr, tstart, "TAI", 0); |
|
fprintf(stderr, "ERROR: all input records must have same T_START, record %d has %s\n", irec, tstartstr); |
|
return 0; |
|
} |
| |
n_in=(tstop-tstart)/tstep; |
n_in=(tstop-tstart)/cadence; |
if (n_in != gapsize) | if (n_in != gapsize) |
{ | { |
fprintf(stderr, "ERROR: gaps seem incompatible with timeseries, gapsize=%d, n_in=%d\n", gapsize, n_in); | fprintf(stderr, "ERROR: gaps seem incompatible with timeseries, gapsize=%d, n_in=%d\n", gapsize, n_in); |