24 from lsst.daf.butler.cli.opt
import (repo_argument, config_option, config_file_option, run_option,
26 from lsst.daf.butler.cli.utils
import (cli_handle_exception, ParameterType, split_commas,
27 typeStrAcceptsMultiple)
28 from ..opt
import instrument_parameter
29 from ...
import script
32 @click.command(short_help=
"Convert a gen2 repo to gen3.")
33 @repo_argument(required=
True,
34 help=
"REPO is the URI or path to the gen3 repository. Will be created if it does not already "
36 @instrument_parameter(required=
True,
37 help=
"The fully-qualified name of the gen3 Instrument subclass for this camera.")
38 @click.option(
"--gen2root", required=
True,
39 help=
"Root path of the gen 2 repo to be converted.")
40 @click.option(
"--skymap-name",
41 help=
"Name of the new gen3 skymap (e.g. 'discrete/ci_hsc').")
42 @click.option(
"--skymap-config",
43 help=
"Path to skymap config file defining the new gen3 skymap.")
44 @click.option(
"--calibs",
45 help=
"Path to the gen 2 calibration repo. It can be absolute or relative to gen2root.")
46 @click.option(
"--reruns", multiple=
True, callback=split_commas, metavar=typeStrAcceptsMultiple,
47 help=
"List of gen 2 reruns to convert.")
48 @transfer_option(help=
"Mode to use to transfer files into the new repository.")
49 @config_file_option(help=
"Path to a `ConvertRepoConfig` override to be included after the Instrument config "
50 "overrides are applied.")
52 """Convert a Butler gen 2 repository into a gen 3 repository."""
53 cli_handle_exception(script.convert, *args, **kwargs)
56 @click.command(short_help=
"Define visits from exposures.")
57 @repo_argument(required=
True)
58 @config_file_option(help=
"Path to a pex_config override to be included after the Instrument config overrides "
60 @click.option(
"--collections",
61 help=
"The collections to be searched (in order) when reading datasets.",
63 callback=split_commas,
64 metavar=typeStrAcceptsMultiple)
65 @instrument_parameter(required=
True)
67 """Define visits from exposures in the butler registry."""
68 cli_handle_exception(script.defineVisits, *args, **kwargs)
71 @click.command(short_help=
"Ingest raw frames.")
72 @repo_argument(required=
True)
75 @run_option(required=
True)
76 @click.option(
"-d",
"--dir",
"directory",
77 help=
"The path to the directory containing the raws to ingest.")
78 @click.option(
"-f",
"--file", help=
"The name of a file containing raws to ingest.")
80 @click.option(
"--ingest-task", default=
"lsst.obs.base.RawIngestTask", help=
"The fully qualified class name "
81 "of the ingest task to use.")
83 """Ingest raw frames into from a directory into the butler registry"""
84 cli_handle_exception(script.ingestRaws, *args, **kwargs)
87 @click.command(short_help=
"Add an instrument to the repository")
88 @repo_argument(required=
True)
89 @instrument_parameter(parameterType=ParameterType.ARGUMENT, required=
True, multiple=
True,
90 help=
"The fully-qualified name of an Instrument subclass.")
92 """Add an instrument to the data repository.
94 cli_handle_exception(script.registerInstrument, *args, **kwargs)
97 @click.command(short_help=
"Add an instrument's curated calibrations.")
98 @repo_argument(required=
True)
99 @instrument_parameter(required=
True)
100 @run_option(required=
True)
102 """Add an instrument's curated calibrations to the data repository.
104 cli_handle_exception(script.writeCuratedCalibrations, *args, **kwargs)