From 727f062c89096183f7b7d1f44bbde1e39a2618f0 Mon Sep 17 00:00:00 2001 From: Cees Bassa Date: Sun, 23 Mar 2014 16:49:50 +0100 Subject: [PATCH] Added overlay feature --- makefile | 4 ++-- rfio.c | 1 - rfplot.c | 20 ++++++++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index 736401d..01d5990 100644 --- a/makefile +++ b/makefile @@ -13,8 +13,8 @@ all: rfedit: rfedit.o rfio.o rftime.o $(CC) -o rfedit rfedit.o rfio.o rftime.o -lm -rfplot: rfplot.o rftime.o rfio.o - gfortran -o rfplot rfplot.o rftime.o rfio.o $(LFLAGS) +rfplot: rfplot.o rftime.o rfio.o rfoverlay.o sgdp4.o satutl.o deep.o ferror.o + gfortran -o rfplot rfplot.o rftime.o rfio.o rfoverlay.o sgdp4.o satutl.o deep.o ferror.o $(LFLAGS) rffft: rffft.o $(CC) -o rffft rffft.o -lm -lfftw3f diff --git a/rfio.c b/rfio.c index 919a054..e080603 100644 --- a/rfio.c +++ b/rfio.c @@ -99,7 +99,6 @@ struct spectrogram read_spectrogram(char *prefix,int isub,int nsub,double f0,dou if (l%nbin==nbin-1) { // Scale s.mjd[i]/=(float) nbin; - printf("%d %lf\n",ibin,s.mjd[i]); for (j=0;j #include "rftime.h" #include "rfio.h" +#include "rfoverlay.h" #define LIM 128 @@ -13,6 +14,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 usage(void); + int main(int argc,char *argv[]) { struct spectrogram s; @@ -37,6 +39,7 @@ int main(int argc,char *argv[]) FILE *file; int arg=0,nsub=3600,nbin=1; double f0=0.0,df0=0.0; + int foverlay=1; // Read arguments if (argc>1) { @@ -125,6 +128,11 @@ int main(int argc,char *argv[]) fmax*=1e-6; cpgswin(xmin,xmax,fmin,fmax); + if (foverlay==1) { + cpgsci(3); + overlay(s.mjd,s.nsub,4171); + cpgsci(1); + } // Human readable frequency axis fcen=0.5*(fmax+fmin); @@ -277,6 +285,15 @@ int main(int argc,char *argv[]) continue; } + // Toggle overlay + if (c=='p') { + if (foverlay==0) + foverlay=1; + else if (foverlay==1) + foverlay=0; + redraw=1; + } + // Width if (isdigit(c)) { width=1000.0/(c-'0'); @@ -424,7 +441,6 @@ void time_axis(double *mjd,int n,float xmin,float xmax,float ymin,float ymax) // Find extrema for (i=0;i43000) { lsec=10800;