// make a single Aitoff sky projection plot
//   using the data in ravec[field], decvec[field], and value[filter][field],
//   using the min and max data values in valmin[filter] and valmax[filter]
//   with filter=0
void plotOne(double nfields, double *value,
             double *ravec, double *decvec,
             double valmin, double valmax,
             char *label, char *title, char *plotName) {
  int nf;
  double xmin, xmax, ymin, ymax;

  // set up the plot
  openPlot(plotName);
  cpgbbuf();

  cpgpap(PLOTSIZE/0.7,0.7);

  cpgsvp(0.02,0.98,0.02,0.98);

  xmax = M_PI;      xmin = -xmax;
  ymax = 0.67*M_PI; ymin = -ymax;
  ymin -= 0.1*ymax; ymax -= 0.1*ymax;

  setupImplot(0.0, 1.0);
  cpgswin(xmin,xmax,ymin,ymax);

  // make a projected field circle for each field
  cpgsch(1.0);
  for(nf=0; nf<nfields; nf++) {
    projCircle(ravec[nf], decvec[nf], FIELD_RADIUS, 
               (value[nf]-valmin)/(valmax-valmin));
  }
  // the grids and galactic exclusion
  aitoffGrid();
  galaxy(peakL, taperL, taperB);

  cpgslw(2);
  cpgsch(2.0);
  cpgswin(0,1,0,1);
  mywedg(0.21, 0.15, 1.0, 12.0, valmin, valmax, label);
  cpgptxt(0.5,0.95,0.0,0.5,title);
  cpgslw(1);

  cpgebuf();
  closePlot();
}
// make six Aitoff sky projection plots
//   using the data in ravec[field], decvec[field], and value[filter][field],
//   using the min and max data values in valmin[filter] and valmax[filter]
//   with filter=0 to NFILTERS-1
void plotSix(double nfields, double **value,
             double *ravec, double *decvec,
             double *valmin, double *valmax,
             int horizontal,
             char *label, char *title, char* plotName, int mask) {

	char str[1024];
	int filt, nf;
	double xmin, xmax, ymin, ymax;

	openPlot(plotName);
	cpgbbuf();

	if(horizontal==1) 
		cpgpap(PLOTSIZE/0.5,0.5); else cpgpap(PLOTSIZE/1.0,1.0);

	cpgsvp(0.02,0.98,0.15,0.95);
	xmax = 0.9*(M_PI);      
	xmin = -xmax;
	ymax = 0.9*(0.6*M_PI);  
	ymin = -ymax;
	ymin -= 0.18*ymax;      
	ymax -= 0.18*ymax;

	setupImplot(0.0, 1.0);

	if(horizontal==1) 
		cpgsubp(3,2); 
	else 
		cpgsubp(2,3);

	cpgsch(3.0); 
	cpgslw(2);

	for(filt=0; filt<NFILTERS; filt++) {
		int thereisdata = 0;
		for(nf=0; nf<nfields; nf++) {
			if (value[filt][nf] != 0.0) {
				thereisdata = 1;
			}
		}
		
		if ( thereisdata ) {
			if(horizontal==1) 
				cpgpanl(hpanelx[filt],hpanely[filt]); 
			else 
				cpgpanl(vpanelx[filt],vpanely[filt]);

			cpgswin(xmin,xmax,ymin,ymax);
			for(nf=0; nf<nfields; nf++) {
				if ( mask == 0 ) {
					if(value[filt][nf] > 0.0)
						projCircle(ravec[nf], decvec[nf], FIELD_RADIUS, (value[filt][nf]-valmin[filt])/(valmax[filt]-valmin[filt]));
				} else if ( mask == 1) {
					if(value[filt][nf] != 0.0)
						projCircle(ravec[nf], decvec[nf], FIELD_RADIUS, (value[filt][nf]-valmin[filt])/(valmax[filt]-valmin[filt]));
				}
			}
			aitoffGrid();
			galaxy(peakL, taperL, taperB);
			sprintf(str,"%s: %s", label, filtername[filt]);
			if(valmax[filt]>valmin[filt])
				mywedg(0.2, 0.15, 1.0, 8.0, valmin[filt], valmax[filt], str);
		}
	}

	cpgsch(1.0);
	cpgsubp(1,1);
	cpgswin(0,1,0,1);
	cpgptxt(0.5,1.02,0.0,0.5,title);
	cpgslw(1);    
	cpgebuf();

	closePlot();
}
Example #3
0
int main(int argc, const char * argv[]) {
	// insert code here...
	GalaxSee galaxy(512, initialConfigurations::GRID);
	galaxy.printJSON(1800);
	return 0;
}