Package wsatools :: Module FitsToDb :: Class CatFileUpdater
[hide private]

Class CatFileUpdater

source code


Updates metadata table values in the database from catalogue file headers for new attributes, given attributes or where there is missing/dodgy data for a given date. Essentially the same as AttributeUpdater, except only catalogue files are selected, and all catalogue attributes are automatically determined from WSA_MultiframeSchema.sql.

Nested Classes [hide private]
    Nested Errors and Exceptions

Inherited from DbConnect.CuSession.CuSession: CuError

Instance Methods [hide private]
list(tuple(str, int))
_getRecordsList(self)
Retrieves a list of records that need updating in the database.
source code
list(Schema.Attribute)
_prepTableAttrList(self, tableName, attrList)
Finds all catalogue attributes and produces a list of database entries to update.
source code

Inherited from AttributeUpdater: updateDb

Inherited from AttributeUpdater (private): _onRun, _prepare

Inherited from DbUpdater: getErrorLog, getFileList

Inherited from DbUpdater (private): _stripServerName

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]
  date = None
Optionally just update this night's catalogue data, eg '2005-12-11'.
  doMissingOnly = False
Only update entries without catalogue files specified?
  doStacksOnly = True
Only update attributes from stack files?

Inherited from AttributeUpdater: comment, reqAttrs, schemaFileName, tableList

Inherited from AttributeUpdater (private): _attrUpdateList, _isPersistent

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_getRecordsList(self)

source code 

Retrieves a list of records that need updating in the database. As DbUpdater but with self._recordSet modified to just select frames with catalogues (i.e. stacked frames) from the given date, and optionally only those with missing catalogue name entries. File names returned are those of stacks' catalogue files.

Returns: list(tuple(str, int))
List of records that need updating in the database, in the form (catName, multiframeID), with the server name stripped from the database catName attribute.
Overrides: DbUpdater._getRecordsList

_prepTableAttrList(self, tableName, attrList)

source code 

Finds all catalogue attributes and produces a list of database entries to update.

Parameters:
  • tableName (str) - Database table to update.
  • attrList (list(Schema.Attribute)) - List of all attributes in this table.
Returns: list(Schema.Attribute)
The list of attributes that need to be updated for this table.
Overrides: AttributeUpdater._prepTableAttrList