uk.ac.starlink.table.join
Class SphericalPolarMatchEngine

java.lang.Object
  |
  +--uk.ac.starlink.table.join.CartesianMatchEngine
        |
        +--uk.ac.starlink.table.join.SphericalPolarMatchEngine
All Implemented Interfaces:
MatchEngine

public class SphericalPolarMatchEngine
extends CartesianMatchEngine

Match engine which works with tuples representing RA, Dec and range. Each tuple must be a 3-element array of Number objects: first element is Right Ascension in radians, second element is Declination in radians, third element is range (units are arbitrary, but will be the same as the error supplied in the constructor).


Field Summary
 
Fields inherited from class uk.ac.starlink.table.join.CartesianMatchEngine
CELL_SCALE
 
Constructor Summary
SphericalPolarMatchEngine(double err)
          Constructs a new match engine which will match on differences not greater than a given number err, in the same units that the range part of the tuples is specified.
 
Method Summary
 Object[] getBins(Object[] tuple)
          Returns a set of Cell objects representing the cell in which this tuple falls and somr or all of its neighbouring ones.
 double getError()
          Returns the isotropic error.
 ValueInfo[] getTupleInfos()
          Returns a set of ValueInfo objects indicating what is required for the elements of each tuple.
 boolean matches(Object[] tuple1, Object[] tuple2)
          Matches two tuples if they represent the coordinates of nearby points.
 void setErrors(double[] errs)
          Sets the errors for matching.
 String toString()
           
 
Methods inherited from class uk.ac.starlink.table.join.CartesianMatchEngine
getErrors, getMatchParameters, setError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SphericalPolarMatchEngine

public SphericalPolarMatchEngine(double err)
Constructs a new match engine which will match on differences not greater than a given number err, in the same units that the range part of the tuples is specified.

Parameters:
err - maximum separation for a match
Method Detail

matches

public boolean matches(Object[] tuple1,
                       Object[] tuple2)
Description copied from class: CartesianMatchEngine
Matches two tuples if they represent the coordinates of nearby points.

Specified by:
matches in interface MatchEngine
Overrides:
matches in class CartesianMatchEngine
Parameters:
tuple1 - ndim-element array of Number objects representing coordinates of first object
tuple2 - ndim-element array of Number objects representing coordinates of second object
Returns:
true if tuple1 and tuple2 fall within the same error ellipsoid

getBins

public Object[] getBins(Object[] tuple)
Description copied from class: CartesianMatchEngine
Returns a set of Cell objects representing the cell in which this tuple falls and somr or all of its neighbouring ones.

Specified by:
getBins in interface MatchEngine
Overrides:
getBins in class CartesianMatchEngine
Parameters:
tuple - ndim-element array of Number objects representing coordinates of an object

getTupleInfos

public ValueInfo[] getTupleInfos()
Description copied from interface: MatchEngine
Returns a set of ValueInfo objects indicating what is required for the elements of each tuple. The length of this array is the number of elements in the tuple. Each element should at least have a defined name and content class. The info's nullable attribute has a special meaning: if true it means that it makes sense for this element of the tuple to be always blank (for instance assigned to no column).

Specified by:
getTupleInfos in interface MatchEngine
Overrides:
getTupleInfos in class CartesianMatchEngine
Returns:
array of objects describing the requirements on each element of the tuples used for matching

toString

public String toString()
Overrides:
toString in class CartesianMatchEngine

setErrors

public void setErrors(double[] errs)
Sets the errors for matching.

Overrides:
setErrors in class CartesianMatchEngine
Parameters:
errs - array with all the same elements
Throws:
IllegalArgumentException - if not all elements of errs are equal (this would signal an anisotropic error range, not supported by this class)

getError

public double getError()
Returns the isotropic error. The units are the same as those that range is specified in.

Returns:
error margin for matches

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.