|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
public interface Cone
AR Service: Query for Catalogs from Cone-Search Services (DAL).
Note:
This class provides functions to construct a DAL query.
To execute that query, see the examples and methods in the Dal class.
Cone.constructQuery(URI, double, double, double)
function:
Contructing a Cone Query (Python)
# connect to the AR
from xmlrpc import Server
from os.path import expanduser
ar = Server(file(expanduser('~/.astrogrid-desktop')).next().strip() +'xmlrpc')
cone = ar.ivoa.cone #take a reference to the AR Cone component
#the Cone service to query (selected using voexplorer)
service = "ivo://irsa.ipac/2MASS-PSC"
#resolve an object name to a position
pos = ar.cds.sesame.resolve('m54')
#build a query
query = cone.constructQuery(service,pos['ra'],pos['dec'],0.001)
print "QueryURL",query
Dal class.
QueryURL http://irsa.ipac.caltech.edu/cgi-bin/Oasis/CatSearch/nph-catsearch?CAT=fp_psc&RA=283.7636667&DEC=-30.4785&SR=0.0010
VERB parameter determines how many columns are to be returned by the service. From the Cone specification:
The query MAY contain the optional parameter, VERB, whose value is an integer - eitherA query that includes the VERB parameter can be constructed as follows:1,2, or3- which determines how many columns are to be returned in the resulting table. Support for this parameter by a Cone Search service implementation is optional. If the service supports the parameter, then when the value is1, the response should include the bare minimum of columns that the provider considers useful in describing the returned objects. When the value is3, the service should return all of the columns that are available for describing the objects. A value of2is intended for requesting a medium number of columns between the minimum and maximum (inclusive) that are considered by the provider to most typically useful to the user. When the VERB parameter is not provided, the server should respond as ifVERB=2. If theVERBparameter is not supported by the service, the service should ignore the parameter and should always return the same columns for every request.
Constructing a Query with the VERB parameter (Python)
#build a query, as before. query = cone.constructQuery(service,pos['ra'],pos['dec'],0.001) #add a 'verb' parameter query = cone.addOption(query,"VERB",3)
Dal interface, which provides functions to execute queries.
The functions listed within this interface are just for constructing that query.Dal| Method Summary | |
|---|---|
URL |
constructQuery(URI service,
double ra,
double dec,
double sr)
Construct a Cone-Search Query. |
| Methods inherited from interface org.astrogrid.acr.ivoa.Dal |
|---|
addOption, execute, executeAndSave, executeVotable, getRegistryQuery, getRegistryXQuery, saveDatasets, saveDatasetsSubset |
| Method Detail |
|---|
URL constructQuery(URI service,
double ra,
double dec,
double sr)
throws InvalidArgumentException,
NotFoundException
service - Resource Identifier or URL of the Service to query. Prefer providing a Resource Identifier, as this insulates against changes in service endpoint.
- Resource Identifier
- The resource ID of the Cone Search service to query, as returned by
Resource.getId(). Example:ivo://irsa.ipac/2MASS-XSC
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theConeCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
ra - right ascension e.g 6.950dec - declination e.g. -1.6sr - search radius e.g. 0.1Sesame - resolves object names to RA,Dec positions,
getRegistryXQuery() - a query to list all Cone Search Services.
Dal execute methods - such as Dal.executeAndSave(URL, URI)
InvalidArgumentException - if service is not a http:// or ivo:// reference
NotFoundException - if the service does not exist (i.e. cannot be resolved in reg)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||