class AnalyzeGridSearch(KPFTranslatorFunction):
'''# Description
Tool to analyze engineering data taken by the `engineering.GridSearch` or
`engineering.Run2DGridSearch` scripts.
# Parameters
None
'''
@classmethod
def pre_condition(cls, args, logger, cfg):
pass
@classmethod
def perform(cls, args, logger, cfg):
for logfile in args.get('logfile'):
analyze_grid_search(logfile,
fiber=args.get('fiber'),
model_seeing=args.get('seeing'),
xfit=args.get('xfit'), yfit=args.get('yfit'),
generate_cred2=args.get('cred2'),
)
@classmethod
def post_condition(cls, args, logger, cfg):
pass
@classmethod
def add_cmdline_args(cls, parser, cfg=None):
parser.add_argument('logfile', type=str, nargs='*',
help="The logfile or files of the grid search runs to analyze")
parser.add_argument("--cred2", dest="cred2",
default=False, action="store_true",
help="Generate CRED2 plots? (default = False)")
parser.add_argument("--fiber", dest="fiber", type=str,
default='Science',
help="The fiber being examined (Science, Sky, or EMSky).")
parser.add_argument("--seeing", dest="seeing", type=str,
choices=['0.5', '0.7', '0.9'],
default='0.7',
help="The seeing model to overlay on the fiber coupling plot.")
parser.add_argument("--xfit", dest="xfit", type=float,
default=335.5,
help="The X pixel position to use as the center when overlaying the model.")
parser.add_argument("--yfit", dest="yfit", type=float,
default=258,
help="The X pixel position to use as the center when overlaying the model.")
return super().add_cmdline_args(parser, cfg)