1. How to use tool
These are just examples. The tool does not work yet.
The command is
createpublicdb_imas
Run:
createpublicdb_imas --help
to get basic documentation.
1.1. Example usage
- Create a text file with name description.txt that contains a plain-text description of the database you want to save
Run the tool in 'dry run mode first':
createpublicdb_imas -n <USER> <TOKAMAK> <DATAVERSION> <SHOT> <RUN> description.txt createpublicdb_imas -n g2dfigat jet 3 12 12 description.txt
This will output the actions that will be taken and the metadata file that will be created on stdout.
Run the tool:
createpublicdb_imas g2dfigat jet 3 12 12 description.txt
Check the output with imasdbs:
imasdbs -u public -t jet -v 3
This should now list the shot (in this case 12)
2. Test environment
The tools is meant to modify the public database, which carries the risk of corrupting important data.
For testing the tool, or practicing its use, a test environment is foreseen. In this test environment a test copy of the public database is used. Below are instructions how to use the test environment.
1. Switch to development environment
module purge module load imasenv cd /pfs/work/g2dfigat/archiving_scripts/R3-imas source environment
2. check that you have the development database selected:
env | grep PUBLICDB
This should give:
IMASPUBLICDBHOME=/pfs/work/g2dfigat/archiving_scripts/imasdb/public IMASPUBLICDBMETADATA=/pfs/work/g2dfigat/archiving_scripts/imasdb/meta
IMPORTANT: If you don't check this, you risk overwriting the real public database!
3. run tool:
bin/createpublicdb_imas --help
This should give you some basic documentation.
4. use tool to create entries in the public database
createpublicdb_imas <USER> <TOKAMAK> <DATAVERSION> <SHOT> <RUN> description.txt
In case of error:
ERROR - Public database not set up for tokamak west and data version 3
ERROR - You have to run
create_public_imas_dir <TOKAMAK> <DATAVERSION>
Please run:
./create_public_imas_dir <TOKAMAK> <DATAVERSION>
5. check that the public database is populated correctly:
ls -l $IMASPUBLICDBHOME/<TOKAMAK>/3/0/
or
bin/publicIMASdb -u public
6. please report any problems you find.