cds.astro
Interface CheckPosition

All Known Implementing Classes:
CheckRadius

interface CheckPosition

The Qbox is a method for splitting the sky into a hierarchical
environment CDS , Simbad, VizieR ======

Version:
1.0 16-sep-2002, 1.01 Oct 2003 (MW) add a copy constructor, 1.02 jan 2004 (BB) ajout de la methode equals dans QBox. ------------- The routines provided in this module all deal with "qboxes". The qboxes are a way to split the celestial sphere in zones of approximately same surfaces and extension.

The dichotomic procedure uses the projections (X,Y) of the directions on the 6 faces of a cube numbered 1 (z=1), 2 (y=1), 3 (x=1), 4 (x=-1), 5 (y=-1) and 6 (z=-1).

Each cube face is then divided into 4 areas; each area is further divided into four pieces, etc. The number of valid qboxes is

   Level    Lower #      qboxes   qbox_size
      0           9           6     83
      1          36          24     41
      2         144          96     20
      3         576         384     10
      4        2304        1536      5
      5        9216        6144      230'
      6       36864       24576      115'
      7      147456       98304        40'
      8      589824      393216        20'
      9     2359296     1572864        10'
     10     9437184     6291456         5'
     11    37748736    25165824         2'30"
     12   150994944   100663296         1'15"
 
where level is a number which can be changed at any time using setLevel(level) method.

The present implementation assumes that level<=12, corresponding to a maximum of 28 bits in the qbox number.

For a level 6, the qbox number is a short integer with bits (from left to right) 1ppp xyxy xyxy xyxy. The leftmost `1' bit allows the recognition of the level; bits p represent the face number (1 to 6), x and y the position, expressed with level bits, along the axises defined above for the face; going one level down in the hierarchy is therefore just a shift of 2 bits and updating the 2 rightmost bits.

The selection of valid qboxes makes usage of an Enumeration which returns the valid qboxes via its nextElement method.

Author:
Francois Ochsenbein, Benoit Baranne (Stagiaire UTBM)

Field Summary
static boolean DEBUG
           
static int QBOX_ANY
           
static int QBOX_NONE
           
static int QBOX_SOME
           
 
Method Summary
 int checkTarget(int qbox)
          Checking the condition -- returns QBOX_NONE QBOX_ANY QBOX_SOME
 

Field Detail

QBOX_NONE

public static final int QBOX_NONE
See Also:
Constant Field Values

QBOX_ANY

public static final int QBOX_ANY
See Also:
Constant Field Values

QBOX_SOME

public static final int QBOX_SOME
See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values
Method Detail

checkTarget

public int checkTarget(int qbox)
Checking the condition -- returns QBOX_NONE QBOX_ANY QBOX_SOME