|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.join.AbstractSkyMatchEngine
uk.ac.starlink.table.join.EllipseSkyMatchEngine
public class EllipseSkyMatchEngine
MatchEngine implementation for ellipses on the surface of a (celestial)
sphere.
The tuples it uses are five-element arrays of Number
objects, as follows:
Two tuples are considered to match if their ellipses touch or partially overlap. The match score is a normalized value; it is zero for concentric ellipses, 1 if the centre of one ellipse falls on the circumference of the other, and 2 if the ellipses just touch. Intermediate values are assumed for intermediate situations.
Other RA/Dec-like sky coordinate systems may alternatively be used for the alpha/delta coordinates.
The calculations are approximate since in some cases they rely on projecting the ellipses onto a Cartesian plane before evaluating the match, so for large ellipses the criterion will be less exact. For objects the size of most observed stars and galaxies, this approximation is not expected to be problematic.
The calculations are currently done using numerical optimisation.
Field Summary |
---|
Fields inherited from interface uk.ac.starlink.table.join.MatchEngine |
---|
NO_BINS |
Constructor Summary | |
---|---|
EllipseSkyMatchEngine(SkyPixellator pixellator,
double scale)
Constructor. |
Method Summary | |
---|---|
boolean |
canBoundMatch()
Indicates that the MatchEngine.getMatchBounds(java.lang.Comparable[], java.lang.Comparable[]) method can be invoked
to provide some sort of useful result. |
java.lang.Object[] |
getBins(java.lang.Object[] tuple)
Returns a set of keys for bins into which possible matches for a given tuple might fall. |
java.lang.Comparable[][] |
getMatchBounds(java.lang.Comparable[] minTuple,
java.lang.Comparable[] maxTuple)
Given a range of tuple values, returns a range outside which no match to anything within that range can result. |
DescribedValue[] |
getMatchParameters()
Returns a set of DescribedValue objects whose values can be modified to modify the matching criteria. |
ValueInfo |
getMatchScoreInfo()
Returns a description of the value returned by the MatchEngine.matchScore(java.lang.Object[], java.lang.Object[]) method. |
double |
getScale()
Returns the length scale. |
ValueInfo[] |
getTupleInfos()
Returns a set of ValueInfo objects indicating what is required for the elements of each tuple. |
double |
matchScore(java.lang.Object[] tuple1,
java.lang.Object[] tuple2)
Indicates whether two tuples count as matching each other, and if so how closely. |
void |
setRecogniseCircles(boolean recogniseCircles)
Determines whether short cuts should be taken in the calculations when the ellipses are actually circles. |
void |
setScale(double scale)
Sets the length scale. |
java.lang.String |
toString()
|
Methods inherited from class uk.ac.starlink.table.join.AbstractSkyMatchEngine |
---|
calculateSeparation, getTuningParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EllipseSkyMatchEngine(SkyPixellator pixellator, double scale)
pixellator
- handles sky pixellisationscale
- initial value for length scale, in radiansMethod Detail |
---|
public void setScale(double scale)
setScale
in class AbstractSkyMatchEngine
scale
- rough value of per-object errors, in radianspublic double getScale()
getScale
in class AbstractSkyMatchEngine
public void setRecogniseCircles(boolean recogniseCircles)
recogniseCircles
- whether to take circle-specific short cutspublic ValueInfo[] getTupleInfos()
MatchEngine
public DescribedValue[] getMatchParameters()
MatchEngine
DescribedValue.setValue(java.lang.Object)
on the
returned objects.
public ValueInfo getMatchScoreInfo()
MatchEngine
MatchEngine.matchScore(java.lang.Object[], java.lang.Object[])
method. The content class should be numeric
(though need not be Double
), and the name,
description and units should be descriptive of whatever the
physical significance of the value is.
If the result of matchScore
is not interesting
(for instance, if it's always either 0 or -1),
null
may be returned.
public double matchScore(java.lang.Object[] tuple1, java.lang.Object[] tuple2)
MatchEngine
If there's no reason to do otherwise, the range 0..1 is recommended for successul matches. However, if the result has some sort of physical meaning (such as a distance in real space) that may be used instead.
tuple1
- one tupletuple2
- the other tuple
public java.lang.Object[] getBins(java.lang.Object[] tuple)
MatchEngine
tuple
- tuple
public boolean canBoundMatch()
MatchEngine
MatchEngine.getMatchBounds(java.lang.Comparable[], java.lang.Comparable[])
method can be invoked
to provide some sort of useful result.
public java.lang.Comparable[][] getMatchBounds(java.lang.Comparable[] minTuple, java.lang.Comparable[] maxTuple)
MatchEngine
Both the input and output rectangles are specified by tuples representing its opposite corners; equivalently, they are the minimum and maximum values of each tuple element. In either the input or output min/max tuples, any element may be null to indicate that no information is available on the bounds of that tuple element (coordinate).
This method can be used by match algorithms which know in advance the range of coordinates they will match against and wish to reduce workload by not attempting matches which are bound to fail.
For example, a 1-d Cartesian match engine with an isotropic match error 0.5 would turn input values of ((0,200),(10,210)) into output values ((-0.5,199.5),(10.5,210.5)).
This method will only be called if MatchEngine.canBoundMatch()
returns true. Thus engines that cannot provide any useful
information along these lines (for instance because none of its
tuple elements is Comparable
do not need to
implement it in a meaningful way.
minTuple
- tuple consisting of the minimum values of each
tuple element in a possible match
(to put it another way - coordinates of one corner of a
tuple-space rectangle containing such a match)maxTuple
- tuple consisting of the maximum values of each
tuple element in a possible match
(to put it another way - coordinates of the other corner of a
tuple-space rectangle containing such a match)
MatchEngine.canBoundMatch()
public java.lang.String toString()
toString
in class AbstractSkyMatchEngine
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |