Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

These are just examples. The tool does not work yet.

The command is

Code Block
createpublicdb_imas

Run:

is still in development phase. Once we agree that current status is what we are looking for, we will release it.

Publicly available copy of private database can be created using createpublicdb_imas.

Code Block
> createpublicdb_imas

To get basic help, run the tool following way

Code Block
> 
Code Block
createpublicdb_imas --help

to get basic documentation.

Example usage

  1. Create a text file with name description.txt that contains a plain-text description of the database you want to save - it can be arbitrary text, it is supposed to give basic information about your pulse file.
  2. Run the tool in 'dry run mode first' dry mode first:

    Code Block
    # You have to provide basic information related to your pulse file
    # createpublicdb_imas -n <USER> <TOKAMAK> <DATAVERSION> <SHOT> <RUN> description.txt
    
    # example - for user g2dfigat - make sure to use your own user name and proper shot/run numbers;
    #           version of database is also mandatory
    
    > 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.

  1. Run the tool:

    Code Block
    > createpublicdb_imas g2dfigat jet 3 12 12 description.txt


  2. Check the output with imasdbs:

    Code Block
    > imasdbs -u public -t jet -v 3

    This should now list the shot (in this case 12)

Test environment

Warning

Please note that for now we are working with artificially created environment - to make sure we don't access public database location yet.


The tools tool is meant to modify the public database, which carries the risk of corrupting important data.
For  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

Code Block
module purge
module load cineca
module load imasenv
cd /pfs/work/g2dfigat/archiving_scripts/R3-imas
source environment

...

Check that you have the development database selected:

Code Block
env | grep PUBLICDB

...

Code Block
IMASPUBLICDBHOME=/pfs/work/g2dfigat/archiving_scripts/imasdb/public
IMASPUBLICDBMETADATA=/pfs/work/g2dfigat/archiving_scripts/imasdb/meta


Notewarning

IMPORTANT: If you don't check this, you risk overwriting the real public database!

...

Run tool

...

Code Block
bin/createpublicdb_imas --help

This should give you some basic documentation.4.

use tool to create entries in the public database

Code Block
createpublicdb_imas <USER> <TOKAMAK> <DATAVERSION> <SHOT> <RUN> description.txt

...