Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/TCC/html/namespacetcc_1_1mov_1_1check_pos.html
Дата изменения: Tue Sep 15 02:25:41 2015
Дата индексирования: Sun Apr 10 04:40:58 2016
Кодировка:
lsst.tcc: tcc.mov.checkPos Namespace Reference
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions | Variables
tcc.mov.checkPos Namespace Reference

Functions

def checkPos
 

Variables

list __all__ = ["checkPos"]
 

Function Documentation

def tcc.mov.checkPos.checkPos (   pos,
  minPos,
  maxPos,
  nearPos,
  wrapPref,
  doWrap 
)
Apply wrap preference and verify that position is in bounds

@param[in] pos  position, wrap unknown
@param[in] minPos  minimum allowed position
@param[in] maxPos  maximum allowed position
@param[in] nearPos  nearby angle (the reference for near wrap or doWrap)
@param[in] doWrap:
    if true (slewing): use wrapPref and unwrap as desired, avoiding limits
    if false (tracking): ignore wrapPref and only wrap near, even if out of bounds
@param[in] wrapPref  wrap preference; ignored if doWrap false
@return two items:
- outPos: wrapped position, or nan if errCode not AxisErr_OK
- errCode: one of:
    - AxisErr_OK if no error
    - AxisErr_MinPos if pos < minPos
    - AxisErr_MaxPos if pos > maxPos
    - AxisErr_CannotCompute if wrapPref = None and nearPos is not finite

@throw RuntimeError if wrapPref unknown (if doWrap true)

@warning: If the limits of motion span a range greater than 720 degrees,
this routine will not use the excess, unless doWrap false or wrapPref is "near".
See "details" for more information about the ranges used.

Details:
The limits minPos and maxPos are inclusive, meaning
outPos may equal either limit and still be in bounds.

The following ranges are used:
Wrap Preference     Range
doWrap false        [nearPos - 180, nearPos + 180)
WrapType_None       no change; outPos = pos

                    Ideal Range (may be adjusted to avoid limits)
WrapType_Nearest    [nearPos - 180, nearPos + 180)
WrapType_Negative   [meanPos - 360, meanPos)
WrapType_Middle     [meanPos - 180, meanPos + 180)
WrapType_Positive   [meanPos, meanPos + 360)

where:
- meanPos = (minPos + maxPos) / 2
- [,) means the lower limit is inclusive and the upper exclusive.
- Ideal Range means the range if limits are not an issue.
  If the upper end is out of bounds, both ends are decreased.
  Then if the lower end is out of bounds, both ends are increased.
  Then the position is wrapped and range checked.

The main equation:
Given an angle X and a range [A, A + 360),
the angle WrapX = X wrapped into the given range is given by:
WrapX = Y, if Y >= A, Y + 360 otherwise,
where
Y = ((X - A) mod 360) + A
and "mod" is the mathematical modulo function,
which is similar to the FORTRAN MOD function except that
S mod T is always in the range [0, T) (T > 0)

Definition at line 10 of file checkPos.py.

Variable Documentation

list tcc.mov.checkPos.__all__ = ["checkPos"]

Definition at line 8 of file checkPos.py.