25 from lsst.daf.butler.cli.opt
import repo_option, run_option
26 from lsst.daf.butler
import Butler
27 from ..opt
import instrument_option
28 from ...utils
import getInstrument
30 log = logging.getLogger(__name__)
33 @click.command(name=
"write-curated-calibrations")
34 @instrument_option(required=
True)
35 @repo_option(required=
True)
36 @run_option(required=
True)
39 """Add an instrument's curated calibrations to the data repository.
41 butler = Butler(repo, writeable=
True, run=output_run)
44 except RuntimeError
as err:
45 log.critical(f
"Exception getting instrument: {err}")
46 raise click.BadParameter(f
"Failed getting instrument {instrument} from repo {repo}")
47 except TypeError
as err:
48 log.critical(f
"{instrument} is not an Instrument subclass. {err}")
49 raise click.BadParameter(f
"{instrument} is not an Instrument subclass.")
50 instr.writeCuratedCalibrations(butler)