astro.services.calts package

Submodules

astro.services.calts.HtmlCalibrationEdit module

File HtmlCalibrationEdit.py Author WJ Vriend (wjvriend[AT]astro.rug.nl)

exception astro.services.calts.HtmlCalibrationEdit.CalibrationEditObsBlockError

Bases: Exception

class astro.services.calts.HtmlCalibrationEdit.HtmlCalibrationEdit(args, parent=None)

Bases: common.services.calts.HtmlCalibrationEdit.HtmlCalibrationEdit

astro specific version of the CalTS edit page

getDateAttr(obj)

Return the date attribute to use

getDateObs(obj)

determine date obs to display

getIsValidSelectOptions()

Return the options for the is_valid select box Return two lists; what to show and the values

getMainTableContents()

return the contents for the main table(s)

getMainTableHeaders(objects, main_table_all_checked)

Return the headers of the main table

getMessages()

set the messages in the html template

getObjectAttributes(obj)

return the attributes name and values of the object to show in the overview table

getObjectsForObservingBlock(a_object)

get all the objects on basis of the observation block

getObjectsForTemplate(obj)

get all frames for this template

getSorter(objects)

return the sorter method for the objects

classmethod import_for_inverse_query()

import all classes needed by the inverse_query method, if these are not explicitly imported they are not used by inverse_query()

classmethod is_retrievable(obj)

has this object a retrievable file associated

mainTableAllChecked(objects)

Should all entries in the main table be checked

prepareRS(query, length, a_obj)

prepare the recordset

renderMainTableRow(obj, obj_previous, main_table_all_checked)

return the contents for the main table(s)

setChips(a_obj)

give the user an option to apply timestamp settings for all chips select the chips by creation date

setOrderBy(query)

set the order by clause for the query

classmethod supportsClass(class_string)

Does HtmlCalibrationEdit support the given class ?

astro.services.calts.HtmlCalibrationGraph module

astro version of the CalTS Graph generator

class astro.services.calts.HtmlCalibrationGraph.HtmlCalibrationGraph(args, parent=None)

Bases: common.services.calts.HtmlCalibrationGraph.HtmlCalibrationGraph

DbViewClass

alias of astro.services.dbview.HtmlDbView.HtmlDbView

determineValidationBarBgColor(is_valid)

return the background color of the bar

formatTextTimestamp(row)

Add links to the text shown on the left side of each timestamp row

getCalibrationGraph()

Return the Calibration Graph class to generate the result, default the Timestamp Graph

getNightBins(init_method)

return the possible night bins for the data selection range

getPlotDateObsAttrs()

return the attributes for the DateObs Graph

getPlotDateObsCounted()

Return what is counted in the Date Obs Graph

getSqlWhere()

construct the sql where statement also make query dict for dbview web service

makeSqlDateObs(attr1, attr2, date_obs='DATE_OBS')

make the sql statement for raws with a date obs group by is on chip (if present) otherwise template

makeSqlTimestamp()

construct the sql statement for timestamp based objects

plotValidationBars(graph_cls)

plot the graphical validation of the selected objects

sql_timestamp_select_default = [('rawtohex(t."object_id")', '', ''), ('t."timestamp_start"', '', ''), ('t."timestamp_end"', '', ''), ('t."creation_date"', '', ''), ('t."quality_flags"', 'quality_flags', "'0'"), ('t."is_valid"', 'is_valid', "'1'"), ('t."chip"."name"', 'chip', "'-'"), ('t."filter"."name"', 'filter', "'-'"), ('t."filename"', 'filename', "'-'"), ('t."+PROJECT"', '', ''), ('t."+PRIVILEGES"', '', ''), ('t."+CREATOR"', '', '')]

astro.services.calts.HtmlCalibrationGraphValidator module

Module with Validator classes for the HtmlCalibrationGraph class

class astro.services.calts.HtmlCalibrationGraphValidator.ObservingBlockValidator(parent)

Bases: astro.services.calts.HtmlCalibrationGraphValidator.Validator

class for validating ObservingBlocks

cal_type = 'ObservingBlock'
columns = ['dictionary_id', 'group', 'id', 'name', 'PI_COI_id', 'PI_COI_name', 'program_id', 'start']
date_index = 8
get_sql()

generate and return sql

sql_select = ['t."object_id"', 't."dictionary_id"', 't."group"', 't."id"', 't."name"', 't."PI_COI_id"', 't."PI_COI_id"', 't."program_id"', 't."start"']
validate(observingblock_oid)

validate the ObservingBlock, errors will be placed in self.errors, messages in self.messages, return if validate is ok

class astro.services.calts.HtmlCalibrationGraphValidator.TemplateValidator(parent)

Bases: astro.services.calts.HtmlCalibrationGraphValidator.Validator

validate a Template, this can span multiple templates in the database what is checked (0. for a given template, check that there are “exposures” nr of templates with the same “start”) 1. there should be “exposures” nr of RawFitsData objects for the template 2. there should be nr_of_chips * “exposures” nr of Frames for the template

type of Frames is determined by template.type
cal_type = 'Template'
columns = ['category', 'exposures', 'filter.name', 'id', 'index', 'obs_start', 'start', 'type']
date_index = 7
get_sql()

generate and return sql

sql_select = ['t."object_id"', 't."category"', 't."exposures"', 't."filter"."name"', 't."id"', 't."index"', 't."obs_start"', 't."start"', 't."type"']
validate(template_oid)

validate the template, errors will be placed in self.errors, messages in self.messages, return if validate is ok

class astro.services.calts.HtmlCalibrationGraphValidator.ValidationFactory(parent)

Bases: object

factory class for initializing the correct validator

validator()

return he validator

class astro.services.calts.HtmlCalibrationGraphValidator.Validator

Bases: object

astro.services.calts.HtmlCalibrationQuality module

Module with the main CalTS handler

class astro.services.calts.HtmlCalibrationQuality.HtmlCalibrationQuality(args)

Bases: common.services.calts.HtmlCalibrationQuality.HtmlCalibrationQuality

Astro version of the CalTS main handler

ASSOCIATELIST = 'AssociateList'
ASTROMETRICPARS = 'AstrometricParameters'
ATMOSEXTCOEF = 'AtmosphericExtinctionCoefficient'
BIAS = 'BiasFrame'
COADDEDFRAME = 'CoaddedRegriddedFrame'
COLDPIXEL = 'ColdPixelMap'
CROSSTALK = 'CrossTalk'
CommentClass

alias of astro.services.calts.HtmlComment.HtmlComment

DARKCURRENT = 'DarkCurrent'
DOMEFLAT = 'DomeFlatFrame'
DefaultClass = 'ReadNoise'
EditClass

alias of astro.services.calts.HtmlCalibrationEdit.HtmlCalibrationEdit

FRINGE = 'FringeFrame'
GAIN = 'GainLinearity'
GraphClass

alias of astro.services.calts.HtmlCalibrationGraph.HtmlCalibrationGraph

HOTPIXEL = 'HotPixelMap'
ILLUMINATION = 'IlluminationCorrectionFrame'
ILLU_COEF = 'IlluminationCorrection'
MASTERFLAT = 'MasterFlatFrame'
NIGHTSKY = 'NightSkyFlatFrame'
OBSERVINGBLOCK = 'ObservingBlock'
OBSERVINGBLOCK_VALIDATION = 'ObservingBlock--validation'
PHOTOMETRIC = 'PhotometricParameters'
PHOTSRCCAT = 'PhotSrcCatalog'
PHOTTRANS = 'PhotTransformation'
QUICKCHECK = 'QuickCheckFrame'
RAWBIASFRAME = 'RawBiasFrame'
RAWDARKFRAME = 'RawDarkFrame'
RAWDOMEFLATFRAME = 'RawDomeFlatFrame'
RAWFITSDATA = 'RawFitsData'
RAWSCIENCEFRAME = 'RawScienceFrame'
RAWTWILIGHTFRAME = 'RawTwilightFlatFrame'
READNOISE = 'ReadNoise'
REDUCEDSCIENCEFRAME = 'ReducedScienceFrame'
REGRIDDEDFRAME = 'RegriddedFrame'
SOURCELIST = 'SourceList'
TEMPLATE = 'Template'
TEMPLATE_VALIDATION = 'Template--validation'
TWILIGHT = 'TwilightFlatFrame'
TableClass

alias of astro.services.calts.HtmlCalibrationTable.HtmlCalibrationTable

attr1_name = 'chip'
attr2_name = 'filter'
classmethod displayClasses()

return the classes to display

classmethod generateChipSelect(instrument, sel_chip)

generate html statements for the selects of a combo box with all chips

classmethod generateFilterSelect(instrument, sel_filter)

generate html statements for a list / select box for all filters

classmethod getClass(class_str)

return the class for the given class string

classmethod getClassText(class_str)

return the class text representation for the given class string

getInputYears()

return the years to select

classmethod getIntroText()

return the text to display on the intro page

getSelectionTableElements()

return the elements to generate the Selection Table

getTimezoneDelta()

get the timezone delta with respect to UT noon

classmethod hasFlags(cls_test)

does the cls_test have flags (ie is_valid or quality_flags)

help_page = '/builds/omegacen/astro/services/calts/static/Calts_Help.html'
setView(view)

What view should we use; Graph or Table ?

astro.services.calts.HtmlCalibrationTable module

astro version of the CalTS Table generator

class astro.services.calts.HtmlCalibrationTable.HtmlCalibrationTable(args, parent=None)

Bases: common.services.calts.HtmlCalibrationTable.HtmlCalibrationTable

ALL_COLUMNS = (('filename', 'filename', 'filename', 3), ('object', 'OBJECT#', 'OBJECT', 0), ('name', 'name', 'name', 0), ('chip', ('name', 'Chip', 'chip'), 'chip', 0), ('filter', ('name', 'Filter', 'filter'), 'filter', 0), ('DATE_OBS', 'DATE_OBS', 'DATE_OBS', 1), ('date_obs', 'date_obs', 'date_obs', 1), ('DATE_OBS', ('DATE_OBS', 'ReducedScienceFrame', 'reduced'), 'reduced', 1), ('creation_date', 'creation_date', 'creation_date', 1), ('timestamp_start', 'timestamp_start', 'timestamp_start', 2), ('timestamp_end', 'timestamp_end', 'timestamp_end', 2), ('is_valid', 'is_valid', 'is_valid', 0), ('quality_flags', 'quality_flags', 'quality_flags', 0), ('template.id', ('id', 'Template', 'template'), 'template', 0), ('template.name', ('name', 'Template', 'template'), 'template', 0), ('template.start', ('start', 'Template', 'template'), 'template', 1), ('template.type', ('type', 'Template', 'template'), 'template', 0), ('exposures', 'exposures', 'exposures', 0), ('obs_id', 'obs_id', 'obs_id', 0), ('obs_start', 'obs_start', 'obs_start', 1), ('start', 'start', 'start', 1), ('id', 'id', 'id', 0), ('PI_COI_id', 'PI_COI_id', 'PI_COI_id', 0), ('PI_COI_name', 'PI_COI_name', 'PI_COI_name', 0), ('project', '+PROJECT', 'object_id', 0), ('creator', '+CREATOR', 'object_id', 0), ('privileges', '+PRIVILEGES', 'object_id', 0))
MAX_ROWS = 1000
extraTablePreHeaders()

return extra headers for the html table

extraTablePreValues(row, count)

return extra elements for the table row

formatRowValue(col_name, col_value)

format the row value with given column name

getOrderBy()

return the list of attriubutes to uise in the order by clause

getTableHeaders()

return the columns or headers for this table

getTableRows()

return all the rows for the table

getWhere()

get the sql where and from statement and all where arguments

astro.services.calts.HtmlComment module

File HtmlCComment.py Author WJ Vriend (wjvriend[AT]astro.rug.nl) Date Apr 2005

class astro.services.calts.HtmlComment.HtmlComment(args, parent=None)

Bases: common.services.calts.HtmlComment.HtmlComment

astro specific version of HtmlComment

Module contents