simtools-db-add-simulation-model-from-repository-to-db#

Add parameters and production tables from a simulation model repository to a new database.

Generates a new database with all required collections. Follows the structure of the CTAO gitlab simulation model repository.

This is an application for experts and should not be used by the general user.

Command line arguments

input_path (str, required)

Path of local copy of model parameter repository.

db_name (str, required)

Name of new DB to be created.

type (str, optional)

Type of data to be uploaded to the DB. Options are: model_parameters, production_tables.

Examples#

Upload model data repository to the DB Loops over all subdirectories in ‘input_path’ and uploads all json files to the database ‘new_db_name’ (or updates an existing database with the same name):

  • subdirectories starting with ‘OBS’ are uploaded to the ‘sites’ collection

  • json files from the subdirectory ‘configuration_sim_telarray/configuration_corsika’ are uploaded to the ‘configuration_sim_telarray/configuration_corsika’ collection

  • ‘Files’ are added to the ‘files’ collection

  • all other json files are uploaded to collection defined in the array element description in ‘simtools/schemas/array_elements.yml’

simtools-db-simulation-model-from-repository-to-db \
    --input_path /path/to/repository \
    --db_name new_db_name \
    --type model_parameters

Upload production tables to the DB:

simtools-db-simulation-model-from-repository-to-db \
    --input_path /path/to/repository \
    --db_name new_db_name \
    --type production_tables
db_add_simulation_model_from_repository_to_db.main()[source]#

Application main.