Package invocations :: Package cu2 :: Module cu2 :: Class Cu2
[hide private]

Class Cu2

source code


Make JPEGS of pixel data. This will make compressed images for all pixel data in the input transfer log.

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, subDir=False, versionStr=False, xferLog=False, jpgPath=False, forceMosaic=False, reDo=False, numThreads=False, deprecation=False, isTrialRun=False, comment='A useful comment')
Initialises data members for all database state flags and details for this curation session.
source code
 
_initFromDB(self)
initialize constants from the DB
source code
 
_onRun(self)
Do CU2.
source code
 
checkCu2(self)
Checks if files are already processed by CU2.
source code
 
cleanUp(self, datumVersStr)
Cleanup the cu2 directory for the given datumVersStr.
source code
 
createJpegDateDict(self, disks=None)
Create the daily filelists.
source code
 
createPixLists(self, dateVersStr, fileList, maxNum)
Create pixelfile lists from the given file list.
source code
 
makeJPEGs(self)
Create the JPEGs from given pixlist* files.
source code
 
readDeprecationLog(self, deprLog)
Read the transfer log containing pairs of 'old FITS filename, new FITS filename' and create a dictionary {old: new} from it.
source code
 
deprecateJpgs(self, fitsFileDict, deprMode='mv')
Deprecate files in fitsFileDict to the directory for deprecated files.
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]
 
grouper(iterable, chunksize) source code

Inherited from wsatools.DbConnect.IngCuSession.IngCuSession: createFilePrefix

Class Variables [hide private]
  maxNum = 1000
  contrast = 0.25
Greyscale contrast: structures: 0.25; smooth: 1.042
  quality = 90
JPEG quality (0-100).
  maxReTry = 3
max Number of retries.
  verbose = 0
  cu2Path = '/neferefre/rsc/VDFS_branches/trunk/src/curation/inv...

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, subDir=False, versionStr=False, xferLog=False, jpgPath=False, forceMosaic=False, reDo=False, numThreads=False, deprecation=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.
  • deprecation (str) - Modus for deprecating files and file containing pairs of 'old path,new path' of deprecated FITS files.
  • endDate (int) - Last date to process, eg. 20050131.
  • forceMosaic (bool) - Create jpg for mosaic.
  • isTrialRun (bool) - If True, do not perform database modifications.
  • jpgPath (str) - Directory where 'products/jpgs' will reside. If isTrialRun, the log will be written there as well.
  • numThreads (int) - Number of multiprocessing threads.
  • reDo (bool) - If True, overwrite existing jpg (CU2).
  • subDir (str) - fits subdirectory, eg. 'products/stacks'
  • versionStr (str) - Version number of the data.
  • xferLog (str) - Logfile containing files to be jpeged.
Overrides: object.__init__

_onRun(self)

source code 

Do CU2.

Overrides: wsatools.DbConnect.IngCuSession.IngCuSession._onRun

checkCu2(self)

source code 

Checks if files are already processed by CU2. Creates lists of files and completely non-processed directories.

cleanUp(self, datumVersStr)

source code 

Cleanup the cu2 directory for the given datumVersStr.

Parameters:
  • datumVersStr (str) - Date and version of search.

createJpegDateDict(self, disks=None)

source code 

Create the daily filelists.

Parameters:
  • disks (list(str)) - List of RAID file system disks.

createPixLists(self, dateVersStr, fileList, maxNum)

source code 

Create pixelfile lists from the given file list.

Parameters:
  • dateVersStr (str) - Date and version of search.
  • fileList (list(str)) - List of all files that need processing.
  • maxNum (int) - Maximum number of fits files per written list.

readDeprecationLog(self, deprLog)

source code 

Read the transfer log containing pairs of 'old FITS filename, new FITS filename' and create a dictionary {old: new} from it.

Parameters:
  • deprLog (str) - Logfile containing fits file pairs.

deprecateJpgs(self, fitsFileDict, deprMode='mv')

source code 

Deprecate files in fitsFileDict to the directory for deprecated files.

Parameters:
  • fitsFileDict (dict(str: str)) - Translation dict from old to new fits filenames.
  • deprMode (str) - Mode for handling the deprecated files: move ('mv'), remove ('rm'), leave in place ('ip')

Class Variable Details [hide private]

cu2Path

Value:
'/neferefre/rsc/VDFS_branches/trunk/src/curation/invocations/cu2'