LCODE-specific methods§
The methods in this page are accessible to a data object if:
<data_obj>.attrs['data_origin'] == 'lcode'#(1)!
<data_obj>
may be eitherozzy.DataArray
orozzy.Dataset
convert_q
§
convert_q(dxi, n0, q_var='q')
Convert the charge variable to physical units (in units of \(e\)).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
float
|
The grid spacing in the longitudinal direction in normalized units, i.e., in units of \(k_p^{-1}\). or \(\mathrm{cm}\). |
required |
|
float
|
The reference density, in \(\mathrm{cm}^{-3}\). |
required |
|
str
|
Name of the charge density variable. |
'q'
|
Returns:
Type | Description |
---|---|
None
|
The dataset is modified in place. |
Notes
The charge in physical units (\(\mathrm{C}\)) is obtained by multiplying the normalized charge with the factor \(\frac{\Delta \hat{\xi}}{2} \frac{I_A}{\omega_p}\), where \(\Delta \hat{\xi} = k_p \Delta \xi\) is the normalized longitudinal cell size and \(I_A\) is the Alfvén current, defined as:
Note that the charge is given in units of the elementary charge \(e\) after this method is applied.
Examples:
Particle data
import ozzy as oz
file = 'path/to/particle/file/tb02500.swp'
ds = oz.open('lcode', file)
ds.ozzy.convert_q(dxi=0.01, n0=2e14, q_var='q')
print(ds)