healpix.core
Class NestedFace

java.lang.Object
  extended byhealpix.core.NestedFace
Direct Known Subclasses:
EquatorNestFace, PolarNF

public abstract class NestedFace
extends java.lang.Object

A class representing a face in Healpix - this is abstract faces are either Northern, Southern or Equatorial. This represents the Nested Scheme.


Field Summary
protected  NestedFace[] adjacent
           
protected  int face
           
protected  int npface
           
protected  int nside
           
protected  int offset
          offset number of pixels before this faces e.g.
 
Constructor Summary
protected NestedFace(int facenum, NestedMap map)
          Constructor - can not be called directly use getFace
 
Method Summary
 NestedFace[] adjacentFaces()
          Faces which are adjacent to the given face - There are 6.
 NestedFace[] adjacentFaces(java.awt.Point p)
          Faces which are adjacent to the given point in the given face - this is none if its in side a face but you should not be calling this in that case
protected static NestedFace[] assemble(NestedFace[] inp, int i1, int i2)
          Conveinence function to select items from an array
protected static NestedFace[] assemble(NestedFace[] inp, int i1, int i2, int i3)
          Conveinence function to select items from an array
 int[][] box(int pix, int nspix, int wepix)
          Get pixelnumbers of the neighours of a pixel in this face.
abstract  NestedFace[] eCornerNeigh()
           
abstract  NestedFace eFaceNeigh()
           
abstract  NestedFace eTipNeigh()
           
 int faceNum()
           
protected  void fillBoxECorner(int[][] theBox, int xd, int yd)
          Take a chunk of pixel numebrs from a face on East corner.
protected  void fillBoxNCorner(int[][] theBox, int xd, int yd)
          Take a chunk of pixel numebrs from a face on North corner.
protected  void fillBoxNE(int[][] theBox, int ymin, int ymax, int bx, int by)
          Take a chunk of pixel numebrs from a face on the North East.
protected  void fillBoxNW(int[][] theBox, int xmin, int xmax, int bx, int by)
          Take a chunk of pixel numebrs from a face on the North West .ximn and xmax are the Healpix X values to look for.
protected  void fillBoxSCorner(int[][] theBox, int xd, int yd)
          Take a chunk of pixel numbers from a face on South corner.
protected  void fillBoxSE(int[][] theBox, int xmin, int xmax, int bx, int by)
          Take a chunk of pixel numebrs from a face on the South East.ximn and xmax are the Healpix X values to look for.
protected  void fillBoxSW(int[][] theBox, int ymin, int ymax, int bx, int by)
          Take a chunk of pixel numebrs from a face on the South West .
 void fillBoxVal(int[][] theBox, int val, int xmin, int ymin, int xd, int yd)
          Put givin value in a square of the 2'd array starting at xmin,yim for xd,yd elements.
protected  void fillBoxWCorner(int[][] theBox, int xd, int yd)
          Take a chunk of pixel numebrs from a face on West corner.
protected abstract  void findAdjacentFaces()
          actually find the faces if - will be called from adjacentfaces as required, this should populate adjacent.
static NestedFace getFace(int facenum, NestedMap imap)
          Faces are constructed according to number, this get method is a factory for the correct type of face
 int[] internalNeigh(java.awt.Point p)
          Pixels which are adjacent to the given point inside this face returns an array of pixel numbers
abstract  NestedFace[] nCornerNeigh()
           
 int[] neighbours(int pix)
           
 int[] neighbours(java.awt.Point p)
          Pixels which are adjacent to the given point in this face returns an array of pixel numbers
abstract  NestedFace nFaceNeigh()
           
abstract  NestedFace nTipNeigh()
           
 java.awt.Point pix2xy(int pix)
          Convert a pix number to x,y within the face
abstract  int[] pixEcorner()
          Neighbours of the pixel in the east corner
 int[] pixEside(int x)
          Pixels borderinng the pixel on the (south)east face.
 int[] pixNcorner()
          Neighbours of the pixel in the north corner
 int[] pixNside(int y)
          Pixels borderinng the pixel on the nortth(east )face.
 int[] pixScorner()
          Neighbours of the pixel in the south corner
 int[] pixSside(int y)
          Pixels borderinng the pixel on the south(west) face.
abstract  int[] pixWcorner()
          Neighbours of the pixel in the west corner
 int[] pixWside(int x)
          Pixels borderinng the pixel on the (north)west face.
abstract  NestedFace[] sCornerNeigh()
           
abstract  NestedFace sFaceNeigh()
           
abstract  NestedFace sTipNeigh()
           
abstract  NestedFace[] wCornerNeigh()
           
abstract  NestedFace wFaceNeigh()
           
abstract  NestedFace wTipNeigh()
           
 int xy2pix(int x, int y)
          Convert an x and y to a pix number within the face
 int xy2pix(java.awt.Point p)
          Convert an x and y to a pix number within the face
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

face

protected int face

nside

protected int nside

npface

protected int npface

offset

protected int offset
offset number of pixels before this faces e.g. (face*(nside*nside))-1 this has to be added to any internal pixel number to find its actual pixel number.


adjacent

protected NestedFace[] adjacent
Constructor Detail

NestedFace

protected NestedFace(int facenum,
                     NestedMap map)
Constructor - can not be called directly use getFace

Method Detail

getFace

public static NestedFace getFace(int facenum,
                                 NestedMap imap)
                          throws java.lang.Exception
Faces are constructed according to number, this get method is a factory for the correct type of face

Throws:
java.lang.Exception

adjacentFaces

public NestedFace[] adjacentFaces()
                           throws java.lang.Exception
Faces which are adjacent to the given face - There are 6. They are returned in clockwise order starting south In each face the first pixel is in the lowest corner of the diamond the faces are (x,y) coordinate on each face . . . . <--- North Pole / \ / \ / \ / \ ^ ^ . 0 . 1 . 2 . 3 . <--- z = 2/3 \ / \ / \ / \ / \ / y \ / x 4 . 5 . 6 . 7 . 4 <--- equator \ / / \ / \ / \ / \ \/ . 8 . 9 .10 .11 . <--- z = -2/3 (0,0) : lowest corner \ / \ / \ / \ / . . . . <--- South Pole This reurns adjacent if it is already filled otherwise it used the abstract method findAdjacentFaces to have it filed first.

Throws:
java.lang.Exception

adjacentFaces

public NestedFace[] adjacentFaces(java.awt.Point p)
                           throws java.lang.Exception
Faces which are adjacent to the given point in the given face - this is none if its in side a face but you should not be calling this in that case

Throws:
java.lang.Exception

internalNeigh

public int[] internalNeigh(java.awt.Point p)
                    throws java.lang.Exception
Pixels which are adjacent to the given point inside this face returns an array of pixel numbers

Throws:
java.lang.Exception

neighbours

public int[] neighbours(java.awt.Point p)
                 throws java.lang.Exception
Pixels which are adjacent to the given point in this face returns an array of pixel numbers

Throws:
java.lang.Exception

assemble

protected static NestedFace[] assemble(NestedFace[] inp,
                                       int i1,
                                       int i2)
Conveinence function to select items from an array


assemble

protected static NestedFace[] assemble(NestedFace[] inp,
                                       int i1,
                                       int i2,
                                       int i3)
Conveinence function to select items from an array


nCornerNeigh

public abstract NestedFace[] nCornerNeigh()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

sCornerNeigh

public abstract NestedFace[] sCornerNeigh()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

wCornerNeigh

public abstract NestedFace[] wCornerNeigh()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

eCornerNeigh

public abstract NestedFace[] eCornerNeigh()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

nFaceNeigh

public abstract NestedFace nFaceNeigh()
                               throws java.lang.Exception
Throws:
java.lang.Exception

sFaceNeigh

public abstract NestedFace sFaceNeigh()
                               throws java.lang.Exception
Throws:
java.lang.Exception

wFaceNeigh

public abstract NestedFace wFaceNeigh()
                               throws java.lang.Exception
Throws:
java.lang.Exception

eFaceNeigh

public abstract NestedFace eFaceNeigh()
                               throws java.lang.Exception
Throws:
java.lang.Exception

sTipNeigh

public abstract NestedFace sTipNeigh()
                              throws java.lang.Exception
Throws:
java.lang.Exception

wTipNeigh

public abstract NestedFace wTipNeigh()
                              throws java.lang.Exception
Throws:
java.lang.Exception

eTipNeigh

public abstract NestedFace eTipNeigh()
                              throws java.lang.Exception
Throws:
java.lang.Exception

nTipNeigh

public abstract NestedFace nTipNeigh()
                              throws java.lang.Exception
Throws:
java.lang.Exception

findAdjacentFaces

protected abstract void findAdjacentFaces()
                                   throws java.lang.Exception
actually find the faces if - will be called from adjacentfaces as required, this should populate adjacent.

Throws:
java.lang.Exception

faceNum

public int faceNum()

xy2pix

public int xy2pix(java.awt.Point p)
           throws java.lang.Exception
Convert an x and y to a pix number within the face

Throws:
java.lang.Exception

pix2xy

public java.awt.Point pix2xy(int pix)
                      throws java.lang.Exception
Convert a pix number to x,y within the face

Throws:
java.lang.Exception

xy2pix

public int xy2pix(int x,
                  int y)
           throws java.lang.Exception
Convert an x and y to a pix number within the face

Throws:
java.lang.Exception

neighbours

public int[] neighbours(int pix)
                 throws java.lang.Exception
Throws:
java.lang.Exception

pixScorner

public int[] pixScorner()
                 throws java.lang.Exception
Neighbours of the pixel in the south corner

Throws:
java.lang.Exception

pixWcorner

public abstract int[] pixWcorner()
                          throws java.lang.Exception
Neighbours of the pixel in the west corner

Throws:
java.lang.Exception

pixNcorner

public int[] pixNcorner()
                 throws java.lang.Exception
Neighbours of the pixel in the north corner

Throws:
java.lang.Exception

pixEcorner

public abstract int[] pixEcorner()
                          throws java.lang.Exception
Neighbours of the pixel in the east corner

Throws:
java.lang.Exception

pixSside

public int[] pixSside(int y)
               throws java.lang.Exception
Pixels borderinng the pixel on the south(west) face.

Throws:
java.lang.Exception

pixNside

public int[] pixNside(int y)
               throws java.lang.Exception
Pixels borderinng the pixel on the nortth(east )face.

Throws:
java.lang.Exception

pixWside

public int[] pixWside(int x)
               throws java.lang.Exception
Pixels borderinng the pixel on the (north)west face.

Throws:
java.lang.Exception

pixEside

public int[] pixEside(int x)
               throws java.lang.Exception
Pixels borderinng the pixel on the (south)east face.

Throws:
java.lang.Exception

fillBoxVal

public void fillBoxVal(int[][] theBox,
                       int val,
                       int xmin,
                       int ymin,
                       int xd,
                       int yd)
Put givin value in a square of the 2'd array starting at xmin,yim for xd,yd elements.


box

public int[][] box(int pix,
                   int nspix,
                   int wepix)
            throws java.lang.Exception
Get pixelnumbers of the neighours of a pixel in this face.

Throws:
java.lang.Exception

fillBoxNE

protected void fillBoxNE(int[][] theBox,
                         int ymin,
                         int ymax,
                         int bx,
                         int by)
                  throws java.lang.Exception
Take a chunk of pixel numebrs from a face on the North East. ymin and ymax are the Healpix Y values to look for. Size of the box gives the limit on X, bx and by give the location in the Box to fill in from . For north faces this is filled with -1.

Throws:
java.lang.Exception

fillBoxSE

protected void fillBoxSE(int[][] theBox,
                         int xmin,
                         int xmax,
                         int bx,
                         int by)
                  throws java.lang.Exception
Take a chunk of pixel numebrs from a face on the South East.ximn and xmax are the Healpix X values to look for. Size of the box gives the limit on Y, bx and by give the location in the Box to fill in from. SouthNestFace fills this with -1 by overridding this method.

Throws:
java.lang.Exception

fillBoxNW

protected void fillBoxNW(int[][] theBox,
                         int xmin,
                         int xmax,
                         int bx,
                         int by)
                  throws java.lang.Exception
Take a chunk of pixel numebrs from a face on the North West .ximn and xmax are the Healpix X values to look for. Size of the box gives the limit on Y, bx and by give the location in the Box to fill in from. NorthNestFace fills this with -1 by overridding this method.

Throws:
java.lang.Exception

fillBoxSW

protected void fillBoxSW(int[][] theBox,
                         int ymin,
                         int ymax,
                         int bx,
                         int by)
                  throws java.lang.Exception
Take a chunk of pixel numebrs from a face on the South West . ymin and ymax are the Healpix Y values to look for. bx limits x by gives the y offset in the Box to fill in from . For south faces this is filled with -1 (SouthNestFace overrides this method)..

Throws:
java.lang.Exception

fillBoxECorner

protected void fillBoxECorner(int[][] theBox,
                              int xd,
                              int yd)
                       throws java.lang.Exception
Take a chunk of pixel numebrs from a face on East corner. xd and yd are the Healpix X an Y number of pixels to go into the corner Face. The rest can be worked out from theBox dimensions .

Throws:
java.lang.Exception

fillBoxWCorner

protected void fillBoxWCorner(int[][] theBox,
                              int xd,
                              int yd)
                       throws java.lang.Exception
Take a chunk of pixel numebrs from a face on West corner. xd and yd are the Healpix X an Y number of pixels to go into the corner Face. The rest can be worked out from theBox dimensions .

Throws:
java.lang.Exception

fillBoxNCorner

protected void fillBoxNCorner(int[][] theBox,
                              int xd,
                              int yd)
                       throws java.lang.Exception
Take a chunk of pixel numebrs from a face on North corner. xd and yd are the Healpix X an Y number of pixels to go into the corner Face. The rest can be worked out from theBox dimensions .

Throws:
java.lang.Exception

fillBoxSCorner

protected void fillBoxSCorner(int[][] theBox,
                              int xd,
                              int yd)
                       throws java.lang.Exception
Take a chunk of pixel numbers from a face on South corner. xd and yd are the Healpix X an Y number of pixels to go into the corner Face. The rest can be worked out from theBox dimensions .

Throws:
java.lang.Exception