Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/sas/7.1.0/doc/ssclib/node11.html
Дата изменения: Mon Jul 9 01:26:53 2007
Дата индексирования: Sat Dec 22 08:43:56 2007
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п п
Allocate real to a bin XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ssclib (ssclib-3.29.3) [xmmsas_20070708_1801-7.1.0]

Rectangular bounds of the Array or vector scalar Simpler maxloc Home Index

Meta Index / Home Page / General-purpose array-processing utilities / Array or vector scalar

Allocate real to a bin

  function getBinNumber(xBinEdges, x) result(binNum) 
    real(single), intent(in) :: xBinEdges(:), x
    integer(int32)           :: binNum
  end function

In a commonly encountered situation, one has a set of bins defined by a vector of bin edges xBinEdges, plus a real number x, and it is desired to know into which bin x falls. The present function accomplishes this calculation and returns the index of the bin. The bin edges should occur in increasing order, with no two values the same, but they don't have to be equidistant. The returned value obeys in general the rule


\begin{displaymath}
xBinEdges(i) \le x < xBinEdges(i+1) \Rightarrow binNum = i
\end{displaymath}

However note the following limiting or pathological cases:


Rectangular bounds of the Array or vector scalar Simpler maxloc Home Index

XMM-Newton SOC/SSC -- 2007-07-08