next up previous index
Next: Y250 Statistical Analysis Up: CERNLIB Previous: W515 N-Body Monte-Carlo

Y201 Find Histogram-Channel

Routine ID: Y201
Author(s): J. Zoll, P. RastlLibrary: KERNLIB
Submitter: C. LetertreSubmitted: 01.09.1969
Language: Fortran or AssemblerRevised: 16.09.1991

IUCHAN, IUBIN, IUHIST all find the histogram-channel for a given quantity in the same way. They differ only slightly in the way in which the parameters are passed.

Structure:

FUNCTION subprograms
User Entry Names: IUCHAN, IUBIN, IUHIST

Usage:

All routines need the the following parameters:

X
( REAL) Quantity to be histogrammed.
XLOW
( REAL) Lower limit of the histogram.
DX
( REAL) Channel width.
NX
( INTEGER) Number of channels.
and they return the channel number N=(X-XLOW)/DX+1+ε normally, or N=0 for underflow (X<XLOW ), or N=NX+1 for overflow (X ≥XLOW + NX*DX ).

ε> 0 is a small bias to counteract rounding effects when X is exactly on a bin edge, a likely and serious problem when compressed data are histogrammed.

ε= 10-5 on 32-bit machines, ε= 10-6 on machines with a larger word size.
Function IUCHAN:

    N = IUCHAN(X,XLOW,DX,NX)

Functions IUBIN and IUHIST:

    DIMENSION PAR(3)
    EQUIVALENCE(NX,PAR(1))
    LOGICAL SPILL
 
    N = IUBIN (X,PAR,SPILL)
    N = IUHIST(X,PAR,SPILL)
with
PAR
Histogram parameters:
PAR(1) ≡NX
PAR(2) ≡DX (for IUBIN), or ≡1/DX reciprocal of the channel width (for IUHIST).
PAR(3) ≡XLOW

SPILL
( LOGICAL) Flag set to .TRUE. or .FALSE. depending on whether X is outside or inside the histogram.

Y250


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995