Package uk.ac.starlink.ttools.cone
Class ConeMatcher
java.lang.Object
uk.ac.starlink.ttools.cone.ConeMatcher
TableProducer which does the work for a multiple cone search-type
sky crossmatch operation.
- Since:
- 31 Aug 2007
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Object which produces the result table. -
Constructor Summary
ConstructorsConstructorDescriptionConeMatcher
(ConeSearcher coneSearcher, ConeErrorPolicy errAct, TableProducer inProd, QuerySequenceFactory qsFact, boolean bestOnly) Convenience constructor which selects default values for most options.ConeMatcher
(ConeSearcher coneSearcher, ConeErrorPolicy errAct, TableProducer inProd, QuerySequenceFactory qsFact, boolean bestOnly, Coverage coverage, boolean includeBlanks, boolean distFilter, int parallelism, String copyColIdList, String distanceCol, uk.ac.starlink.table.JoinFixAction inFixAct, uk.ac.starlink.table.JoinFixAction coneFixAct) Full-functioned constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns an object which can compute the multi-cone result.static uk.ac.starlink.table.StarTable
getConeResult
(ConeSearcher coneSearcher, ConeErrorPolicy errAct, boolean bestOnly, boolean distFilter, String distanceCol, double ra0, double dec0, double sr) Performs a cone search and returns the resulting table with appropriate filtering operations applied.void
setStreamOutput
(boolean streamOutput) Determines whether this object'screateConeWorker()
method will produce a one-read-only table or not.
-
Constructor Details
-
ConeMatcher
public ConeMatcher(ConeSearcher coneSearcher, ConeErrorPolicy errAct, TableProducer inProd, QuerySequenceFactory qsFact, boolean bestOnly) Convenience constructor which selects default values for most options.- Parameters:
coneSearcher
- cone search implementationerrAct
- defines action on cone search invocation errorinProd
- source of input table (containing each crossmatch specification)qsFact
- object which can produce a ConeQueryRowSequencebestOnly
- true iff only the best match for each input table row is required, false for all matches within radius
-
ConeMatcher
public ConeMatcher(ConeSearcher coneSearcher, ConeErrorPolicy errAct, TableProducer inProd, QuerySequenceFactory qsFact, boolean bestOnly, Coverage coverage, boolean includeBlanks, boolean distFilter, int parallelism, String copyColIdList, String distanceCol, uk.ac.starlink.table.JoinFixAction inFixAct, uk.ac.starlink.table.JoinFixAction coneFixAct) Full-functioned constructor.- Parameters:
coneSearcher
- cone search implementationerrAct
- defines action on cone search invocation errorinProd
- source of input table (containing each crossmatch specification)qsFact
- object which can produce a ConeQueryRowSequencebestOnly
- true iff only the best match for each input table row is required, false for all matches within radiuscoverage
- coverage for cone searcher, or nullincludeBlanks
- true iff a row is to be output for input rows for which the cone search has no matchesdistFilter
- true to perform post-query filtering on results based on the distance between the query position and the result row positionparallelism
- number of threads to concurrently execute matches - only >1 if coneSearcher is thread-safecopyColIdList
- space-separated list of column identifiers for columns to be copied to the output table, "*" for all columnsdistanceCol
- name of column to hold position separation values, or null for no separation columninFixAct
- column name deduplication action for input tableconeFixAct
- column name deduplication action for result of cone searches
-
-
Method Details
-
setStreamOutput
public void setStreamOutput(boolean streamOutput) Determines whether this object'screateConeWorker()
method will produce a one-read-only table or not. If set true, then the output table is good for only a single read (getRowSequence
may be called only once). The default is false.- Parameters:
streamOutput
- whether output is streamed
-
createConeWorker
public ConeMatcher.ConeWorker createConeWorker() throws IOException, uk.ac.starlink.task.TaskExceptionReturns an object which can compute the multi-cone result. The result is a join between the input table and the table on which the cone searches are defined. See theConeWorker
documentation for how to use the returned object.Note
: if thestreamOut
attribute of this ConeMatcher has been set the table produced by the returned worker will be one-read-only, designed for streaming.- Returns:
- cone worker which can produce the result table
- Throws:
IOException
uk.ac.starlink.task.TaskException
-
getConeResult
public static uk.ac.starlink.table.StarTable getConeResult(ConeSearcher coneSearcher, ConeErrorPolicy errAct, boolean bestOnly, boolean distFilter, String distanceCol, double ra0, double dec0, double sr) throws IOException Performs a cone search and returns the resulting table with appropriate filtering operations applied. The resulting table may contain fewer rows than the output of the actual query; ifbestOnly
is true, only the best match will be included, and ifdistFilter
is true, then only those rows whose sky position falls strictly within the specified search radius will be included.If a non-null
distanceCol
parameter is supplied, the final column in the table will contain the angle in degrees between the region centre and the position described in the row.If no records in the cone are found, the return value may either be null or (preferably) an empty table with the correct columns.
- Parameters:
coneSearcher
- cone search implementationerrAct
- defines action on cone search invocation errorbestOnly
- true iff only the best match for each input table row is required, false for all matches within radiusdistFilter
- true to perform post-query filtering on results based on the distance between the query position and the result row positiondistanceCol
- name of column to hold distance information int output table, or nullra0
- right ascension in degrees of region centredec0
- declination in degrees of region centresr
- search radius in degrees- Returns:
- filtered result table, or null
- Throws:
IOException
-