Package helpers :: Module UpdateTilePawPrintTables
[hide private]

Source Code for Module helpers.UpdateTilePawPrintTables

 1  #! /usr/bin/env python 
 2  #------------------------------------------------------------------------------ 
 3  #$Id: UpdateTilePawPrintTables.py 8533 2011-07-30 18:43:27Z NicholasCross $ 
 4  """ 
 5     Fills the ppErrBits attribute of the detection tables. 
 6   
 7     @author: R.S. Collins 
 8     @org:    WFAU, IfA, University of Edinburgh 
 9  """ 
10  #------------------------------------------------------------------------------ 
11  from wsatools.CLI            import CLI 
12  from wsatools.Logger         import Logger 
13  from wsatools.SourceMerger   import TilePawPrintMerger 
14  #------------------------------------------------------------------------------ 
15  # Entry point for script. 
16   
17  # Allow module to be imported as well as executed from the command line 
18  if __name__ == "__main__": 
19      # Define additional command-line interface options for QualityFlagUpdater 
20   
21      # Do ALL or 1 
22      CLI.progArgs += [ 
23          CLI.Argument("begin_date", "P85", isValOK=CLI.isDateOK), 
24          CLI.Argument("end_date", "P85", isValOK=CLI.isDateOK)] 
25   
26      CLI.progOpts += [ 
27        CLI.Option('d', "deepOnly", "just do deep tiles only"), 
28        CLI.Option('r', "reCreate", "Drop and create tables"), 
29        CLI.Option('a', "addDefaults", "Add defaults to the tables only"), 
30        CLI.Option('l', "mfIDList", "List of tile multiframeIDs to update","LIST")] 
31   
32      # Reset the default comment 
33      CLI.progArgs["comment"] = "Merging tile and pawprint detections" 
34   
35      cli = CLI(TilePawPrintMerger, "$Revision: 8533 $") 
36      Logger.isVerbose = False 
37      Logger.addMessage(cli.getProgDetails()) 
38   
39      cu = TilePawPrintMerger(cli.getArg("programmeID"), cli=cli) 
40   
41      if cu.sysc.isVSA() and not cu.programme.getAttr("sourceProdType")=='stack': 
42          cu.recreate = cli.getOpt("reCreate") 
43          if cli.getOpt("deepOnly"): 
44              cu.deepOnly = cli.getOpt("deepOnly") 
45          else: 
46              cu.dateRange = cu.sysc.obsCal.dateRange(cli.getArg("begin_date"), 
47                                                      cli.getArg("end_date")) 
48          cu.addDefaults = cli.getOpt("addDefaults") 
49          if cli.getOpt("mfIDList"): 
50              cu.newTileList=cli.getOpt("mfIDList").split(',') 
51          cu.run() 
52