Package invocations :: Package cu21 :: Module NonSurveyRelease :: Class NonSurveyCurator
[hide private]

Class NonSurveyCurator

source code


Performs post-data-ingest curation on non-survey data and automatically prepares release databases.


To Do: This class borrows heavily on the CuSession design, so need to derive both CuSession and this class from a class that represents the common super set.

Instance Methods [hide private]
 
__init__(self, cli)
Initialises member variables from command-line options, which enables it to determine the list of programmes to curate.
source code
 
run(self)
Executes the _onRun() method of the session within a try block, so that all the standard exceptions may be dealt with correctly.
source code
list(str)
_getProgsToRelease(self)
Queries database and non-survey registration files to determine selection of programmes to release according to command-line options.
source code
 
_moveToShare(self)
Moves the file containing the list of deep products to ingest to the share path of the server hosting the database where the products will be stored.
source code
 
_onCompletion(self)
Always executes after a run to log results and tidy up.
source code
 
_onRun(self)
Runs automatic curation and release for all programmes.
source code
 
_prepareData(self, progID)
Performs part A auto-curation for given programme.
source code
 
_releaseData(self, progID, relDate)
Performs part B auto-curation and release for given programme.
source code
 
_runPartA(self)
PART A - QC and set-up via automatic curation for each programme.
source code
 
_runPartB(self)
PART B - Release following final automatic curation.
source code
 
_toEachProg(self, method, **kwds)
Wrapper method to apply the given method to every programme in self.progIDs, whilst handling exceptions, so that if one programme fails its failure is logged and execution is continued with the next programme.
source code
list(tuple(int, str))
getFirstNights(self, progIDs)
Database query to determine the first night of observation for given progs.
source code
set(str)
getRegisteredProgs(self)
Returns: Set of registered non-survey programme dfsIdStrings.
source code

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

Class Variables [hide private]
  archive = None
Connection to the database to curate (DbSession).
  cli = None
Command-line options (CLI).
  dateRange = DateRange(begin=<mx.DateTime.DateTime object for '...
Range of observation nights to curate - only end date is applied.
  failures = []
List of programmes that fail curation.
  fileListForType = None
Locations of file lists of new products to ingest ref.
  isDryRun = False
Just determine programmes to curate?
  isReleaseRun = False
Perform the second part of the curation process that releases database?
  isShallowOnly = False
All programmes currently being curated are shallow?
  progIDs = []
List of programmes to be curated, can be acronym or unique ID as string.
  progTable = None
Database Programme table entries (ProgrammeTable).
  stage = 'No curation task performed'
Stage currently being curated.
  successes = []
List of programmes that have completed curation.
  sysc = SystemConstants()
System constants object.
  workSpace = ''
Temporary working directory location.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cli)
(Constructor)

source code 

Initialises member variables from command-line options, which enables it to determine the list of programmes to curate.

Overrides: object.__init__

run(self)

source code 

Executes the _onRun() method of the session within a try block, so that all the standard exceptions may be dealt with correctly.

To Do: This should become part of abstracted class at a level above CuSession.

_getProgsToRelease(self)

source code 

Queries database and non-survey registration files to determine selection of programmes to release according to command-line options.

Returns: list(str)
List of acronyms of programmes to release.

_prepareData(self, progID)

source code 

Performs part A auto-curation for given programme.

Parameters:
  • progID (str) - Programme to curate, can be acronym or unique ID.

_releaseData(self, progID, relDate)

source code 

Performs part B auto-curation and release for given programme.

Parameters:
  • progID (str) - Programme to curate, can be acronym or unique ID.
  • relDate (str) - Date for release database name YYYYMMDD.

_toEachProg(self, method, **kwds)

source code 

Wrapper method to apply the given method to every programme in self.progIDs, whilst handling exceptions, so that if one programme fails its failure is logged and execution is continued with the next programme.

Parameters:
  • method (instancemethod or function) - Method to apply to each progID in self.progIDs.
  • kwds (dict) - Optional keyword argument list for the method.

getFirstNights(self, progIDs)

source code 

Database query to determine the first night of observation for given progs.

Parameters:
  • progIDs (list(int)) - List of programme IDs to query.
Returns: list(tuple(int, str))
List of programmes with date of the first night of observation.

getRegisteredProgs(self)

source code 
Returns: set(str)
Set of registered non-survey programme dfsIdStrings.

Class Variable Details [hide private]

dateRange

Range of observation nights to curate - only end date is applied.

Value:
DateRange(begin=<mx.DateTime.DateTime object for '1753-01-01 00:00:00.\
00' at 37c5e88>, end=<mx.DateTime.DateTime object for '9999-12-31 00:0\
0:00.00' at 3228b28>)

fileListForType

Locations of file lists of new products to ingest ref. by product type.

Value:
None