Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/sas/8.0.0/doc/ssclib/node10.html
Дата изменения: Wed Jul 2 03:52:38 2008
Дата индексирования: Fri Sep 5 18:38:02 2008
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п п п п п
Rectangular bounds of the true area of a logical array XMM-Newton SAS Home Page
XMM-Newton Science Analysis System


ssclib (ssclib-3.33.4) [xmmsas_20080701_1801-8.0.0]

Return smallest true index Array or vector scalar Allocate real to a Home Index

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

Rectangular bounds of the true area of a logical array

  subroutine maskArrayLimits(mask, minXi, maxXi, minYi, maxYi) 
    logical(bool),  intent(in)            :: mask(:,:)
    integer(int16), intent(out)           :: minXi, maxXi, minYi, maxYi
  end subroutine

!*** erase the status variable from the actual routine!

Example:

  logical(bool) :: mask(4,5)

  mask(1,:) = ((/0, 0, 0, 0, 0/) > 0)
  mask(2,:) = ((/0, 1, 1, 0, 0/) > 0)
  mask(3,:) = ((/1, 1, 0, 1, 0/) > 0)
  mask(4,:) = ((/1, 0, 0, 0, 0/) > 0)

  call maskArrayLimits(mask, minXi, maxXi, minYi, maxYi)
  ! returns minXi=1, maxXi=4, minYi=2, maxYi=4

  mask = .false.

  call maskArrayLimits(mask, minXi, maxXi, minYi, maxYi)
  ! returns minXi=6, maxXi=0, minYi=5, maxYi=0 (ie, nonsense)

The same nonsense return occurs if mask is of zero size in either direction. It is up to the user to check that the mask is neither empty nor of zero size before calling maskArrayLimits.



XMM-Newton SOC/SSC -- 2008-07-01