Package gavo :: Package protocols :: Module scs
[frames] | no frames]

Module scs

source code

IVOA cone search: Helper functions, a core, and misc.

Classes
  SCSCore
A core performing cone searches.
Functions
 
findNClosest(alpha, delta, tableDef, n, fields, searchRadius=5)
returns the n objects closest around alpha, delta in table.
source code
 
parseHumanSpoint(cooSpec, colName=None)
tries to interpret cooSpec as some sort of cone center.
source code
 
getConeColumns(td)
returns the columns the cone search will use as positions in a tableDef.
source code
Variables
  __package__ = 'gavo.protocols'
Function Details

findNClosest(alpha, delta, tableDef, n, fields, searchRadius=5)

source code 

returns the n objects closest around alpha, delta in table.

n is the number of items returned, with the closest ones at the top, fields is a sequence of desired field names, searchRadius is a radius for the initial q3c search and will need to be lowered for dense catalogues and possibly raised for sparse ones.

The last item of each row is the distance of the object from the query center in degrees.

The query depends on postgastro extension (and should be changed to use pgsphere). It also requires the q3c extension.

parseHumanSpoint(cooSpec, colName=None)

source code 

tries to interpret cooSpec as some sort of cone center.

Attempted interpretations include various forms of coordinate pairs and simbad objects; hence, this will in general cause network traffic.

If no sense can be made, a ValidationError on colName is raised.

getConeColumns(td)

source code 

returns the columns the cone search will use as positions in a tableDef.

This will raise an error if these are not present or not unique. Both new-style and old-style UCDs are accepted.