XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ssclib (ssclib-4.30) [xmmsas_20160201_1833-15.0.0]

Return largest true index Array or vector scalar Rectangular bounds of the Home Index

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

Return smallest true index of a logical vector

  integer function smallestTrueIndex(maskVector)
    logical(bool), intent(in) :: maskVector(:)
  end function

Examples:

  smallestTrueIndex(((/0, 1, 1/) > 0)) ! returns 2
  smallestTrueIndex(((/1, 1, 1/) > 0)) ! returns 1
  smallestTrueIndex(((/0, 0, 0/) > 0)) ! returns 4, ie 1 above vector limit.

size(maskVector)+1 is also returned if the vector is of zero size.



XMM-Newton SOC/SSC -- 2016-02-01