rfplot draws grid, ticks, etc.
parent
59d90c3218
commit
ffb256112b
35
rfplot.c
35
rfplot.c
|
@ -196,14 +196,13 @@ int main(int argc,char *argv[])
|
|||
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);
|
||||
|
||||
giza_open_device_size_float ("/xs", "strf", 1024, 768, 3);
|
||||
giza_set_colour_representation_float (0, 0.0, 0.0, 0.0);
|
||||
giza_open_device_size_float ("/xs", "strf", 800, 600, 3);
|
||||
// Sets background color
|
||||
giza_set_colour_representation_float (1, 0.0, 0.0, 0.0);
|
||||
giza_draw_background ();
|
||||
giza_set_line_width_float (1);
|
||||
|
||||
giza_set_font ("Helvetica");
|
||||
giza_set_character_height_float(0.8);
|
||||
// cpgpap(12.5,0.55);
|
||||
cpgask(0);
|
||||
|
||||
// Default limits
|
||||
xmin=0.0;
|
||||
|
@ -221,11 +220,10 @@ int main(int argc,char *argv[])
|
|||
for (;;) {
|
||||
if (redraw==1) {
|
||||
// giza_draw_background();
|
||||
cpgpage();
|
||||
giza_set_colour_index(1);
|
||||
giza_set_colour_index(3);
|
||||
/*
|
||||
giza_set_viewport_float(0.1,0.95,0.9,0.95);
|
||||
cpgswin(xmin,xmax,s.zmin,s.zmax);
|
||||
giza_set_window_float(xmin,xmax,s.zmin,s.zmax);
|
||||
giza_box("BCTS",0.,0,"BCTSN",0.,0);
|
||||
|
||||
for (i=0;i<s.nsub;i++) {
|
||||
|
@ -238,7 +236,7 @@ int main(int argc,char *argv[])
|
|||
giza_set_viewport_float(0.1,0.95,0.1,0.85);
|
||||
*/
|
||||
giza_set_viewport_float(0.1,0.95,0.1,0.95);
|
||||
cpgswin(xmin,xmax,ymin,ymax);
|
||||
giza_set_window_float(xmin,xmax,ymin,ymax);
|
||||
|
||||
if (cmap==3) {
|
||||
cpggray(s.z,s.nsub,s.nchan,1,s.nsub,1,s.nchan,zmax,zmin,tr);
|
||||
|
@ -249,7 +247,8 @@ int main(int argc,char *argv[])
|
|||
giza_set_colour_table_float(heat_l,heat_r,heat_g,heat_b,9,1.0,0.5);
|
||||
else if (cmap==2)
|
||||
giza_set_colour_table_float(viridis_l,viridis_r,viridis_g,viridis_b,256,1.0,0.5);
|
||||
cpgimag(s.z,s.nsub,s.nchan,1,s.nsub,1,s.nchan,zmin,zmax,tr);
|
||||
// XXX
|
||||
//cpgimag(s.z,s.nsub,s.nchan,1,s.nsub,1,s.nchan,zmin,zmax,tr);
|
||||
}
|
||||
|
||||
// Pixel axis
|
||||
|
@ -267,7 +266,7 @@ int main(int argc,char *argv[])
|
|||
|
||||
// Human readable frequency axis
|
||||
fcen=0.5*(fmax+fmin);
|
||||
cpgswin(xmin,xmax,fmin-fcen,fmax-fcen);
|
||||
giza_set_window_float(xmin,xmax,fmin-fcen,fmax-fcen);
|
||||
if (foverlay==1)
|
||||
plot_traces(t,nsat,fcen,xmin,xmax);
|
||||
|
||||
|
@ -275,13 +274,13 @@ int main(int argc,char *argv[])
|
|||
sprintf(ylabel,"Frequency - %.3f MHz",fcen);
|
||||
fmin-=fcen;
|
||||
fmax-=fcen;
|
||||
cpgswin(xmin,xmax,fmin,fmax);
|
||||
giza_set_window_float(xmin,xmax,fmin,fmax);
|
||||
giza_box("",0.,0,"BTSN",0.,0);
|
||||
|
||||
sprintf(xlabel,"UT Date: %.10s",s.nfd0);
|
||||
giza_label(xlabel,ylabel," ");
|
||||
|
||||
cpgswin(xmin,xmax,ymin,ymax);
|
||||
giza_set_window_float(xmin,xmax,ymin,ymax);
|
||||
|
||||
// Plot selection
|
||||
if (sel.n>0) {
|
||||
|
@ -295,6 +294,7 @@ int main(int argc,char *argv[])
|
|||
giza_move_float(sel.x[i],sel.y[i]+sel.w);
|
||||
else
|
||||
giza_draw_float(sel.x[i],sel.y[i]+sel.w);
|
||||
giza_move_float(sel.x[i],sel.y[i]+sel.w);
|
||||
}
|
||||
// Plot lower bound
|
||||
for (i=0;i<sel.n;i++) {
|
||||
|
@ -302,6 +302,7 @@ int main(int argc,char *argv[])
|
|||
giza_move_float(sel.x[i],sel.y[i]-sel.w);
|
||||
else
|
||||
giza_draw_float(sel.x[i],sel.y[i]-sel.w);
|
||||
giza_move_float(sel.x[i],sel.y[i]-sel.w);
|
||||
}
|
||||
|
||||
giza_set_colour_index(1);
|
||||
|
@ -324,6 +325,7 @@ int main(int argc,char *argv[])
|
|||
else
|
||||
giza_set_line_style(2);
|
||||
if (flag==0) {
|
||||
// XXX
|
||||
giza_move_float((float) i,ymin);
|
||||
giza_draw_float((float) i,ymax);
|
||||
flag=1;
|
||||
|
@ -337,7 +339,7 @@ int main(int argc,char *argv[])
|
|||
}
|
||||
|
||||
// Get cursor
|
||||
cpgband(mode,posn,x0,y0,&x,&y,&c);
|
||||
giza_band_float(mode,posn,x0,y0,&x,&y,&c);
|
||||
|
||||
// Help
|
||||
if (c=='h') {
|
||||
|
@ -906,7 +908,7 @@ void time_axis(double *mjd,int n,float xmin,float xmax,float ymin,float ymax)
|
|||
dec2sex(((float) sec+0.1)/3600.0,stime,0,1);
|
||||
else
|
||||
dec2sex(((float) sec+0.1)/3600.0,stime,0,0);
|
||||
cpgtick(xmin,ymin,xmax,ymin,((float) i-xmin)/(xmax-xmin),0.5,0.5,0.3,0.0,stime);
|
||||
giza_tick_float(xmin,ymin,xmax,ymin,((float) i-xmin)/(xmax-xmin),0.5,0.5,0.3,0.0,stime);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -918,7 +920,7 @@ void time_axis(double *mjd,int n,float xmin,float xmax,float ymin,float ymax)
|
|||
if (mjdt>=mjd[i] && mjdt<mjd[i+1])
|
||||
break;
|
||||
sec=(int) floor(t);
|
||||
cpgtick(xmin,ymin,xmax,ymin,((float) i-xmin)/(xmax-xmin),0.25,0.25,1.0,1.0,"");
|
||||
giza_tick_float(xmin,ymin,xmax,ymin,((float) i-xmin)/(xmax-xmin),0.25,0.25,1.0,1.0,"");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -967,6 +969,7 @@ void plot_traces(struct trace *t,int nsat,float fcen,float xmin,float xmax)
|
|||
if (t[i].za[0]<=90.0)
|
||||
giza_text_float(0.0,(float) t[i].freq[0]-fcen,text);
|
||||
|
||||
|
||||
// Loop over trace
|
||||
for (j=0,flag=0,textflag=0;j<t[i].n;j++) {
|
||||
if ((float) j < xmin)
|
||||
|
|
Loading…
Reference in New Issue