1
2
3
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.QualityControl import QualityFlagUpdater
14
15
16
17
18 if __name__ == "__main__":
19
20
21 CLI.progArgs.append(CLI.Argument("programmeID", "LAS"))
22 CLI.progOpts += [
23 CLI.Option('b', "bit",
24 "just do this bit",
25 "NUMBER", isValOK=lambda x: x.isdigit() and int(x) < 32),
26 CLI.Option('d', "deep_only",
27 "Only flag deep detections (VVV-style tables only)"),
28 CLI.Option('e', "end_date",
29 "date of last monthly detection table to update e.g. 2004-04-01"
30 " or 20040401 or P87",
31 "DATE", isValOK=CLI.isDateOK),
32 CLI.Option('f', "force",
33 "Force run, even if mosaic provenance is incomplete")]
34
35
36 CLI.progArgs["comment"] = "Updating detection quality bit flags"
37
38 cli = CLI(QualityFlagUpdater, "$Revision: 9703 $")
39 Logger.isVerbose = False
40 Logger.addMessage(cli.getProgDetails())
41
42 cu = QualityFlagUpdater(cli.getArg("programmeID"), cli=cli)
43 try:
44 cu.dateRange = cu.sysc.obsCal.dateRange(end=cli.getOpt("end_date"))
45 except Exception as error:
46 raise SystemExit("Illegal Option: " + str(error))
47
48 cu.isDeepOnly = cli.getOpt("deep_only")
49 cu.skipProvenanceCheck = cli.getOpt("force")
50 if cli.getOpt("bit"):
51 cu.doBit = int(cli.getOpt("bit"))
52
53 cu.run()
54
55
56
57
58
59
60
61