Package helpers :: Module UpdateWSATimestamp
[hide private]

Module UpdateWSATimestamp

source code

Update/synchronise the filetimestamps (WSATimestamp) with CASU's FITS files (via monitoring/lsCasuDirs.py).


Author: E.T.W. Sutorius

Organization: WFAU, IfA, University of Edinburgh

Functions [hide private]
dict(str:list(str))
getMfIDs(archive, dateVersStr)
Read fileName, multiframeIDs from the given database.
source code
dict(str:list(str))
readCasuStamps(inFileName, dateVersList)
Read the file information of all CASU files from a log file.
source code
dict(str:list(str))
updateDBdict(dbdict, dblist)
Update the dict with which dbs are found on every host.
source code
 
updateFitsStamp(fileName, timeStamp)
Update the FITS file timestamp accordingly.
source code
Variables [hide private]
  availPubDBs = {}
  dataBasesDef = {'dbload': ['WSA'], 'dbpub': ['all']}
  dataBases = {}
  testRun = False
hash(x)
  fitsOnly = False
hash(x)
  dbsOnly = False
hash(x)
  localOnly = False
hash(x)
  __package__ = 'helpers'
Function Details [hide private]

getMfIDs(archive, dateVersStr)

source code 

Read fileName, multiframeIDs from the given database.

Parameters:
  • archive (DbSession) - Connection to database to query.
  • dateVersStr (str) - The datedir string, YYYYMMDD_vV.
Returns: dict(str:list(str))
Dict of files (dateVersStr/fileName) and their multiframeID, fileTimeStamp, and catName.

readCasuStamps(inFileName, dateVersList)

source code 

Read the file information of all CASU files from a log file.

Parameters:
  • inFileName (str) - Log containing CASU file data.
  • dateVersList (list(str)) - List containing dateVersStr.
Returns: dict(str:list(str))
Dict of files (dateVersStr/fileName) and their timestamp (date, time)

updateDBdict(dbdict, dblist)

source code 

Update the dict with which dbs are found on every host.

Parameters:
  • dbdict (dict) - Dict of servers and their databases.
  • dblist (list) - List of databases.
Returns: dict(str:list(str))
Dict of servers and their databases.

updateFitsStamp(fileName, timeStamp)

source code 

Update the FITS file timestamp accordingly.

Parameters:
  • fileName (str) - FITS file to be updated.
  • timeStamp (long) - WSA timestamp (datedir+filetimestamp).