Region (javadoc for PixTools)
Date: 2012-07-30

gov.fnal.eag.healpix

## Class Region

- java.lang.Object
- - gov.fnal.eag.healpix.Region

-     public class Region
      extends java.lang.Object

  Author:
    kuropat The class represents square region on a sphere defined by raMin, raMax decMin,decMax in degrees. The dec varies from Pi/2 to -Pi/2. The ra varies from 0. inclusive to 2Pi exclusive. Negative value of ra will be corrected by adding 2Pi

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private BitManipulation` | `bm`
    `private double` | `decMax`
    `private double` | `decMin`
    `private static double` | `epsilon`
    `private double` | `phiMax`
    `private double` | `phiMin`
    `private double` | `PI`
    `private double` | `raMax`
    `private double` | `raMin`
    `private double` | `tetMax`
    `private double` | `tetMin`
    `private static double` | `TWOPI`
    `private java.util.ArrayList` | `vertices`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Region(double xMin, double xMax, double yMin, double yMax)` default constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[][]` | `getPolReg()` provides polar coordinates of the region vertices
    `java.util.ArrayList` | `getVertices()`
    `boolean` | `inReg(double ra, double dec)` return true if the point ra,dec is inside region
    `boolean` | `inRegPol(double phi, double theta)` return true if point phi, theta is inside region
    `java.util.ArrayList` | `pixelize(double precision)` divides region on HealPix pixels of given size including pixels that only partly inside the region

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TWOPI

          private static final double TWOPI

      See Also:
        Constant Field Values

    - #### raMin

          private double raMin

    - #### raMax

          private double raMax

    - #### decMin

          private double decMin

    - #### decMax

          private double decMax

    - #### tetMin

          private double tetMin

    - #### tetMax

          private double tetMax

    - #### phiMin

          private double phiMin

    - #### phiMax

          private double phiMax

    - #### epsilon

          private static final double epsilon

      See Also:
        Constant Field Values

    - #### vertices

          private java.util.ArrayList vertices

    - #### PI

          private double PI

    - #### bm

          private BitManipulation bm

  - ### Constructor Detail

    - #### Region

          public Region(double xMin,
                double xMax,
                double yMin,
                double yMax)

      default constructor
      Parameters:
        `xMin` - ra min in degrees
        `xMax` - ra max in degrees
        `yMin` - dec min in degrees
        `yMax` - dec max in degrees

  - ### Method Detail

    - #### inReg

          public boolean inReg(double ra,
                      double dec)

      return true if the point ra,dec is inside region
      Parameters:
        `ra` - in degrees
        `dec` - in degrees
      Returns:
        boolean true if inside the region

    - #### inRegPol

          public boolean inRegPol(double phi,
                         double theta)

      return true if point phi, theta is inside region
      Parameters:
        `phi` - in radians
        `theta` - in radians
      Returns:
        boolean true if in region

    - #### getVertices

          public java.util.ArrayList getVertices()

      Returns:
        ArrayList of 3d vectors of vertices of the region

    - #### pixelize

          public java.util.ArrayList pixelize(double precision)
                                       throws java.lang.Exception

      divides region on HealPix pixels of given size including pixels that only partly inside the region
      Parameters:
        `precision` - - angular size of the division element in arcsec
      Returns:
        ArrayList of pixel numbers in ring schema for specifyed resolution
      Throws:
        `java.lang.Exception`

    - #### getPolReg

          public double[][] getPolReg()

      provides polar coordinates of the region vertices
      Returns:
        array of corner coordinates in form of polar thete,phi angles.