GRAVES addition

pull/10/head
Cees Bassa 2015-05-26 18:28:16 +02:00
parent a0c939b233
commit 38934026bd
2 changed files with 11 additions and 6 deletions

View File

@ -14,9 +14,10 @@ void usage(void)
{
printf("rfplot: plot RF observations\n\n");
printf("-p <path> Path to file prefix /a/b/c_??????.bin\n");
printf("-o <file> Output file name [test_000000.bin]\n");
printf("-O <file> Output file name [test_000000.bin]\n");
printf("-s <start> Number of starting subintegration [0]\n");
printf("-l <length> Number of subintegrations to plot [3600]\n");
printf("-o <offset> Frequency offset to apply (Hz) [0.0]\n");
printf("-b <nbin> Number of subintegrations to bin [1]\n");
printf("-f <freq> Frequency to zoom into (Hz)\n");
printf("-w <bw> Bandwidth to zoom into (Hz)\n");
@ -30,21 +31,25 @@ int main(int argc,char *argv[])
struct spectrogram s;
char path[128],outfile[128]="test";
int arg=0,nsub=3600,nbin=1,isub=0;
double f0=0.0,df0=0.0;
double f0=0.0,df0=0.0,foff=0.0;
// Read arguments
if (argc>1) {
while ((arg=getopt(argc,argv,"p:o:f:w:s:l:b:h"))!=-1) {
while ((arg=getopt(argc,argv,"p:o:O:f:w:s:l:b:h"))!=-1) {
switch (arg) {
case 'p':
strcpy(path,optarg);
break;
case 'o':
case 'O':
strcpy(outfile,optarg);
break;
case 'o':
foff=(double) atof(optarg);
break;
case 's':
isub=atoi(optarg);
break;
@ -80,7 +85,7 @@ int main(int argc,char *argv[])
}
// Read data
s=read_spectrogram(path,isub,nsub,f0,df0,nbin,0.0);
s=read_spectrogram(path,isub,nsub,f0,df0,nbin,foff);
// Write data
write_spectrogram(s,outfile);

View File

@ -491,7 +491,7 @@ int main(int argc,char *argv[])
cpgsci(2);
for (i=0,flag=0;i<s.nsub-1;i++) {
dt=86400.0*(s.mjd[i]-mjdgrid);
jj1=(int) (floor) (dt/2.3);
jj1=(int) (floor) (dt/2.4);
if (i==0)
jj0=jj1;
if (jj1-jj0>0.0) {