idstools.compute.waves

This module provides compute functions and classes for waves ids data

refer data dictionary.

Module Contents

class idstools.compute.waves.WavesCompute(ids)[source]

This class provides compute functions for waves ids.

ids

The waves IDS (Integrated Data Structure) object containing radiofrequency and microwave heating system data including antenna properties, power delivery, and wave propagation information.

Type:

object

Initialization WavesCompute object.

Parameters:
ids

waves ids object

ids
get_b_resonance(coherent_wave_index: int, time_slice: int, harmonic_frequencies: list = None)[source]

This function calculates the B-resonance (magnetic field) for a given coherent wave index, time index, and list of harmonic frequencies.

Parameters:
coherent_wave_index: int

The index of the coherent wave for which we want to calculate the B resonance.

time_slice: int

The index of the time step for which the bResonance is being calculated.

harmonic_frequencies: list = None

A list of integers representing the harmonic frequencies for which the B-resonance values are to be calculated. If this parameter is not provided, the function uses the default values of [1, 2, 3, 4].

Returns:

A list of values for the magnetic field resonance frequencies for the given coherent wave index, time index, and harmonic frequencies. The length of the list is equal to the length of the input harmonic frequencies list.

Notes

\[BResonance = \ 2*pi*ecfrequency*9.1e^-31/1.6e^-19/HarmonicFrequency\]

Here harmonicFrequency is any value from [1,2,3,4]

Example

import imas
from idstools.compute.waves import WavesCompute

connection = imas.DBEntry("imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3","r")
idsObj = connection.get('waves')
connection.close()
waveobj = WavesCompute(idsObj)
print(waveobj.get_b_resonance(coherent_wave_index=0, time_slice=0))

[6.0750547938792625, 3.0375273969396313, 2.025018264626421, 1.5187636984698156]
get_beam_array()[source]

This function returns an array of beam indices based on the number of coherent waves.

Returns:

a numpy array of equally spaced values from 0 to nbeam-1, where nbeam is the length of the list waves.coherent_wave. This array represents the indices of the beams.

Example

import imas
from idstools.compute.waves import WavesCompute

connection = imas.DBEntry("imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3","r")
idsObj = connection.get('waves')
connection.close()
waveobj = WavesCompute(idsObj)
print(waveobj.get_beam_array())

[ 0.  1.  2.  3.  4.  5.  6.  7.  8.  9. 10.]
get_beam_tracing(time_slice: int)[source]

This function returns a dictionary containing information about the beam tracing of a coherent wave.

Parameters:
time_slice: int

The index of the time step for which to retrieve the beam tracing data. Defaults to 0

Returns:

a dictionary named “beam_tracing” which contains various arrays and values related to the beam tracing data. Following are the values returned by the function

Example

import imas
from idstools.compute.waves import WavesCompute

connection = imas.DBEntry("imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3","r")
idsObj = connection.get('waves')
connection.close()
waveobj = WavesCompute(idsObj)
print(waveobj.get_beam_tracing(time_slice=0))
get_beams(time_slice: int)[source]

This function returns a dictionary of active beams with their respective properties.

Parameters:
time_slice: int

The parameter time_slice is an integer that represents the index of the beam tracing time. Defaults to 0

Returns:

Dictionary called beams which contains information about each beam in waves.coherent_wave. The dictionary has keys for each beam index and the values are dictionaries containing the total number of beams and boolean indicating whether the beam is active or not. The function determines if a beam is active by checking if any of its rays have initial power greater than 0.

Example

import imas
from idstools.compute.waves import WavesCompute

connection = imas.DBEntry("imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3","r")
idsObj = connection.get('waves')
connection.close()
waveobj = WavesCompute(idsObj)
print(waveobj.get_beams(time_slice=0))

{0: {'active': True, 'total_beams': 5},
1: {'active': True, 'total_beams': 5},
2: {'active': True, 'total_beams': 5},
3: {'active': True, 'total_beams': 5},
4: {'active': True, 'total_beams': 5},
5: {'active': True, 'total_beams': 5},
6: {'active': True, 'total_beams': 5},
7: {'active': True, 'total_beams': 5},
8: {'active': True, 'total_beams': 5},
9: {'active': True, 'total_beams': 5},
10: {'active': True, 'total_beams': 5}}
get_ec_launchers_info(time_slice: int, usepsi=False, verbose=False)[source]

The function get_ec_launchers_info retrieves information about electron cyclotron launchers, including power, current, and profiles, at a specified time index.

Parameters:
time_slice: int

The time_slice parameter

usepsi=False

The usepsi parameter in the get_ec_launchers_info method is a boolean flag that indicates whether to use psi (magnetic flux) information when retrieving radial grid data. When usepsi is set to True, the method will include psi information in the radial grid. Defaults to False

verbose=False

The verbose parameter

Returns:

The function get_ec_launchers_info returns a dictionary ec_launcher_info containing information about the EC (Electron Cyclotron) launchers. The dictionary includes various keys with corresponding values such as the names of single EC launchers, injected power, absorbed power, ECCD (Electron Cyclotron Current Drive), total injected power, total absorbed power, total ECCD, power density

get_omega_ec(coherent_wave_index: int, time_slice: int) float[source]

This function returns the angular frequency of a coherent wave at a specific time index.

Parameters:
coherent_wave_index: int

The index of the coherent wave for which the angular frequency needs to be calculated. Defaults to 0

time_slice: int

The time index parameter is used to specify the time step for which the frequency of the coherent wave is to be retrieved. Defaults to 0

Returns:

The value of the angular frequency (in radians per second) of a coherent wave at a specific time index. The value is calculated using the frequency of the coherent wave at the given time index and multiplying it by 2*pi.

Notes

\[OmegaEC = \ 2*pi*frequency\]

Example

import imas
from idstools.compute.waves import WavesCompute

connection = imas.DBEntry("imas:mdsplus?user=public;pulse=134174;run=117;database=ITER;version=3","r")
idsObj = connection.get('waves')
connection.close()
waveobj = WavesCompute(idsObj)
print(waveobj.get_omega_ec(coherent_wave_index=0, time_slice=0))

1068141502220.5297
get_radial_grid_info(time_slice: int, usepsi=False)[source]

The function get_radial_grid_info retrieves radial grid information for coherent waves, with an option to use psi as a radial coordinate.

Parameters:
time_slice: int

The time_slice parameter

usepsi=False

The usepsi parameter tells whether to use the psi radial coordinate for the grid information.

Returns:

The function get_radial_grid_info returns a dictionary data containing information about the radial grid for each coherent wave in the object. If no active waves are found, it returns None.

is_active_during_pulse(coherent_wave_index)[source]

The function is_active_during_pulse checks if a specific wave is active during a pulse based on its power values at different time points.

Parameters:
coherent_wave_index

The coherent_wave_index parameter in the is_active_during_pulse method represents index of the coherent wave that you want to check for activity. This index is used to access a specific coherent wave within the coherent_wave list.

Returns:

The function is checking if there is any time point during the pulse where the power of the coherent wave at the specified coherent_wave_index is greater than 0. If such a time point is found, function returns True. If no such time point is found, the function returns False.

idstools.compute.waves.logger