math/
hist_nd_weight.pro
tophist_nd_weight
Math
result = hist_nd_weight(V, BIN [, weight=weight] [, reverse_indices=reverse_indices] [, unweighted=unweighted] [, _extra=_extra])
Wrapper to the dfanning HIST_ND function that calculates a weighted multi-dimensional histogram.
Return value
The function returns a multi-dimensional histogram where each data value has been weighted by its WEIGHT value. The return type is the same type as WEIGHT.
Parameters
- V in required
Values whose histogram is to be taken. V should be an NxP array for P points in N dimensions.
- BIN in required
Bin size. May either be a scalar, or an N-dimensional vector.
Keywords
- weight in optional
A vector of the same dimensions as V with the weights for each data value.
- reverse_indices in optional
Outputs the reverse index array.
- unweighted in optional
Outputs the unweighted histogram.
- _extra in optional
All extra keywords are passed through to HIST_ND.
Examples
IDL> q = TRANSPOSE( [ [0.1*FINDGEN(40)], [0.2*FINDGEN(40)] ] )
IDL> PRINT, HIST_ND_WEIGHT(q, 1, WEIGHT=q, UNWEIGHTED=plainhist)
0.500000 0.00000 0.00000 0.00000
2.50000 0.00000 0.00000 0.00000
0.00000 4.00000 0.00000 0.00000
0.00000 6.50000 0.00000 0.00000
0.00000 0.00000 7.50000 0.00000
0.00000 0.00000 10.5000 0.00000
0.00000 0.00000 0.00000 11.0000
0.00000 0.00000 0.00000 14.5000
IDL> PRINT, plainhist
5 0 0 0
5 0 0 0
0 5 0 0
0 5 0 0
0 0 5 0
0 0 5 0
0 0 0 5
0 0 0 5
Author information
| History: | Written by: Jeremy Bailin 12 June 2008 Public release in JBIU |
File attributes
| Modifcation date: | Fri Jun 13 10:51:53 2008 |
| Lines: | 78 |
![[attach.png]](../idldoc-resources/attach.png)