uk.ac.starlink.table.join
Class HTMMatchEngine

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

public class HTMMatchEngine
extends Object
implements MatchEngine

Implements the object matching interface for sky coordinates (RA, Dec) using the HTM (Hierarchical Triangular Mesh) scheme. The tuples it uses are two-element arrays of Number objects, the first giving Right Ascension in radians, and the second giving Declination in radians. The separation attribute indicates how many radians may separate two points on the celestial sphere for them to be considered matching.

See Also:

Field Summary
static double MESH_SCALE
          Scaling factor which determines the size of the mesh cells used as a multiple of the size of the separation.
 
Constructor Summary
HTMMatchEngine(double separation)
          Constructs a new match engine which considers two points (RA,Dec tuples) to match if they are within a given angular distance on the celestial sphere.
 
Method Summary
 Object[] getBins(Object[] radec)
          Returns all the HTM cells which fall wholly or partially within separation radians of a given position.
 DescribedValue[] getMatchParameters()
          Returns a set of DescribedValue objects whose values can be modified to modify the matching criteria.
 double getSeparation()
          Returns the separation between points within which they will be considered to match.
 ValueInfo[] getTupleInfos()
          Returns a set of ValueInfo objects indicating what is required for the elements of each tuple.
 boolean matches(Object[] radec1, Object[] radec2)
          Matches two tuples representing RA,Dec coordinates if they are within separation radians of each other on the sky.
 void setSeparation(double separation)
          Configures this match engine to consider two points (RA,Dec tuples) to match if they are within a given angular distance on the celestial sphere.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MESH_SCALE

public static final double MESH_SCALE
Scaling factor which determines the size of the mesh cells used as a multiple of the size of the separation. It can be used as a tuning parameter. It must be >1.

See Also:
Constant Field Values
Constructor Detail

HTMMatchEngine

public HTMMatchEngine(double separation)
Constructs a new match engine which considers two points (RA,Dec tuples) to match if they are within a given angular distance on the celestial sphere.

Parameters:
separation - match radius in radians
Method Detail

setSeparation

public void setSeparation(double separation)
Configures this match engine to consider two points (RA,Dec tuples) to match if they are within a given angular distance on the celestial sphere.

Parameters:
separation - match radius in radians

getSeparation

public double getSeparation()
Returns the separation between points within which they will be considered to match.

Returns:
match radius in radians

matches

public boolean matches(Object[] radec1,
                       Object[] radec2)
Matches two tuples representing RA,Dec coordinates if they are within separation radians of each other on the sky.

Specified by:
matches in interface MatchEngine
Parameters:
radec1 - 2-element array of Number objects giving RA & dec of first point
radec2 - 2-element array of Number objects giving RA & dec of second point
Returns:
true iff radec1 is close to radec2

getBins

public Object[] getBins(Object[] radec)
Returns all the HTM cells which fall wholly or partially within separation radians of a given position.

Specified by:
getBins in interface MatchEngine
Parameters:
radec - 2-element array of Number objects giving RA & Dec of the position to test
Returns:
set of bin keys which might be returned by invoking this method on other tuples which count as matches for the submitted tuple

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
Returns:
array of objects describing the requirements on each element of the tuples used for matching

getMatchParameters

public DescribedValue[] getMatchParameters()
Description copied from interface: MatchEngine
Returns a set of DescribedValue objects whose values can be modified to modify the matching criteria. Typically at least one of these will be some sort of tolerance separation which determines how close tuples must be to count as a match. This match engine's behaviour can be modified by calling DescribedValue.setValue(java.lang.Object) on the returned objects.

Specified by:
getMatchParameters in interface MatchEngine
Returns:
array of described values which influence the match

toString

public String toString()
Overrides:
toString in class Object

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