uk.ac.starlink.table.join
Class HEALPixMatchEngine

java.lang.Object
  extended by uk.ac.starlink.table.join.SkyMatchEngine
      extended by uk.ac.starlink.table.join.HEALPixMatchEngine
All Implemented Interfaces:
MatchEngine

public class HEALPixMatchEngine
extends SkyMatchEngine

SkyMatchEngine implementation which works using the HEALPix pixelisation scheme. This works better than the HTM-based one for two reasons:

  1. It tends to be much faster to calculate a list of small pixels in a region, since the calculations are not hierarchical
  2. The pixels are square which means they generally have fewer neighbours than triangular HTM ones of a similar size

This implementation is based on the PixTools Java HEALPix classes written by Nickolai Kouropatkine at Fermilab.

See Also:
http://home.fnal.gov/~kuropat/HEALPIX/PixTools.html

Field Summary
 
Fields inherited from interface uk.ac.starlink.table.join.MatchEngine
NO_BINS
 
Constructor Summary
HEALPixMatchEngine(double separation, boolean useErrors)
          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
 int calculateDefaultK(double sep)
          Determines a default value to use for the HEALPix k parameter based on a given separation.
protected  Object[] getBins(double ra, double dec, double err)
          Returns a set of keys for bins into which possible matches for a given sky position, with a given error, might fall.
 int getHealpixK()
          Returns the HEALPix k value, which determines sky pixel size, equivalent to log2(nside).
 DescribedValue[] getTuningParameters()
          Returns a set of DescribedValue objects whose values can be modified to tune the performance of the match.
 void setHealpixK(int healpixK)
          Sets the HEALPix k value, which determines sky pixel size, equivalent to log2(nside).
 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.
 
Methods inherited from class uk.ac.starlink.table.join.SkyMatchEngine
calculateSeparation, canBoundMatch, getBins, getMatchBounds, getMatchParameters, getMatchScoreInfo, getSeparation, getTupleInfos, getUseErrors, matchScore, setUseErrors, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HEALPixMatchEngine

public HEALPixMatchEngine(double separation,
                          boolean useErrors)
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
useErrors - if true, per-row errors can be specified as a third element of the tuples; otherwise only the fixed separation value counts
Method Detail

setSeparation

public void setSeparation(double separation)
Description copied from class: SkyMatchEngine
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.

Overrides:
setSeparation in class SkyMatchEngine
Parameters:
separation - match radius in radians

getBins

protected Object[] getBins(double ra,
                           double dec,
                           double err)
Description copied from class: SkyMatchEngine
Returns a set of keys for bins into which possible matches for a given sky position, with a given error, might fall. The returned objects can be anything, but should have their equals and hashCode methods implemented properly for comparison. The err value will not be greater than the current result of getSeparation.

Specified by:
getBins in class SkyMatchEngine
Parameters:
ra - right ascension of point to test (radians)
dec - declination of point to test (radians)
err - possible distance away from given location of match
See Also:
SkyMatchEngine.getBins(java.lang.Object[])

getTuningParameters

public DescribedValue[] getTuningParameters()
Description copied from interface: MatchEngine
Returns a set of DescribedValue objects whose values can be modified to tune the performance of the match. This match engine's performance can be influenced by calling DescribedValue.setValue(java.lang.Object) on the returned objects.

Changing these values will make no difference to the output of MatchEngine.matchScore(java.lang.Object[], java.lang.Object[]), but may change the output of MatchEngine.getBins(java.lang.Object[]). This may change the CPU and memory requirements of the match, but will not change the result. The default value should be something sensible, so that setting the value of these parameters is not in general required.

Returns:
array of described values which may influence match performance

setHealpixK

public void setHealpixK(int healpixK)
Sets the HEALPix k value, which determines sky pixel size, equivalent to log2(nside). May be in the range 0 (60deg) to 20 (0.2"). If set to -1, a suitable value will be used based on the separation.

Parameters:
healpixK - new k value

getHealpixK

public int getHealpixK()
Returns the HEALPix k value, which determines sky pixel size, equivalent to log2(nside). The returned may be the result of a default determination based on separation if no explicit K value has been set hitherto, and a non-zero separation is available.

Returns:
k value used by this engine

calculateDefaultK

public int calculateDefaultK(double sep)
Determines a default value to use for the HEALPix k parameter based on a given separation.

Parameters:
sep - max sky separation angle for a match, in radians

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