eqdsk2ids

eqdsk2ids EQDSK Convertor allows users to specify a destination URI, a GEQDSK file path, logging levels, and Tokamak coordinate conventions for converting GEQDSK file to equilibrium IDS

Syntax eqdsk2ids

$ eqdsk2ids -h
22:18:24 INFO     Parsing data dictionary version 4.1.1 @dd_zip.py:89
Usage: eqdsk2ids [-h] -d DEST [-f] -g GPATH [GPATH ...]
                 [--log {DEBUG,INFO,WARNING,ERROR,CRITICAL}] -c
                 {1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18}

(I) Command Line Interface for EQDSK Converter (eqdsk2ids)

Usage:

 0 Load IMAS and install fortranformat and Cerberus (if not done before)
   ▌ module load IMAS
   ▌ pip install fortranformat cerberus
 1 Compute COCOS and create IDS data file in local database
   ▌ eqdsk2ids -g path_to_gfile -d "imas:hdf5?path=/path/to/data" -c 11
 2 Process multiple files using wildcards
   ▌ eqdsk2ids -g "*.geqdsk" -d "imas:hdf5?path=/path/to/data" -c 11
 3 Process multiple files by specifying them individually
   ▌ eqdsk2ids -g file1.g file2.g file3.g -d "imas:hdf5?path=/path/to/data"
   ▌ -c 11
 4 Increase verbosity to see COCOS index and transformation coefficient info.
   ▌ eqdsk2ids -g gfile -d "imas:hdf5?path=/path/to/data" -c 11 --log INFO

(II) Functional Interface in Python (idstools/eqdsk2ids.py)

Usage:

 0 Initialization
   ▌ from idstools.eqdsk2ids import eqdsk2ids
 1 Convert single G-file
   ▌ eq = eqdsk2ids(gfile='path/to/gfile')
 2 Convert multiple files with wildcards
   ▌ eq = eqdsk2ids(gfile='path/to/*.geqdsk')
 3 Convert multiple files as a list
   ▌ eq = eqdsk2ids(gfile=['file1.g', 'file2.g', 'file3.g'])
 4 Convert with COCOS input (=1) coerced
   ▌ eq = eqdsk2ids(gfile='path/to/gfile', cocos_in=1)

Options:
  -h, --help            show this help message and exit
  -d, --dest DEST       destination uri (e.g. imas:hdf5?path=./testdb or
                        ./testpulse.nc)
  -f, --force           Force creation of destination data-entry (existing
                        data lost)
  -g, --gpath GPATH [GPATH ...]
                        path(s) to GEQDSK file(s). Can specify multiple files
                        separated by spaces, use wildcards (e.g., *.g), or
                        provide a directory
  --log {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Configure the logging level, default=WARNING
  -c, --cocos_in {1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18}
                        Tokamak coordinate conventions (COCOS) describing
                        input data

Example eqdsk2ids

$ eqdsk2ids -c 11 -g resources/geqdsk/example.gfile --dest "imas:hdf5?user=sawantp1;pulse=134174;run=117;database=ITER;version=3" --log INFO
24/10/30 16:38:16 INFO: loading GEQDSK file ...
24/10/30 16:38:16 INFO: GEQDSK COCOS:
{ 'COCOS': 11,
'sigma_ip': -1.0,
'sigma_b0': -1.0,
'exp_bp': 1,
'sigma_bp': 1,
'sigma_rphi_z': 1,
'sigma_rhothetaphi': 1,
'sign_q_pos': 1,
'sign_pprime_pos': -1,
'theta_sign_clockwise': 1}
24/10/30 16:38:16 INFO: GEQDSK Transformation Coeff.:
{ 'sigma_Ip_eff': 1.0,
'sigma_B0_eff': 1.0,
'sigma_Bp_eff': 1.0,
'sigma_rhothetaphi_eff': 1.0,
'sigma_RphiZ_eff': 1.0,
'exp_Bp_eff': 0.0,
'fact_psi': 1.0,
'fact_q': 1.0,
'fact_dpsi': 1.0,
'fact_dtheta': 1.0}
24/10/30 16:38:16 INFO: mapping GEQDSK to IDS/equilibrium ...
24/10/30 16:38:16 INFO: IDS COCOS:
{ 'COCOS': 11,
'exp_Bp': 1,
'sigma_B0': -1,
'sigma_Bp': 1,
'sigma_Ip': -1,
'sigma_RphiZ': 1,
'sigma_rhothetaphi': 1,
'sign_pprime_pos': -1,
'sign_q_pos': 1,
'theta_sign_clockwise': 1}
24/10/30 16:38:16 INFO: creating output datafile ...
24/10/30 16:38:16 INFO: IDS/equilibrium populated in  sdcc-login04.iter.org:imas:hdf5?user=sawantp1;pulse=134174;run=117;database=ITER;version=3 .