astro.services.gowise package

Submodules

astro.services.gowise.GoWiseQuery module

Module with GoWiseQuery Class

class astro.services.gowise.GoWiseQuery.GoWiseQuery(*args, **kwargs)

Bases: common.config.ProfileThread.ProfileThread

class for running (GoWise) queries in a seperate thread

do_all_queries()

do the querying

do_query(sql, args)

do one query

sql_from_where(object_cls)

get the sql from and where part, also return the arguments of the where clause

sql_where_coords_bb()

return sql where on coordinates for BoundingBoxes

sql_where_coords_sl()

return sql where on coordinates for SourceList

sql_where_objectname()

get the where clause for the object name query depending whether the user used * or ? in the object name, use like or = as operator

astro.services.gowise.GoWiseTable module

HtmlGoWise Table Renderer, renders results in table form

WJ Vriend

class astro.services.gowise.GoWiseTable.GoWiseRender

Bases: object

GoWise base render class

get_attr(object_cls, row, attr, default='')

get attribute value from row, if not present return default, use parent

get_attr_index(object_cls, attr)

look up the attr index for object class, use parent

class astro.services.gowise.GoWiseTable.GoWiseTableRender(parent, results)

Bases: astro.services.gowise.GoWiseTable.GoWiseRender

render GoWise results as table

make_table_heading(object_str)

generate a table heading for the given class

make_table_row(db_row, project, object_str, count)

generate a table row from the given db_row

render()

render the results as html table

astro.services.gowise.GoWiseThumbnail module

GoWise Thumbnail Renderer

Renders GoWise results as thumbnails

WJ Vriend

class astro.services.gowise.GoWiseThumbnail.GoWiseThumbnailRender(parent, results)

Bases: astro.services.gowise.GoWiseTable.GoWiseRender

div_tag(img, instrument, filter, chip)

return the thumbnail div tag

image_template = '<img src="%(imageserver_link)s" alt="" width="%(width)d"/>\n'
image_template_jail = '<img class="lazy" data-href="%(imageserver_link)s" alt="" src="%(path)s/loading.gif" width="%(width)d"/>\n<noscript>\n <img src="%(imageserver_link)s" width="%(width)d"/>\n</noscript>\n'
img_tag(imageserver_link, width)

return the img html tag

img_tag_jail(imageserver_link, width)

return the img html tag for jail

img_width = 100
make_attributes_tip(row, object_cls)

make a popup (tip) table with all attributes

render()

render the thumbnail page

astro.services.gowise.HtmlGoWise module

HtmlGoWise.py author : WJ Vriend (wjvriend[AT]astro.rug.nl) Python file for generating Go(ogle)-WISE html

class astro.services.gowise.HtmlGoWise.HtmlGoWise(args)

Bases: common.services.general.HtmlBase.HtmlBase

URL_NAME = 'GoWISE'
all_objects = [<class 'astro.main.RawFrame.RawScienceFrame'>, <class 'astro.main.ReducedScienceFrame.ReducedScienceFrame'>, <class 'astro.main.RegriddedFrame.RegriddedFrame'>, <class 'astro.main.RegriddedFrame.CoaddedRegriddedFrame'>, <class 'astro.main.SourceList.SourceList'>, <class 'astro.main.RadioCube.RadioFrame'>]
attributes = {<class 'astro.main.RadioCube.RadioFrame'>: ('project', 'creator', 'privileges', 'instrument', 'frequency', 'NAXIS1', 'NAXIS2', 'creation_date', 'centerRA', 'centerDEC', 'filename'), <class 'astro.main.RegriddedFrame.RegriddedFrame'>: ('project', 'creator', 'privileges', 'instrument', 'filter', 'chip', 'NAXIS1', 'NAXIS2', 'DATE_OBS', 'creation_date', 'OBJECT', 'centerRA', 'centerDEC', 'filename'), <class 'astro.main.RegriddedFrame.CoaddedRegriddedFrame'>: ('project', 'creator', 'privileges', 'instrument', 'filter', 'NAXIS1', 'NAXIS2', 'creation_date', 'OBJECT', 'centerRA', 'centerDEC', 'filename'), <class 'astro.main.SourceList.SourceList'>: ('project', 'creator', 'privileges', 'instrument', 'filter', 'chip', 'SLID', 'number_of_sources', 'creation_date', 'OBJECT', 'center_RA', 'center_DEC', 'name', 'frame_filename'), <class 'astro.main.RawFrame.RawScienceFrame'>: ('project', 'creator', 'privileges', 'instrument', 'filter', 'chip', 'NAXIS1', 'NAXIS2', 'EXPTIME', 'DATE_OBS', 'creation_date', 'OBJECT', 'centerRA', 'centerDEC', 'filename'), <class 'astro.main.ReducedScienceFrame.ReducedScienceFrame'>: ('project', 'creator', 'privileges', 'instrument', 'filter', 'chip', 'NAXIS1', 'NAXIS2', 'EXPTIME', 'DATE_OBS', 'creation_date', 'OBJECT', 'centerRA', 'centerDEC', 'filename')}
attributes_sql = {'OBJECT': 't."OBJECT#"', 'centerDEC': 'b.centerDEC', 'centerRA': 'b.centerRA', 'center_DEC': '(t."llDEC" + t."urDEC") / 2.0', 'center_RA': '(t."llRA" + t."urRA") / 2.0', 'chip': 't."chip"."name"', 'creator': 't."+CREATOR"', 'filter': 't."filter"."name"', 'frame_filename': 't."frame"."filename"', 'instrument': 't."instrument"."name"', 'privileges': 't."+PRIVILEGES"', 'project': 't."+PROJECT"'}
coordinate_format = '%.2f'
data_server_url = 'http://ds.astro.rug.astro-wise.org:8000/%s'
default_objects = [<class 'astro.main.RawFrame.RawScienceFrame'>, <class 'astro.main.ReducedScienceFrame.ReducedScienceFrame'>, <class 'astro.main.RegriddedFrame.RegriddedFrame'>, <class 'astro.main.RegriddedFrame.CoaddedRegriddedFrame'>, <class 'astro.main.SourceList.SourceList'>]
default_pm = 1.0
download_server = 'ds.astro.rug.astro-wise.org%3A8000'
filter_invalid = True
filter_objects(objects)

If fixed_objects is set filter the objects, otherwise return objects

generateOutput()

generate the output part

getCookies()

return a list of cookies

getHtml()

generate html

get_attr(object_cls, row, attr, default='')

get attribute value from row, if not present return default

get_attr_index(object_cls, attr)

look up the attr index for object class

get_queries()

get a list of all query threads also fill self.used_projects

classmethod get_url(search_str, resolve=False, server='gowise.astro-wise.org', project=None, full_url=True, all_projects=False)

return an url for the given search_str

handle_query_output(query_thread)

handle the output of a query, the following structures will be init : self.result self.object_totals self.project_totals self.object_max_reached

initProfileThread(project, query_project, member_of, objects, project_id)

initialize a ProfileThread object

initRaDec()

initialize RA and DEC attributes

initTemplate()

initialize and return the html template

lookup_attributes = {}
lookup_objects = {}
make_float(value, error)

try to make value float

make a link with coordinates or object name and the given args

make_project_table_overview(projects)

make a table overview of all projects

max_length_elem = 40
max_per_qry = 10
nameResolve()

use the search term to find ra and dec

objects_display = {<class 'astro.main.RadioCube.RadioFrame'>: 'RadioFrame', <class 'astro.main.RegriddedFrame.RegriddedFrame'>: 'RegriddedFrame', <class 'astro.main.RegriddedFrame.CoaddedRegriddedFrame'>: 'CoaddedRegriddedFrame', <class 'astro.main.SourceList.SourceList'>: 'SourceList', <class 'astro.main.RawFrame.RawScienceFrame'>: 'RawScienceFrame', <class 'astro.main.ReducedScienceFrame.ReducedScienceFrame'>: 'ReducedScienceFrame'}
output_order = ['RawScienceFrame', 'ReducedScienceFrame', 'RegriddedFrame', 'CoaddedRegriddedFrame', 'RadioFrame', 'SourceList']
project_objects = {'LOFAR': [<class 'astro.main.RadioCube.RadioFrame'>, <class 'astro.main.SourceList.SourceList'>], 'WENSS': [<class 'astro.main.RadioCube.RadioFrame'>, <class 'astro.main.SourceList.SourceList'>]}
setRaDec()

get the ra and dec from the arguments

set_coordinate(tmpl, template_var, format, float_value, input_value)

the the template variable to the float if not None, otherwise the input value

set_form_message(tmpl)

set the form message using error and messages

set_simbad_result(tmpl)

display the result of simbad

show_file = [<class 'astro.main.RawFrame.RawScienceFrame'>, <class 'astro.main.ReducedScienceFrame.ReducedScienceFrame'>, <class 'astro.main.RegriddedFrame.RegriddedFrame'>, <class 'astro.main.RegriddedFrame.CoaddedRegriddedFrame'>, <class 'astro.main.SourceList.SourceList'>, <class 'astro.main.RadioCube.RadioFrame'>]
show_image = [<class 'astro.main.RawFrame.RawScienceFrame'>, <class 'astro.main.ReducedScienceFrame.ReducedScienceFrame'>, <class 'astro.main.RegriddedFrame.RegriddedFrame'>, <class 'astro.main.RegriddedFrame.CoaddedRegriddedFrame'>, <class 'astro.main.SourceList.SourceList'>, <class 'astro.main.RadioCube.RadioFrame'>]
show_skymap = [<class 'astro.main.RawFrame.RawScienceFrame'>]

astro.services.gowise.HtmlGoWiseOverview module

Module with class HtmlGowiseOverview to generate an overview of links to the GoWise web service.

This overview is intended for search engines, to make GoWise more known.

WJ Vriend

class astro.services.gowise.HtmlGoWiseOverview.HtmlGoWiseOverview(args)

Bases: common.services.general.HtmlBase.HtmlBase

URL_NAME = 'GoWISEOverview'
getHtml()

generate the html

classmethod get_url(server='gowise.astro-wise.org', full_url=True)

return the url for this service

Module contents