Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 220 → Rev 221

/cvi/instr/HISTO/H2D.c
118,8 → 118,8
h2[h2d]->minx = minx;
h2[h2d]->miny = miny;
h2[h2d]->stepx = (nx>1)?(maxx-minx)/(nx-1):0;
h2[h2d]->stepy = (nx>1)?(maxy-miny)/(ny-1):0;
h2[h2d]->stepx = (nx>0)?(maxx-minx)/(nx):0;
h2[h2d]->stepy = (nx>0)?(maxy-miny)/(ny):0;
h2[h2d]->size = h2[h2d]->nx*h2[h2d]->ny*sizeof(double);
h2[h2d]->data = (double *) malloc(h2[h2d]->size);
131,11 → 131,11
}
 
double _VI_FUNC H2D_GetXBinCenter(int h2d,int xbin) {
return h2[h2d]->minx+xbin*h2[h2d]->stepx;
return h2[h2d]->minx+(xbin+0.5)*h2[h2d]->stepx;
}
 
double _VI_FUNC H2D_GetYBinCenter(int h2d,int ybin) {
return h2[h2d]->miny+ybin*h2[h2d]->stepy;
return h2[h2d]->miny+(ybin+0.5)*h2[h2d]->stepy;
}
 
int _VI_FUNC H2D_Write2File(int h2d,FILE *fp) {
292,9 → 292,9
H2D_GetNbinsY(histogram),
VAL_DOUBLE,
H2D_GetStepY(histogram),
H2D_GetMinY(histogram),
H2D_GetYBinCenter(histogram,0),
H2D_GetStepX(histogram),
H2D_GetMinX(histogram),
H2D_GetXBinCenter(histogram,0),
colormap->array,
colormap->HiColor,
colormap->numberofColors, 1, 0);