24 from lsst.daf.butler.cli.opt
import (repo_argument,
34 from lsst.daf.butler.cli.utils
import (
38 typeStrAcceptsMultiple
40 from ..opt
import instrument_argument
41 from ...
import script
45 fits_re =
r"\.fit[s]?\b"
48 @click.command(short_help=
"Convert a gen2 repo to gen3.", cls=ButlerCommand)
49 @repo_argument(required=
True,
50 help=
"REPO is the URI or path to the gen3 repository. Will be created if it does not already "
52 @click.option(
"--gen2root", required=
True,
53 help=
"Root path of the gen 2 repo to be converted.")
54 @click.option(
"--skymap-name",
55 help=
"Name of the new gen3 skymap (e.g. 'discrete/ci_hsc').")
56 @click.option(
"--skymap-config",
57 help=
"Path to skymap config file defining the new gen3 skymap.")
58 @click.option(
"--calibs",
59 help=
"Path to the gen 2 calibration repo. It can be absolute or relative to gen2root.")
60 @click.option(
"--reruns", multiple=
True, callback=split_commas, metavar=typeStrAcceptsMultiple,
61 help=
"List of gen 2 reruns to convert.")
62 @transfer_option(help=
"Mode to use to transfer files into the new repository.")
64 @config_file_option(help=
"Path to a `ConvertRepoConfig` override to be included after the Instrument config "
65 "overrides are applied.")
66 @options_file_option()
68 """Convert a Butler gen 2 repository into a gen 3 repository."""
69 cli_handle_exception(script.convert, *args, **kwargs)
72 @click.command(short_help=
"Define visits from exposures.", cls=ButlerCommand)
73 @repo_argument(required=
True)
75 @config_file_option(help=
"Path to a pex_config override to be included after the Instrument config overrides "
77 @click.option(
"--collections",
78 help=
"The collections to be searched (in order) when reading datasets.",
80 callback=split_commas,
81 metavar=typeStrAcceptsMultiple)
83 @options_file_option()
85 """Define visits from exposures in the butler registry."""
86 cli_handle_exception(script.defineVisits, *args, **kwargs)
89 @click.command(short_help=
"Ingest raw frames.", cls=ButlerCommand)
90 @repo_argument(required=
True)
91 @locations_argument(help=
"LOCATIONS specifies files to ingest and/or locations to search for files.",
93 @regex_option(default=fits_re,
94 help=
"Regex string used to find files in directories listed in LOCATIONS. "
95 "Searches for fits files by default.")
96 @config_option(metavar=
"TEXT=TEXT", multiple=
True)
97 @config_file_option(type=click.Path(exists=
True, writable=
False, file_okay=
True, dir_okay=
False))
98 @run_option(required=
False)
101 @click.option(
"--ingest-task", default=
"lsst.obs.base.RawIngestTask", help=
"The fully qualified class name "
102 "of the ingest task to use.")
103 @options_file_option()
105 """Ingest raw frames into from a directory into the butler registry"""
106 cli_handle_exception(script.ingestRaws, *args, **kwargs)
109 @click.command(short_help=
"Add an instrument to the repository", cls=ButlerCommand)
110 @repo_argument(required=
True)
111 @
instrument_argument(required=
True, nargs=-1, help=
"The fully-qualified name of an Instrument subclass.")
113 """Add an instrument to the data repository.
115 cli_handle_exception(script.registerInstrument, *args, **kwargs)
118 @click.command(short_help=
"Add an instrument's curated calibrations.", cls=ButlerCommand)
119 @repo_argument(required=
True)
121 @click.option(
"--collection", required=
False,
122 help=
"Name of the calibration collection that associates datasets with validity ranges.")
123 @click.option(
"--suffix", required=
False,
124 help=(
"Name suffix to append (with an automatic delimiter) to all RUN collection names "
125 "as well as the calibration collection name if it is not provided via --collection."))
126 @options_file_option()
128 """Add an instrument's curated calibrations to the data repository.
130 cli_handle_exception(script.writeCuratedCalibrations, *args, **kwargs)