Package invocations :: Package cu2 :: Module replaceJpgs :: Class ReplaceJpgs
[hide private]

Class ReplaceJpgs

source code


Replace old JPGs with reprocessed ones.

Nested Classes [hide private]

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: IngCuError

Instance Methods [hide private]
 
__init__(self, curator='rsc', database='WSA', beginDate=False, endDate=False, versionStr=False, redoDir=False, fileType=False, isTrialRun=False, comment='A useful comment')
Initialises data members for all database state flags and details for this curation session.
source code
 
_onRun(self)
run
source code
dict
getJpgs(self, theDirs, fileType, fullPath=True)
Create a dictionary containing info about the paths to each JPG.
source code
 
movJpgs(self, origJpgsDict, redoJpgsDict)
Move re-done JPGs into place of old ones.
source code

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: __del__, attributesFromArguments, createFileList, createLogFileName, createMonthlyDetSchema, createWorkingDir, getDetTable, getErrorFileName, getMultiframeIDs, getProcessOrder, getProgramIDs, makeSysCmd, removeWorkingDir, run, 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]
dict
checkRedoing(origJpgsDict, redoJpgsDict)
Check if all files are created.
source code
dict
getFilesInDir(dirName, fileType, fullPath)
Get all the files in the directory.
source code

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: createFilePrefix

Class Variables [hide private]

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=False, endDate=False, versionStr=False, redoDir=False, fileType=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:
  • curator (str) - Name of curator.
  • comment (str) - Descriptive comment as to why curation task is being performed.
  • beginDate (int) - First date to process, eg. 20050101.
  • endDate (int) - Last date to process, eg. 20050131.
  • fileType (str) - The file type to be replaced.
  • isTrialRun (bool @param redoDir Path to the directory, where re-done JPGs reside. @type redoDir str) - If True, do not perform database modifications.
  • versionStr (str) - Version number of the data.
Overrides: object.__init__

_onRun(self)

source code 

run

Overrides: wsatools.DbConnect.IngCuSession.IngCuSession._onRun

checkRedoing(origJpgsDict, redoJpgsDict)
Static Method

source code 

Check if all files are created.

Parameters:
  • origJpgsDict (dict) - Dictionary of the original JPGs.
  • redoJpgsDict (dict) - Dictionary of the re-done JPGs.
Returns: dict
Dict of all JPGs where no re-done JPG is found.

getFilesInDir(dirName, fileType, fullPath)
Static Method

source code 

Get all the files in the directory.

Parameters:
  • dirName (str) - Directory path.
  • fileType (str) - The file type to be replaced.
  • fullPath (bool) - If true write the full path else only the fileID.
Returns: dict
Dict of all JPGs where no re-done JPG is found.

getJpgs(self, theDirs, fileType, fullPath=True)

source code 

Create a dictionary containing info about the paths to each JPG.

Parameters:
  • theDirs (FitsList obj) - Contains info about all the JPG dirs.
  • fileType (str) - The file type to be replaced.
  • fullPath (bool) - If true write the full path else only the fileID.
Returns: dict
Dict of all JPGs by dateVersStr and fileID.

movJpgs(self, origJpgsDict, redoJpgsDict)

source code 

Move re-done JPGs into place of old ones.

Parameters:
  • origJpgsDict (dict) - Dictionary of the original JPGs.
  • redoJpgsDict (dict) - Dictionary of the re-done JPGs.