24 FrFile *iFile = FrFileINew(fname);
28 printf(
" ReadFrame(): cannot open the input file %s\n", fname);
37 char *refC = (
char *)&ref;
42 char* nname =
new char[strlen(fname)];
49 FrAdcData *adc = NULL;
51 double gt, gt0, gts, gte;
52 gts = FrFileITStart( iFile );
53 gte = FrFileITEnd( iFile );
58 iFile->compress = 255;
67 adc = FrAdcDataReadT(iFile, cname, gt + 1.
e-7);
70 printf(
" ReadFrame() error: channel %s is not found in file %s\n",
78 if( adc->data == NULL )
continue;
81 printf(
" got %d data samples\n",n);
87 rate = adc->sampleRate;
90 printf(
" creating new WSeries\n");
97 bool swap = (refC[0] == 0x34 && adc->data->compress < 256) ||
98 (refC[0] == 0x12 && adc->data->compress > 255);
100 printf(
"check for swap\n");
106 unsigned char local[2];
107 char *buf = adc->data->data;
109 for(
unsigned int i=0;
i<adc->data->nBytes-3;
i=
i+4) {
120 printf(
"check for WAT compress\n");
153 switch(adc->data->type) {
156 for(
int i=0;
i<
n;
i++)
157 out->
data[
i] = adc->data->dataS[
i];
161 for(
int i=0;
i<n;
i++)
162 out->
data[
i] = adc->data->dataF[
i];
169 if (adc) FrAdcDataFree(adc);
178 sprintf(gpstime,
"%9d",
int(gts));
179 sprintf(newgpstime,
"%9d",
int(gte));
180 ptime=strstr(nname, gpstime);
182 if ( ptime != NULL && atoi(ptime)==
int(gts) &&
183 strlen(gpstime) == strlen(newgpstime) )
186 strncpy(ptime,newgpstime,strlen(newgpstime));
192 iFile = FrFileINew(nname);
195 printf(
" ReadFrame(): cannot open next input file %s\n", nname);
199 gts=FrFileITStart(iFile);
200 iFile->compress = 255;
203 printf(
" ReadFrame(): next input file");
204 printf(
" %s doesn't provide continuous data\n", nname);
209 gte=FrFileITEnd(iFile);
213 if (out == NULL || n == 0)
return NULL;
WSeries< float > * ReadFrame(double t, char *cname, char *fname, bool seek)
wavearray< double > t(hp.size())
virtual void resize(unsigned int)
virtual size_t size() const
printf("total live time: non-zero lags = %10.1f \n", liveTot)
virtual void rate(double r)
virtual void start(double s)
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)