StatQueries¶
- class servicemon.analysis.stat_queries.StatQueries(tap_url='http://navo01.ipac.caltech.edu/TAP', table='navostats2')[source]¶
Bases:
object
A helper class for querying a TAP service which has
servicemon
data.- Parameters
- tap_urlstr, default=’http://navo01.ipac.caltech.edu/TAP’
The endpoint for the TAP service
- tablestr, default=’navostats2’
The TAP service table containing the servicemon data
Attributes Summary
The PyVO TAPService object to be used in queries.
Methods Summary
do_query
(adql)Perform the specified synchronous TAP query on the
tap_service
.do_stat_query
([top, base_name, …])Perform a constrained synchronous TAP query on the
tap_service
and returns an Astropy Table with the results.Queries the database to find all unique (base_name, service_type) pairs and returns the results as a list of tuples.
Attributes Documentation
- tap_service¶
The PyVO TAPService object to be used in queries. Can also be used independently for TAP queries outside of
StatQueries
context.- Returns
- tap_service
TAPService
- tap_service
Methods Documentation
- do_query(adql)[source]¶
Perform the specified synchronous TAP query on the
tap_service
.- Parameters
- adqlstr
The ADQL query to perform
- do_stat_query(top=None, base_name=None, service_type=None, start_time=None, end_time=None)[source]¶
Perform a constrained synchronous TAP query on the
tap_service
and returns an Astropy Table with the results. This method will generated the ADQL for the query based on the constraints specified in the parameters.- Parameters
- topint or str, default=None
Maximum number of result rows (unlimited if None)
- base_namestr or list of str, default=None
If a str, it can include ADQL wildcard characters (‘%’). If a list of str, wilcards are not supported. A row matches if the base_name of the row is an exact match to any of the values in the list.
- service_typestr, default=None
If a str, it can include ADQL wildcard characters (‘%’). If a list of str, wilcards are not supported. A row matches if the service_type of the row is an exact match to any of the values in the list. Known service_type values include at least ‘cone’, ‘xcone’ and ‘tap’.
get_name_service_pairs
will show all of the base_name and service_type values currently present in the database.- start_timestr, default=None
If specified, rows will be returned only if their start_time value is lexically greater than or equal to this
start_time
value. The start_time format in the database is ‘YYYY-MM-DD HH:MM:SS.dddddd’ Since this uses a string comparison, thestart_time
need not include the least significant portion of the time, e.g., ‘2021-04-07’ would get all data from Apr 7, 2021 onward.- end_timestr, default=None
If specified, rows will be returned only if their end_time value is lexically less than or equal to this
end_time
value. The end_time format in the database is ‘YYYY-MM-DD HH:MM:SS.dddddd’ Since this uses a string comparison, theend_time
need not include the least significant portion of the time, e.g., ‘2021-04-16’ would get all data up to and including Apr 16, 2021.
- Returns
- data_table
Table
- data_table