42 FrFile *iFile = FrFileINew(fname);
46 printf(
" ReadFrame(): cannot open the input file %s\n", fname);
55 char *refC = (
char *)&ref;
60 char* nname =
new char[strlen(fname)];
67 FrAdcData *adc = NULL;
69 double gt, gt0, gts, gte;
70 gts = FrFileITStart( iFile );
71 gte = FrFileITEnd( iFile );
76 iFile->compress = 255;
85 adc = FrAdcDataReadT(iFile, cname, gt + 1.
e-7);
88 printf(
" ReadFrame() error: channel %s is not found in file %s\n",
96 if( adc->data == NULL )
continue;
99 printf(
" got %d data samples\n",n);
105 rate = adc->sampleRate;
108 printf(
" creating new WSeries\n");
115 bool swap = (refC[0] == 0x34 && adc->data->compress < 256) ||
116 (refC[0] == 0x12 && adc->data->compress > 255);
118 printf(
"check for swap\n");
124 unsigned char local[2];
125 char *buf = adc->data->data;
127 for(
unsigned int i=0;
i<adc->data->nBytes-3;
i=
i+4) {
138 printf(
"check for WAT compress\n");
171 switch(adc->data->type) {
174 for(
int i=0;
i<
n;
i++)
175 out->
data[
i] = adc->data->dataS[
i];
179 for(
int i=0;
i<n;
i++)
180 out->
data[
i] = adc->data->dataF[
i];
187 if (adc) FrAdcDataFree(adc);
196 sprintf(gpstime,
"%9d",
int(gts));
197 sprintf(newgpstime,
"%9d",
int(gte));
198 ptime=strstr(nname, gpstime);
200 if ( ptime != NULL && atoi(ptime)==
int(gts) &&
201 strlen(gpstime) == strlen(newgpstime) )
204 strncpy(ptime,newgpstime,strlen(newgpstime));
210 iFile = FrFileINew(nname);
213 printf(
" ReadFrame(): cannot open next input file %s\n", nname);
217 gts=FrFileITStart(iFile);
218 iFile->compress = 255;
221 printf(
" ReadFrame(): next input file");
222 printf(
" %s doesn't provide continuous data\n", nname);
227 gte=FrFileITEnd(iFile);
231 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 void rate(double r)
virtual void start(double s)
virtual size_t size() const
printf("total live time: non-zero lags = %10.1f \, liveTot)
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)