22 from lsst.daf.butler
import Butler
23 from lsst.obs.base import DefineVisitsTask, DefineVisitsConfig
24 from ..utils
import getInstrument
28 """Implements the command line interface `butler define-visits` subcommand,
29 should only be called by command line tools and unit test code that tests
32 Defines visits from exposures in the butler registry
37 URI to the location to create the repo.
38 config_file : `str` or `None`
39 Path to a config file that contains overrides to the ingest config.
40 collections : `list` [`str`]
41 An expression specifying the collections to be searched (in order) when
42 reading datasets, and optionally dataset type restrictions on them.
44 The name or fully-qualified class name of an instrument.
46 butler = Butler(repo, collections=collections, writeable=
True)
49 instr.applyConfigOverrides(DefineVisitsTask._DefaultName, config)
51 if config_file
is not None:
52 config.load(config_file)
54 task.run(butler.registry.queryDimensions([
"exposure"]))