#!/usr/bin/env python3
"""Generate a statistics file showing the performance after EPD."""
from functools import partial
from autowisp.multiprocessing_util import setup_process
from autowisp.error_cli import cli_entry_point
from autowisp.exceptions import Component
from autowisp.file_utilities import find_lc_fnames
from autowisp.processing_steps.lc_detrending_argument_parser import (
LCDetrendingArgumentParser,
)
from autowisp.processing_steps.lc_detrending import (
calculate_detrending_performance,
)
from autowisp.processing_steps.manual_util import ignore_progress
[docs]
def parse_command_line(*args):
"""Parse the commandline options to a dictionary."""
return LCDetrendingArgumentParser(
mode="EPDstat",
description=__doc__,
add_reconstructive=False,
input_type=("" if args else "lc"),
).parse_args(*args)
#: Lightcurve steps do not resume: the manager hands them every LC to
#: measure from the start.
allowed_start_status_values = (0,)
generate_epd_statistics = partial(
calculate_detrending_performance, detrending_mode="epd"
)
[docs]
@cli_entry_point(component=Component.STEP)
def main():
"""Run the step from the command line."""
cmdline_config = parse_command_line()
setup_process(task="main", **cmdline_config)
generate_epd_statistics(
find_lc_fnames(cmdline_config.pop("lc_files")),
0,
cmdline_config,
ignore_progress,
)
if __name__ == "__main__":
main()