The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
OpenFUSIONToolkit.util Namespace Reference

Detailed Description

Helper functions for Open FUSION Toolkit (OFT) Python interfaces.

Authors
Chris Hansen
Date
May 2023

Functions

 oft_warning (warning, details=[])
 Print warning in common format.
 read_fortran_namelist (file0, silent=True, b_arr=False)
 run_shell_command (command, timeout=10, env_vars={})
 Run a shell command.

Variables

float eC = 1.60217663e-19
 Electron charge.
int mu0 = numpy.pi*4.E-7
 Vacuum magnetic permeability.

Function Documentation

◆ oft_warning()

oft_warning ( warning,
details = [] )

Print warning in common format.

Parameters
warningString describing warning
detailsList of additional details

◆ read_fortran_namelist()

read_fortran_namelist ( file0,
silent = True,
b_arr = False )
Return a dictionary with the parameters in the namelist file (file0)

  @param file0 File to read from
  @param silent If false, print dictionary entries after reading
  @param b_arr Refers to an array at the bottom of the file, if one exists
  @result Dictionary containing data from file0.

◆ run_shell_command()

run_shell_command ( command,
timeout = 10,
env_vars = {} )

Run a shell command.

Parameters
commandCommand and arguments to run
timeoutTimeout for command to complete [seconds]
env_varsModifications to runtime environment
Returns
result STDOUT, errcode Error code from command

Variable Documentation

◆ eC

float eC = 1.60217663e-19

Electron charge.

◆ mu0

int mu0 = numpy.pi*4.E-7

Vacuum magnetic permeability.