Save and restore CFOM-adjusted data in *.iq files.

This commit is contained in:
Joe Taylor
2023-12-18 16:34:44 -05:00
parent 889531fda6
commit 2fb711401f
5 changed files with 22 additions and 9 deletions
+13 -3
View File
@@ -25,7 +25,6 @@ void getfile(QString fname, bool xpol, int dbDgrd)
if(fp != NULL) {
auto n = fread(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp);
n = fread(id,2,npts,fp);
Q_UNUSED (n);
int j=0;
if(dbDgrd<0) {
@@ -39,6 +38,12 @@ void getfile(QString fname, bool xpol, int dbDgrd)
datcom_.d4[j++]=(float)id[i+1];
}
}
n = fread(datcom_.mygrid,sizeof(datcom_.mygrid),1,fp);
short int one=0;
fread(&one,2,1,fp);
Q_UNUSED(n);
// if(n>0) qDebug() << "bb" << datcom_.mygrid << one;
fclose(fp);
datcom_.ndiskdat=1;
@@ -52,10 +57,10 @@ void getfile(QString fname, bool xpol, int dbDgrd)
}
}
void savetf2(QString fname, bool xpol)
void save_iq(QString fname, bool bCFOM)
{
int npts=2*60*96000;
if(xpol) npts=2*npts;
if(bCFOM) npts=2*npts;
qint16* buf=(qint16*)malloc(2*npts);
char name[80];
@@ -70,6 +75,11 @@ void savetf2(QString fname, bool xpol)
buf[i+1]=(qint16)datcom_.d4[j++];
}
fwrite(buf,2,npts,fp);
if(bCFOM) {
fwrite(&datcom_.mygrid,sizeof(datcom_.mygrid),1,fp);
short int one=1;
fwrite(&one,2,1,fp);
}
fclose(fp);
}
free(buf);