gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Add CORSIKA parameters to DB and add reading code #1056

Closed GernotMaier closed 1 month ago

GernotMaier commented 1 month ago

Add CORSIKA parameters to the database and change the code to read and digest the values.

Preamble: CORSIKA has many input parameters.

For this pull request, the following changes are applied:

This PR requires a new version of the model_parameters; this means you should change the database name in your .env definitions (after merge of https://gitlab.cta-observatory.org/cta-science/simulations/simulation-model/model_parameters/-/merge_requests/43 and release of a new model parameter version).

GernotMaier commented 1 month ago

Unit and integration tests are failing at this point, as the model parameter DB has not been update (but which needs code from this PR to be updated!).

Locally, all tests pass.

Do run tests locally, do:

git checkout corsika-parameters-in-db
cd database_scripts
./setup_local_db.sh
./upload_from_model_repository_to_local_db.sh

Change your .env file to:

# Environmental variables
SIMTOOLS_DB_API_PORT=27017 #Port on the MongoDB server
SIMTOOLS_DB_SERVER='simtools-mongodb'
SIMTOOLS_DB_API_USER='api' # username for MongoDB
SIMTOOLS_DB_API_PW='password' # Password for MongoDB
SIMTOOLS_DB_API_AUTHENTICATION_DATABASE='admin'
SIMTOOLS_DB_SIMULATION_MODEL='Staging-CTA-Simulation-Model-v0-3-0'
SIMTOOLS_SIMTEL_PATH='/workdir/sim_telarray'

and run a dev container connected to this Network:

podman run --rm -it -v "$(pwd)/:/workdir/external" --network simtools-mongo-network ghcr.io/gammasim/simtools-dev:latest bash -c "source /workdir/env/bin/activate && cd /workdir/external/simtools && pip install -e . && bash

Test should pass with this configuration.

ctao-dpps-sonarqube[bot] commented 1 month ago

Passed

Analysis Details

3 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Passed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Passed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

GernotMaier commented 1 month ago

Thank you for the review!