Add cmdline arg for providing frequency list to rffit
parent
00bdbf98dd
commit
619d70e790
14
rffit.c
14
rffit.c
|
@ -287,6 +287,7 @@ void usage()
|
||||||
printf("-s <site> Site ID\n");
|
printf("-s <site> Site ID\n");
|
||||||
printf("-g GRAVES data\n");
|
printf("-g GRAVES data\n");
|
||||||
printf("-m <offset> Frequency offset to apply [Hz]\n");
|
printf("-m <offset> Frequency offset to apply [Hz]\n");
|
||||||
|
printf("-F <freqlist> List with frequencies [$ST_DATADIR/data/frequencies.txt]\n");
|
||||||
printf("-h This help\n");
|
printf("-h This help\n");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -324,11 +325,14 @@ int main(int argc,char *argv[])
|
||||||
printf("ST_COSPAR environment variable not found.\n");
|
printf("ST_COSPAR environment variable not found.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get frequency list
|
||||||
env=getenv("ST_DATADIR");
|
env=getenv("ST_DATADIR");
|
||||||
if(env==NULL||strlen(env)==0)
|
if(env==NULL||strlen(env)==0)
|
||||||
env=".";
|
env=".";
|
||||||
|
sprintf(freqlist,"%s/data/frequencies.txt",env);
|
||||||
|
|
||||||
// Decode options
|
// Decode options
|
||||||
while ((arg=getopt(argc,argv,"d:c:i:hs:gm:"))!=-1) {
|
while ((arg=getopt(argc,argv,"d:c:i:hs:gm:F:"))!=-1) {
|
||||||
switch(arg) {
|
switch(arg) {
|
||||||
case 'd':
|
case 'd':
|
||||||
datafile=optarg;
|
datafile=optarg;
|
||||||
|
@ -342,6 +346,10 @@ int main(int argc,char *argv[])
|
||||||
satno=atoi(optarg);
|
satno=atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'F':
|
||||||
|
strcpy(freqlist,optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
usage();
|
usage();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -720,10 +728,6 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
// Flux limit
|
// Flux limit
|
||||||
if (c=='l') {
|
if (c=='l') {
|
||||||
env=getenv("ST_DATADIR");
|
|
||||||
if(env==NULL||strlen(env)==0)
|
|
||||||
env=".";
|
|
||||||
sprintf(freqlist,"%s/data/frequencies.txt",env);
|
|
||||||
fp=fopen(freqlist,"a");
|
fp=fopen(freqlist,"a");
|
||||||
fprintf(fp,"%05d %lf\n",orb.satno,d.ffit/1000.0);
|
fprintf(fp,"%05d %lf\n",orb.satno,d.ffit/1000.0);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
Loading…
Reference in New Issue