|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
public interface Stap
AR Service: Query for Time series data from Simple Time Access Protocol (STAP) 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.
Dal for other things that
can be done with a query URL.
Query a Stap service and download a subset of the data (Python)
# connect to the AR
from xmlrpc import Server, DateTime
from os.path import expanduser
ar = Server(file(expanduser('~/.astrogrid-desktop')).next().strip() +'xmlrpc')
stap = ar.ivoa.stap #take a reference to the AR STAP component
#the STAP service to query (selected using voexplorer)
service = "ivo://mssl.ucl.ac.uk/stap-lasco"
#build a query
start = DateTime('20000101T00:00:00')
end = DateTime('20000102T00:00:00')
query = stap.constructQuery(service,start,end)
print "QueryURL",query
#execute the query
rows = stap.execute(query)
#inspect what we've got.
print "Rows Returned",len(rows)
import pprint
pprint.pprint(rows[0])
#download first datasets into current directory
#compute url for current directory
from urlparse import urlunsplit
from os import getcwd
currentDirURL = urlunsplit(['file','',getcwd(),'',''])
print "Downloading data to",currentDirURL
stap.saveDatasetsSubset(query,currentDirURL,[0])
QueryURL http://msslxx.mssl.ucl.ac.uk:8080/stap-lasco/StapSearch?service=astrogrid_stap&START=2000-01-01T00%3A00%3A00&END=2000-01-02T00%3A00%3A00
Rows Returned 3
{'Concept': ' Coronal Mass Ejection',
'Contact Email': ' eca@mssl.ucl.ac.uk',
'Contact Name': ' Elizabeth Auden',
'INST_ID': 'SOHO_LASCO',
'IVORN': 'ivo://mssl.ucl.ac.uk/LASCO#LASCO20000101T065405_21',
'Name': ' LASCO_20000101T065405_21',
'Parameters': ' Central Position Angle=21 deg, Angular Width=76 deg, Linear Speed=337 km/s, Acceleration=8.8 m/s^2, Mass=5.0e+15 g, Kinetic Energy=2.8e+30 erg, Measurement Position Angle=11 deg',
'References': ' C2 movie=http://lasco-www.nrl.navy.mil/daily_mpg/2000_01/000101_c2.mpg, C3 movie=http://lasco-www.nrl.navy.mil/daily_mpg/2000_01/000101_c3.mpg, SXT movie=http://cdaw.gsfc.nasa.gov/CME_list/daily_mpg/2000_01/sxt_almg.20000101.mpg, PHTX movie=http://cdaw.gsfc.nasa.gov/CME_list/daily_plots/sephtx/2000_01/sephtx.20000101.png, Java movie=http://cdaw.gsfc.nasa.gov/CME_list/daily_movies/2000/01/01, C2 movie / GOES light curve=http://cdaw.gsfc.nasa.gov/CME_list/UNIVERSAL/2000_01/jsmovies/2000_01/20000',
'VOX:AccessReference': ' http://msslxx.mssl.ucl.ac.uk:8080/voevent/xml/LASCO/LASCO_20000101T065405_21.xml',
'VOX:Format': 'VOEVENT',
'meta': 'LASCO CME VOEvents',
'meta.curation': 'CDAW (NASA/Goddard), via MSSL query',
'meta.ref.url': 'http://cdaw.gsfc.nasa.gov/CME_list/',
'meta.title': 'LASCO CMEs',
'time.obs.end': '2000-01-01T06:54:05',
'time.obs.start': '2000-01-01T06:54:05'}
Downloading data to file:///Users/noel/Documents/workspace/python
Dal,
Sesame - resolves object names to RA,Dec positions,
getRegistryXQuery() - a query to list all STAP Services.| Method Summary | |
|---|---|
URL |
constructQuery(URI service,
Date start,
Date end)
Construct a STAP Query on Time. |
URL |
constructQueryF(URI service,
Date start,
Date end,
String format)
Construct a STAP Query on Time and Format. |
URL |
constructQueryP(URI service,
Date start,
Date end,
double ra,
double dec,
double size)
Construct a STAP Query on Time and Position |
URL |
constructQueryPF(URI service,
Date start,
Date end,
double ra,
double dec,
double size,
String format)
Construct a STAP Query on Time, Position and Format |
URL |
constructQueryS(URI service,
Date start,
Date end,
double ra,
double dec,
double ra_size,
double dec_size)
Construct a STAP Query on Time and full Position |
URL |
constructQuerySF(URI service,
Date start,
Date end,
double ra,
double dec,
double ra_size,
double dec_size,
String format)
Construct a STAP Query on Time, full Position, and Format |
| Methods inherited from interface org.astrogrid.acr.ivoa.Dal |
|---|
addOption, execute, executeAndSave, executeVotable, getRegistryQuery, getRegistryXQuery, saveDatasets, saveDatasetsSubset |
| Method Detail |
|---|
URL constructQuery(URI service,
Date start,
Date end)
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 STAP service to query, as returned by
Resource.getId(). Example:ivo://mssl.ucl.ac.uk/stap-hinode-eis_2
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theStapCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
start - start date and timeend - end date and time
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 registry)
URL constructQueryF(URI service,
Date start,
Date end,
String format)
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 STAP service to query, as returned by
Resource.getId(). Example:ivo://mssl.ucl.ac.uk/stap-hinode-eis_2
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theStapCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
start - start date and timeend - end date and timeformat - format of images or time series data e.g. ALL
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 registry)
URL constructQueryP(URI service,
Date start,
Date end,
double ra,
double dec,
double size)
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 STAP service to query, as returned by
Resource.getId(). Example:ivo://mssl.ucl.ac.uk/stap-hinode-eis_2
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theStapCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
start - start date and timeend - end date and timera - right ascension e.g 6.950dec - declination e.g. -1.6size - radius of cone e.g. 0.1
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 registry)
URL constructQueryPF(URI service,
Date start,
Date end,
double ra,
double dec,
double size,
String format)
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 STAP service to query, as returned by
Resource.getId(). Example:ivo://mssl.ucl.ac.uk/stap-hinode-eis_2
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theStapCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
start - start date and timeend - end date and timera - right ascension e.g 6.950dec - declination e.g. -1.6size - radius of cone e.g. 0.1format - format of images or time series data e.g. ALL
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 registry)
URL constructQueryS(URI service,
Date start,
Date end,
double ra,
double dec,
double ra_size,
double dec_size)
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 STAP service to query, as returned by
Resource.getId(). Example:ivo://mssl.ucl.ac.uk/stap-hinode-eis_2
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theStapCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
start - start date and timeend - end date and timera - right ascension e.g 6.950dec - declination e.g. -1.6ra_size - size of ra e.g. 0.1dec_size - size of dec e.g. 0.2
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 registry)
URL constructQuerySF(URI service,
Date start,
Date end,
double ra,
double dec,
double ra_size,
double dec_size,
String format)
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 STAP service to query, as returned by
Resource.getId(). Example:ivo://mssl.ucl.ac.uk/stap-hinode-eis_2
TheRegistrywill be queried to resolve the resource ID into aResourceobject, from which theStapCapabilitywill be found, from which in turn the firstAccessURLwill be used.- URL of the Service
- The endpoint URL. Can be any
http://URL.
start - start date and timeend - end date and timera - right ascension e.g 6.950dec - declination e.g. -1.6ra_size - size of ra e.g. 0.1dec_size - size of dec e.g. 0.2format - format of images or time series data e.g. ALL
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 registry)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||