Package helpers :: Module CreateFitsAttributeList :: Class ExportAttributes
[hide private]

Class ExportAttributes

source code


Nested Classes [hide private]

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: IngCuError

Instance Methods [hide private]
 
__init__(self, curator='rsc', database='WSA', beginDate='0', endDate='0', versionStr=False, readPickled=False, writeExampleFits=False, isTrialRun=False, comment='A useful comment')
Initialises data members for all database state flags and details for this curation session.
source code
 
next_power_of_2(self, n)
Returns the next power of 2 that is greater than or equal to n
source code
 
signum(self, num) source code
 
readAuxFiles(self) source code
 
getAttrType(self, value, typeSizeTuple=None) source code
 
getFileType(self, fileName) source code
 
reFormat(self, attr) source code
 
createAttrLines(self, extensionDict, table, extNum, attrDescriptions, isCatalogue=False, examples={}) source code
 
createSqlFiles(self, imageDict, catalogueDict={}, exampleDict={})
Write the sql Multiframe schema.
source code
 
run(self)
Run the curation session.
source code
 
readFitsFiles(self, fitsList, fileDict)
Read the FITS files' metadata into a dictionary.
source code
 
readAttr(self, file) source code
 
compareSchemaFiles(self) source code

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: __del__, attributesFromArguments, createFileList, createLogFileName, createMonthlyDetSchema, createWorkingDir, getDetTable, getErrorFileName, getMultiframeIDs, getProcessOrder, getProgramIDs, makeSysCmd, removeWorkingDir, runSysCmd, setupDetectionTable, testForProgs, translateProgID, writeErrorFiles, writeIngestList

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

Static Methods [hide private]

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: createFilePrefix

Class Variables [hide private]
  outDir = 'parsed_fits_keys'
  attrDescriptionFileName = 'OSA_FitsKeyDescription.txt'
  fileTypeLookUp = {'cat': '_cat', 'conf': '_conf', 'dark': 'dar...
  typeDefaults = {'bigint': '-99999999', 'binary': '0', 'bit': '...
  nullDefaults = {'bigint': '-99999999', 'binary': '0', 'bit': '...
  omitAttr = ('tfields', 'tform', 'ttype', 'tunit', 'symbol', 'p...
  noShow = set(['COMMENT', 'HISTORY'])
  translatAttr = {'bitpix': 'bitsPerPix', 'bscale': 'dataScale',...
  osaAttrSet = set([])
  esoAttrSet = set([])
  allHeaders = {'Multiframe': {'bottom': ['fileName varcha...

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: beginDateDef, endDateDef, keepWorkDir, reqWorkDir, sysc

Instance Variables [hide private]
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, curator='rsc', database='WSA', beginDate='0', endDate='0', versionStr=False, readPickled=False, writeExampleFits=False, isTrialRun=False, comment='A useful comment')
(Constructor)

source code 

Initialises data members for all database state flags and details for this curation session. Writes a database lock and opens a connection. Also initiates a Programme table object.

Parameters:
  • beginDate (str) - First date to process, eg. 20050101.
  • comment (str) - Descriptive comment as to why curation task is being performed.
  • curator (str) - Name of curator.
  • database (str) - Name of the database to connect to.
  • endDate (str) - Last date to process, eg. 20050131.
  • isTrialRun (bool) - If True, do not perform database modifications.
  • readPickled (bool) - If True, read pickled FITS data.
  • versionStr (str) - Version number of the data.
  • writeExampleFits (str) - Write an example FITS file to the attribute line.
Overrides: object.__init__

createSqlFiles(self, imageDict, catalogueDict={}, exampleDict={})

source code 

Write the sql Multiframe schema.

Parameters:
  • imageDict (dict) - Dictionary of extension number and attributes, types, and descriptions for image files. Dict[i][attr] = [descr, (atttype, attsize)]
  • catalogueDict (dict) - Dictionary of extension number and atttributes, types, and descriptions for catalogue files. Dict[i][attr] = [descr, (atttype, attsize)]
  • exampleDict (dict) - Dictionary of attributes and associated filenames. Dict[attr] = filePath

run(self)

source code 

Run the curation session.

Overrides: wsatools.DbConnect.IngCuSession.IngCuSession.run
(inherited documentation)

Class Variable Details [hide private]

fileTypeLookUp

Value:
{'cat': '_cat',
 'conf': '_conf',
 'dark': 'dark_',
 'sky': 'sky_',
 'stack': '_st'}

typeDefaults

Value:
{'bigint': '-99999999',
 'binary': '0',
 'bit': '0',
 'datetime': '\'31-Dec-9999\'',
 'float': '-9.999995e+08',
 'int': '-99999999',
 'real': '-9.999995e+08',
 'smallint': '-9999',
...

nullDefaults

Value:
{'bigint': '-99999999',
 'binary': '0',
 'bit': '0',
 'datetime': '12-31-9999',
 'float': '-9.999995e+08',
 'int': '-99999999',
 'real': '-9.999995e+08',
 'smallint': '-9999',
...

omitAttr

Value:
('tfields',
 'tform',
 'ttype',
 'tunit',
 'symbol',
 'prov',
 'checksum',
 'dataChecksum',
...

translatAttr

Value:
{'bitpix': 'bitsPerPix',
 'bscale': 'dataScale',
 'bzero': 'dataZero',
 'dec': 'decBase',
 'instrume': 'instrument',
 'ra': 'raBase'}

allHeaders

Value:
{'Multiframe': {'bottom': ['fileName       varchar(256) not null defau\
lt \'NONE\',    --/D the filename for the multiframe, eg. server:/path\
/filename.fit --/C ID_FILE --/Q fitsfilename',
                           'catName        varchar(256) not null defau\
lt \'NONE\',    --/D the filename of the associated catalogue MEF, eg.\
 server:/path/filename.fits   --/C ID_CATALOG --/Q fitsfilename',
                           'versionNum     real not null default -0.99\
99995e9,      --/D a version number for this frame (if available) --/C\
...