db_add_model_parameters_from_repository_to_db

db_add_model_parameters_from_repository_to_db#

Add parameters found in a model parameter repository to a new database.

Generates a new database with all required collections. Follows the structure of the CTAO gitlab model parameters repository. file as input.

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, required)

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

Examples#

Upload model data repository to the DB:

simtools-db-add_model-parameters-from-repository-to-db             --input_path /path/to/repository             --db_name new_db_name             --type model_parameters

Upload metadata from repository to the DB:

simtools-db-add_model-parameters-from-repository-to-db             --input_path /path/to/repository/metadata             --db_name new_db_name             --type metadata
db_add_model_parameters_from_repository_to_db.add_values_from_json_to_db(file, collection, db, db_name, file_prefix, logger)[source]#

Upload data from json files to db.

Parameters:
filelist

Json file to be uploaded to the DB.

collectionstr

The DB collection to which to add the file.

dbDatabaseHandler

Database handler object.

db_namestr

Name of the database to be created.

file_prefixstr

Path to location of all additional files to be uploaded.

loggerlogging.Logger

Logger object.

db_add_model_parameters_from_repository_to_db.main()[source]#

Application main.