Пример #1
0
void plot_model_name(struct Plot *plot,
                    float xoff,float yoff,
	            char *dir,char *mag,
                    unsigned int color,unsigned char mask,
                    char *fontname,float fontsize,
                    void *txtdata) {

  char txt[256];
  float txbox[3];
  float lhgt;

  sprintf(txt,"Xy");
  txtbox(fontname,fontsize,strlen(txt),txt,txbox,txtdata);
  lhgt=4+txbox[2]-txbox[1];

  sprintf(txt,"APL MODEL");
  txtbox(fontname,fontsize,strlen(txt),txt,txbox,txtdata);
 
  PlotText(plot,NULL,fontname,fontsize,xoff-txbox[0]/2,yoff,
            strlen(txt),txt,color,mask,1);

  txtbox(fontname,fontsize,strlen(mag),mag,txbox,txtdata);
  PlotText(plot,NULL,fontname,fontsize,xoff-txbox[0]/2,yoff+lhgt,
            strlen(mag),mag,color,mask,1);

  txtbox(fontname,fontsize,strlen(dir),dir,txbox,txtdata);
  PlotText(plot,NULL,fontname,fontsize,xoff-txbox[0]/2,yoff+2*lhgt,
            strlen(dir),dir,color,mask,1);
}
Пример #2
0
void plot_time_label(struct Plot *plot,
	             float xoff,float yoff,float wdt,float hgt,
                     float pole,int flip,char *sfx,float tme_shft,
	             float rad,float tick,
  	             unsigned int color,unsigned char mask,
                     char *fontname,float fontsize,
                     void *txtdata) {

  char txt[256];
  float txbox[3];
  float lon;
  float x,y,xtxt,ytxt,px,py;
  int i;
  
  if (flip==1) pole=-pole;

  for (i=0;i<24;i+=6) {  
 
     if ((i==0) || (i==12)) sprintf(txt,"%.2d %s",i,sfx);
     else sprintf(txt,"%.2d",i);
   

     lon=15*i-tme_shft;
     if (pole<0) lon=-lon;

     x=sin(lon*PI/180.0);
     y=cos(lon*PI/180.0);

 
     txtbox(fontname,fontsize,strlen(txt),txt,txbox,txtdata);
     xtxt=0;
     ytxt=0; 

     if (pole>0) {
         if (i==0) ytxt=txbox[2];
         else if (i==12) ytxt=txbox[1];
         else if (i==18) xtxt=txbox[0]; 
     } else {
         if (i==0) ytxt=txbox[2];
         else if (i==6) xtxt=txbox[0]; 
         else if (i==12) ytxt=txbox[1];     
     }     

     px=(xoff+wdt/2)+x*(rad+tick+2+xtxt);
     py=(yoff+hgt/2)+y*(rad+tick+2+ytxt); 

     if ((i % 12)==0) px=px-txbox[0]/2;
     else py=py+(txbox[2]-txbox[1])/2; 

     PlotText(plot,NULL,fontname,fontsize,px,py,
               strlen(txt),txt,color,mask,1);
  }
}
Пример #3
0
void plot_time(struct Plot *plot,
               float xoff,float yoff,float wdt,float hgt,
               double stime,double etime,
               unsigned int color,unsigned char mask,
               char *fontname,float fontsize,
               void *txtdata) {
  int i;
  char txt[256];
  float txbox[3];
  char *month[]={"Jan","Feb","Mar","Apr","May","Jun",
               "Jul","Aug","Sep","Oct","Nov","Dec",0};
  char *tmeA="00:00:00 UT";
  char *tmeB="00:00:00 - 00:00:00 UT";
  char *tmeC="0";
  float cwdt;
  float x,y;
  int yr,mo,dy,shr,smt,ssc,ehr,emt,esc;
  double sec;

  txtbox(fontname,fontsize,strlen(tmeC),tmeC,txbox,txtdata);
  cwdt=txbox[0];

  TimeEpochToYMDHMS(etime,&yr,&mo,&dy,&ehr,&emt,&sec);
  esc=sec;
  TimeEpochToYMDHMS(stime,&yr,&mo,&dy,&shr,&smt,&sec);
  ssc=sec;

  sprintf(txt,"%.2d %s %d",dy,month[mo-1],yr);
  txtbox(fontname,fontsize,strlen(txt),txt,txbox,txtdata);
  x=xoff;
  y=yoff+txbox[2];
  for (i=0;txt[i] !=0;i++) {
    txtbox(fontname,fontsize,1,txt+i,txbox,txtdata);
    PlotText(plot,NULL,fontname,fontsize,x,
              y,1,txt+i,color,mask,1);
    if (isdigit(txt[i])) x+=cwdt;
    else x+=txbox[0];
  }

  if (stime==etime) sprintf(txt,"%.2d:%.2d:%.2d UT",shr,smt,ssc);
  else sprintf(txt,"%.2d:%.2d:%.2d - %.2d:%.2d:%.2d UT",
               shr,smt,ssc,ehr,emt,esc);

  if (stime==etime) txtbox(fontname,fontsize,strlen(tmeA),tmeA,txbox,txtdata);
  else txtbox(fontname,fontsize,strlen(tmeB),tmeB,txbox,txtdata);

  x=xoff+wdt-txbox[0];
  y=yoff+txbox[2];
  for (i=0;txt[i] !=0;i++) {
    txtbox(fontname,fontsize,1,txt+i,txbox,txtdata);
    PlotText(plot,NULL,fontname,fontsize,x,
              y,1,txt+i,color,mask,1);
    if (isdigit(txt[i])) x+=cwdt;
    else x+=txbox[0];
  }
}
Пример #4
0
void plot_chi(struct Plot *plot,
                float xoff,float yoff,
                struct CnvMapData *ptr,
	        int degfree,int degfree_dat,
                unsigned int color,unsigned char mask,
                char *txtfontname,char *symfontname,float fontsize,
                void *txtdata) {

  char txt[256];
  float txbox[3];
  float lhgt;

  sprintf(txt,"Xy");
  txtbox(txtfontname,fontsize,strlen(txt),txt,txbox,txtdata);
  lhgt=4+txbox[2]-txbox[1];

  txtbox(symfontname,fontsize,strlen("c"),"c",txbox,txtdata);
 

  PlotText(plot,NULL,symfontname,fontsize,xoff,yoff,
            strlen("c"),"c",color,mask,1);
  PlotText(plot,NULL,txtfontname,fontsize*0.8,xoff+txbox[0],yoff-lhgt*0.2,
            strlen("2"),"2",color,mask,1);
  sprintf(txt,"/%d=%.1g",degfree,ptr->chi_sqr/degfree);
  PlotText(plot,NULL,txtfontname,fontsize,xoff+txbox[0]*2,yoff,
            strlen(txt),txt,color,mask,1);


  PlotText(plot,NULL,symfontname,fontsize,xoff,yoff+lhgt,
            strlen("c"),"c",color,mask,1);
  PlotText(plot,NULL,txtfontname,fontsize*0.8,xoff+txbox[0],yoff+lhgt*0.8,
            strlen("2"),"2",color,mask,1);
  sprintf(txt,"/%d=%.1g",degfree_dat,ptr->chi_sqr/degfree_dat);
  PlotText(plot,NULL,txtfontname,fontsize,xoff+txbox[0]*2,yoff+lhgt,
            strlen(txt),txt,color,mask,1);
}
Пример #5
0
void plot_extra(struct Plot *plot,
                float xoff,float yoff,
	        struct CnvMapData *ptr,
                unsigned int color,unsigned char mask,
                char *fontname,float fontsize,
                void *txtdata) {

  char txt[256];
  float txbox[3];
  float lhgt;

  sprintf(txt,"Xy");
  txtbox(fontname,fontsize,strlen(txt),txt,txbox,txtdata);
  lhgt=4+txbox[2]-txbox[1];

  sprintf(txt,"order=%d",ptr->fit_order);
  PlotText(plot,NULL,fontname,fontsize,xoff,yoff,
            strlen(txt),txt,color,mask,1);
  sprintf(txt,"lat. bnd.=%g",ptr->latmin);
  PlotText(plot,NULL,fontname,fontsize,xoff,yoff+lhgt,
            strlen(txt),txt,color,mask,1);

  if (ptr->error_wt !=0) strcpy(txt,"err wt/");
  else strcpy(txt,"");
  if (ptr->model_wt !=0) strcat(txt,"norm mod wt");
  else strcat(txt,"fix mod wt");
  PlotText(plot,NULL,fontname,fontsize,xoff,yoff+2*lhgt,
            strlen(txt),txt,color,mask,1);
  sprintf(txt,"%s %d.%.2d",ptr->source,ptr->major_rev,ptr->minor_rev);
  PlotText(plot,NULL,fontname,fontsize,xoff,yoff+3*lhgt,
            strlen(txt),txt,color,mask,1);



  
}