Package invocations :: Package cu0 :: Module FinaliseCatalogueIngest
[hide private]

Module FinaliseCatalogueIngest

source code

Finalise the catalogue data ingests by creating the constraints for the monthly VVV tables and deprecating old detections.


Author: Eckhard Sutorius

Organization: WFAU, IfA, University of Edinburgh

Functions [hide private]
 
createConstraints(archive, readFromFile=False, month=None, writeAll=False)
Create script to attach constraints to monthly VVV detection tables.
source code
 
createViews(archive, surveyName)
Create the views for the monthly split tables.
source code
 
getObjIDRanges(archive, mfID, tableName)
Get all objIDs for the given month.
source code
 
appendConstrain(attr, conDict, month, conOn, conOff)
Append entry to constraint dictionary.
source code
 
deprecateOldDetections(archive)
Deprecate old detections.
source code
 
updateVVVObjIDs(archive)
Since the objectIDs couldn't be calculated beforehand they have to be updated separately based on their value and the maximal value found in the database.
source code
Variables [hide private]
  pickledDataFile = 'DetData_%s.pcl'
  sqlOutDir = '/mnt/ramses12/'
  constraintName = {'mf': 'multiframeID%s%s', 'obj': 'objID%s'}
  constraintStr = 'ALTER TABLE %s%s WITH CHECK ADD CONSTRAINT %s...
  constraintRange = {'mf': '(multiframeID >= %s AND multiframeID...
  constraintAdd = {'mf': '(multiframeID = %s)', 'obj': '(objID =...
  __package__ = 'invocations.cu0'
Function Details [hide private]

createConstraints(archive, readFromFile=False, month=None, writeAll=False)

source code 

Create script to attach constraints to monthly VVV detection tables.

Parameters:
  • archive (DBSession) - The DB connection.
  • readFromFile (bool) - If True read from existing data file else query DB.

getObjIDRanges(archive, mfID, tableName)

source code 

Get all objIDs for the given month.

Parameters:
  • archive (DBSession object) - The DB connection.
  • mfidList (list) - List of MultiframeIDs.
  • tableName (str) - Name of the processed table.

appendConstrain(attr, conDict, month, conOn, conOff)

source code 

Append entry to constraint dictionary.

Parameters:
  • attr (str) - Attribute short for which the constraint is build.
  • conDict (dict) - The constraint dictionary.
  • month (str) - The processed month.
  • conOn (int) - Start value of the constraint.
  • conOff (int) - End value of the constraint.

deprecateOldDetections(archive)

source code 

Deprecate old detections.

Parameters:
  • archive (DBSession object) - The DB connection.

updateVVVObjIDs(archive)

source code 

Since the objectIDs couldn't be calculated beforehand they have to be updated separately based on their value and the maximal value found in the database.

Parameters:
  • archive (DBSession object) - The DB connection.

Variables Details [hide private]

constraintStr

Value:
'ALTER TABLE %s%s WITH CHECK ADD CONSTRAINT %s CHECK '

constraintRange

Value:
{'mf': '(multiframeID >= %s AND multiframeID <= %s)',
 'obj': '(objID >= %d AND objID <= %d)'}

constraintAdd

Value:
{'mf': '(multiframeID = %s)', 'obj': '(objID = %d)'}