Commits
438 438 | if flag_cmds: |
439 439 | if 'name' in summary_dict_cmds: |
440 440 | summary_dict['report1'] = summary_dict_cmds |
441 441 | summary_dict['report0'] = before_summary_dict |
442 442 | else: |
443 443 | summary_dict = summary_dict_cmds |
444 444 | summary_dict['before'] = before_summary_dict |
445 445 | |
446 446 | agent_summaries = dict((v['name'], v) for v in summary_dict.values()) |
447 447 | |
448 - | ordered_agents = ['before', 'anos', 'online', 'shadow', 'intents', 'qa0', 'qa2', 'template', 'autocorr', |
449 - | 'edgespw', 'clip', 'quack', |
448 + | ordered_agents = ['before', 'clip', 'anos', 'online', 'shadow', 'intents', 'qa0', 'qa2', 'template', 'autocorr', |
449 + | 'edgespw', 'quack', |
450 450 | 'baseband'] |
451 451 | |
452 452 | summary_reps = [agent_summaries[agent] |
453 453 | for agent in ordered_agents |
454 454 | if agent in agent_summaries] |
455 455 | |
456 456 | # return the results object, which will be used for the weblog |
457 457 | return FlagDeterVLAResults(summary_reps, flag_cmds) |
458 458 | |
459 459 | def _get_flag_commands(self): |
460 460 | """ Adding quack and clip |
461 461 | """ |
462 462 | # flag_cmds = super(FlagDeterVLA, self)._get_flag_commands() |
463 463 | |
464 464 | flag_cmds = [] |
465 465 | |
466 466 | inputs = self.inputs |
467 467 | |
468 + | # PIPE-1033: Moving zero flagging before template. |
469 + | # Flag mode clip |
470 + | if inputs.clip: |
471 + | flag_cmds.append('mode=\'clip\' correlation=\'ABS_ALL\' clipzeros=True reason=\'clip\'') |
472 + | flag_cmds.append('mode=\'summary\' name=\'clip\'') |
468 473 | # flag anos? |
469 474 | if inputs.online: |
470 475 | if not os.path.exists(inputs.fileonline): |
471 476 | LOG.warning('Online ANOS flag file \'%s\' was not found. Online ANOS' |
472 477 | 'flagging for %s disabled.' % (inputs.fileonline, |
473 478 | inputs.ms.basename)) |
474 479 | else: |
475 480 | # ANTENNA_NOT_ON_SOURCE FLAG |
476 481 | cmdlist = self._read_flagfile(inputs.fileonline) |
477 482 | flag_cmds.extend([cmd for cmd in cmdlist if ('ANTENNA_NOT_ON_SOURCE' in cmd)]) |
495 500 | flag_cmds.append('mode=\'summary\' name=\'shadow\'') |
496 501 | |
497 502 | # These must be separated due to the way agent flagging works |
498 503 | if inputs.scan and inputs.intents != '': |
499 504 | for intent in inputs.intents.split(','): |
500 505 | if '*' not in intent: |
501 506 | intent = '*%s*' % intent |
502 507 | flag_cmds.append('mode=\'manual\' intent=\'%s\' reason=\'intents\'' % intent) |
503 508 | flag_cmds.append('mode=\'summary\' name=\'intents\'') |
504 509 | |
505 - | # PIPE-1033: Moving zero flagging before template. |
506 - | # Flag mode clip |
507 - | if inputs.clip: |
508 - | flag_cmds.append('mode=\'clip\' correlation=\'ABS_ALL\' clipzeros=True reason=\'clip\'') |
509 - | flag_cmds.append('mode=\'summary\' name=\'clip\'') |
510 - | |
511 510 | # flag template? |
512 511 | if inputs.template: |
513 512 | if not os.path.exists(inputs.filetemplate): |
514 513 | LOG.warning('Template flag file \'%s\' was not found. Template ' |
515 514 | 'flagging for %s disabled.' % (inputs.filetemplate, |
516 515 | inputs.ms.basename)) |
517 516 | else: |
518 517 | template_cmds = self._read_flagfile(inputs.filetemplate) |
519 518 | if template_cmds: |
520 519 | flag_cmds.extend(template_cmds) |