Package wsatools :: Module ProgrammeBuilder :: Class ProgrammeBuilder
[hide private]

Class ProgrammeBuilder

source code


Automatically determines the correct curation settings for a given programme. Updates the curation tables in the database and creates the necessary schema files.

Nested Classes [hide private]
    Nested Errors and Exceptions

Inherited from DbConnect.CuSession.CuSession: CuError

Instance Methods [hide private]
 
_onRun(self)
Set up programme database settings and/or schema.
source code
 
createSchema(self, syncToDb=False)
Update schema files for current non-survey programme using the latest version of sql/Templates/*_autoTemplateSchema.sql and the latest curation settings in the database for this programme.
source code
 
createIndexSchema(self, schemaFileName, progIDs, isView=False)
The index schema script is recreated from scratch each time for all programmes that have detection tables.
source code
dict(str: bool)
createProgSchema(self, schemaFiles, progIDs)
Parses *autoTemplate.sql to produce the custom schema for the current programme.
source code
 
createTables(self)
Creates all tables for the current list of programmes, where they do not already exist, inserting default rows where necessary.
source code
int
getMaxReleaseOnDisk(self)
Check available disks to see what the maximum releaseNum is for products on the main disks, for the given programme.
source code
int
getReleaseNum(self)
Queries database to find the next available release number for a given survey.
source code
 
initialiseNewRelease(self)
Clear ProductProcessing table entries for the programme and determine/announce the new release number.
source code
 
setUpNewProgs(self)
Updates the Programme table entries for new programmes.
source code
bool
setUpProgramme(self)
Set up programme using the latest quality controlled data.
source code
 
getExternalSurveyID(self, databaseName) source code
 
getSDSSNeighTable(self, surveyName, extTableName)
returns name of neighbour table between programme and SDSS survey
source code

Inherited from DbConnect.CuSession.CuSession: __del__, __init__, logBrokenFile, run

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from DbConnect.CuSession.CuSession: logException

Class Variables [hide private]
  _autoCommit = True
Should this curation task auto-commit database transactions?
  cuNum = 21
Curation task number.
  bandMergeCrit = None
Band merging criterion.
  createSchemaOnly = False
Just update schema with latest template?
  dateRange = DateRange(begin=<mx.DateTime.DateTime object for '...
Range of nights to include.
  maxEllipticity = 1.0
Maximum stellar ellipticity for deep stacks.
  maxSeeing = 2.0
Maximum seeing for deep stacks.
  newPoints = False
Only modify RequiredStack with new pointings?
  numberStks = -99999999
Max number of components of a deep stack.
  redoSchema = False
Recreate existing database schema?
  redoSetup = True
Recreate all RequiredStack pointings?
  displayDeeps = False
Output data for deep fields

Inherited from DbConnect.CuSession.CuSession: archive, comment, cuEventID, curator, eTypes, isDayStampedLog, onlyNonSurveys, onlySurveys, programme, programmeID, resultsFilePathName, shareFileID, sysc

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_onRun(self)

source code 

Set up programme database settings and/or schema.

Overrides: DbConnect.CuSession.CuSession._onRun

createSchema(self, syncToDb=False)

source code 

Update schema files for current non-survey programme using the latest version of sql/Templates/*_autoTemplateSchema.sql and the latest curation settings in the database for this programme.

Parameters:
  • syncToDb (bool) - If True, update existing schema in database with new schema, for all post-Detection tables.

To Do: Combine surveyparser.py functionality into this function, which will allow surveyparser.py to be just an interface to this class and improve consistency between survey and non-survey schema.

createIndexSchema(self, schemaFileName, progIDs, isView=False)

source code 

The index schema script is recreated from scratch each time for all programmes that have detection tables.

Parameters:
  • schemaFileName (str) - Schema file to update.
  • progIDs (list(int)) - List of programme IDs for this file.
  • isView (bool) - If True, template is to be used to create a view.

createProgSchema(self, schemaFiles, progIDs)

source code 

Parses *autoTemplate.sql to produce the custom schema for the current programme.

Parameters:
  • schemaFiles (list(tuple(str, str))) - List of schema template and programme files.
  • progIDs (list(int)) - List of programme IDs currently being processed.
Returns: dict(str: bool)
Dictionary indicating the updated status of each table.

getMaxReleaseOnDisk(self)

source code 

Check available disks to see what the maximum releaseNum is for products on the main disks, for the given programme.

Returns: int
Highest release number in use in the disk file system.

getReleaseNum(self)

source code 

Queries database to find the next available release number for a given survey.

Returns: int
Next available release number.

setUpProgramme(self)

source code 

Set up programme using the latest quality controlled data.

Returns: bool
True if the schema now needs updating.

Class Variable Details [hide private]

dateRange

Range of nights to include.

Value:
DateRange(begin=<mx.DateTime.DateTime object for '1753-01-01 00:00:00.\
00' at 28b8738>, end=<mx.DateTime.DateTime object for '9999-12-31 00:0\
0:00.00' at 28b8780>)