Freqlist for rfpng
parent
619d70e790
commit
a1c95548eb
19
rfpng.c
19
rfpng.c
|
@ -24,7 +24,7 @@ void dec2sex(double x,char *s,int f,int len);
|
||||||
void time_axis(double *mjd,int n,float xmin,float xmax,float ymin,float ymax);
|
void time_axis(double *mjd,int n,float xmin,float xmax,float ymin,float ymax);
|
||||||
void usage(void);
|
void usage(void);
|
||||||
void plot_traces(struct trace *t,int nsat,float foff,int type,int isci);
|
void plot_traces(struct trace *t,int nsat,float foff,int type,int isci);
|
||||||
void filter(struct spectrogram s,int site_id,float sigma,char *filename,int graves);
|
void filter(struct spectrogram s,int site_id,float sigma,char *filename,int graves);
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ int main(int argc,char *argv[])
|
||||||
float width=1500,sigma=5.0,foff=0.0;
|
float width=1500,sigma=5.0,foff=0.0;
|
||||||
float x,y,x0,y0;
|
float x,y,x0,y0;
|
||||||
char c;
|
char c;
|
||||||
char path[128],xlabel[64],ylabel[64],filename[32],tlefile[128],pngfile[128],datfile[128];
|
char path[128],xlabel[64],ylabel[64],filename[32],tlefile[128],pngfile[128],datfile[128],freqlist[128];
|
||||||
int sec,lsec,ssec;
|
int sec,lsec,ssec;
|
||||||
char stime[16];
|
char stime[16];
|
||||||
double fmin,fmax,fcen,f;
|
double fmin,fmax,fcen,f;
|
||||||
|
@ -72,11 +72,17 @@ int main(int argc,char *argv[])
|
||||||
printf("ST_COSPAR environment variable not found.\n");
|
printf("ST_COSPAR environment variable not found.\n");
|
||||||
}
|
}
|
||||||
env=getenv("ST_TLEDIR");
|
env=getenv("ST_TLEDIR");
|
||||||
|
if(env==NULL||strlen(env)==0)
|
||||||
|
env=".";
|
||||||
sprintf(tlefile,"%s/bulk.tle",env);
|
sprintf(tlefile,"%s/bulk.tle",env);
|
||||||
|
env=getenv("ST_DATADIR");
|
||||||
|
if(env==NULL||strlen(env)==0)
|
||||||
|
env=".";
|
||||||
|
sprintf(freqlist,"%s/data/frequencies.txt",env);
|
||||||
|
|
||||||
// Read arguments
|
// Read arguments
|
||||||
if (argc>1) {
|
if (argc>1) {
|
||||||
while ((arg=getopt(argc,argv,"p:f:w:s:l:b:z:hc:C:m:gS:qo:O:"))!=-1) {
|
while ((arg=getopt(argc,argv,"p:f:w:s:l:b:z:hc:C:m:gS:qo:O:F:"))!=-1) {
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
|
@ -104,6 +110,10 @@ int main(int argc,char *argv[])
|
||||||
nsub=atoi(optarg);
|
nsub=atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'F':
|
||||||
|
strcpy(freqlist,optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'w':
|
case 'w':
|
||||||
df0=(double) atof(optarg);
|
df0=(double) atof(optarg);
|
||||||
break;
|
break;
|
||||||
|
@ -167,7 +177,7 @@ int main(int argc,char *argv[])
|
||||||
printf("Read spectrogram\n%d channels, %d subints\nFrequency: %g MHz\nBandwidth: %g MHz\n",s.nchan,s.nsub,s.freq*1e-6,s.samp_rate*1e-6);
|
printf("Read spectrogram\n%d channels, %d subints\nFrequency: %g MHz\nBandwidth: %g MHz\n",s.nchan,s.nsub,s.freq*1e-6,s.samp_rate*1e-6);
|
||||||
|
|
||||||
// Compute traces
|
// Compute traces
|
||||||
t=compute_trace(tlefile,s.mjd,s.nsub,site_id,s.freq*1e-6,s.samp_rate*1e-6,&nsat,graves);
|
t=compute_trace(tlefile,s.mjd,s.nsub,site_id,s.freq*1e-6,s.samp_rate*1e-6,&nsat,graves,freqlist);
|
||||||
printf("Traces for %d objects for location %d\n",nsat,site_id);
|
printf("Traces for %d objects for location %d\n",nsat,site_id);
|
||||||
|
|
||||||
cpgopen(pngfile);
|
cpgopen(pngfile);
|
||||||
|
@ -376,6 +386,7 @@ void usage(void)
|
||||||
printf("-f <freq> Frequency to zoom into (Hz)\n");
|
printf("-f <freq> Frequency to zoom into (Hz)\n");
|
||||||
printf("-w <bw> Bandwidth to zoom into (Hz)\n");
|
printf("-w <bw> Bandwidth to zoom into (Hz)\n");
|
||||||
printf("-O <offset> Frequency offset to apply (Hz) [0]\n");
|
printf("-O <offset> Frequency offset to apply (Hz) [0]\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;
|
||||||
|
|
Loading…
Reference in New Issue