3. Setting up the Calibration Service
DRAGONS comes with a local calibration manager that uses the same calibration
association rules as the Gemini Observatory Archive. This allows the command
line “reduce” (and the API Reduce
instance, not documented here) to make
requests to a local light-weight database for matching processed
calibrations when needed to reduce a dataset.
Below we show how to configure the database and then how to initialize and use it from the command line and from the API.
If you need more details, check the “caldb” documentation in the Recipe System User Manual.
3.1. The Configuration File
The database is configured in the DRAGONS configuration file under the
[calibs]
section.
In ~/.dragons/
, create or edit the configuration file dragonsrc
as
follow:
[calibs]
databases = ${path_tqo_my_data}/ghost_tutorial/playground/cal_manager.db get store
The [calibs]
section tells the system where to put the calibration database
and how to name it. Here we use cal_manager.db
to match what was used in
the pre-v3.1 version of DRAGONS, but you can now set the name of the database
to what suits your needs and preferences.
That local database will keep track of the processed calibrations that we are
going to send to it. With the “get” and “store” options, the database will be
used by DRAGONS to automatically get matching calibrations and to automatically
store master calibrations that you produce. If you remove the “store” option
you will have to caldb add
(command line) or caldb.add_cal()
(API)
your calibration product yourself (like what needed to be done in DRAGONS
v3.0).
Note
The tilde (~
) in the path above refers to your home directory.
Also, mind the dot in .dragons
.
3.2. Usage from the Command Line
To initialize (create) the database run:
caldb init
That’s it. It is ready to use. You can check the configuration and confirm the
settings with caldb config
. On the command line, if the database already
exists it will refuse to act and will let you know. If you do want to delete
the existing database and start fresh, use the “wipe” option: caldb init -w
.
You can manually add processed calibrations with caldb add <filename>
, list
the database content with caldb list
, and caldb remove <filename>
to
remove a file from the database (it will not remove the file on disk.)