Coverage for tcvx21/grillix_post/observables/langmuir_probe_m.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

5 statements  

1""" 

2Common experimental observables 

3""" 

4import xarray as xr 

5 

6 

7def ion_saturation_current(density: xr.DataArray, sound_speed: xr.DataArray, norm, wall_probe: bool): 

8 """ 

9 Ion saturation current for a Langmuir probe, usually referred to as 'Jsat' or 'Isat' 

10 

11 If the probe is mounted on the wall, set wall_probe = True to remove the 1/2 factor required for 

12 an immersed probe 

13 """ 

14 return xr.DataArray(density * sound_speed * (1.0 if wall_probe else 0.5)).assign_attrs( 

15 norm=(norm.c_s0 * norm.elementary_charge * norm.n0).to('kiloampere*meter**-2'), 

16 name="Ion saturation current") 

17 

18 

19def floating_potential(potential: xr.DataArray, electron_temp: xr.DataArray, norm, sheath_potential: float = 2.69): 

20 """ 

21 Floating potential: the potential at which no current will flow into a probe 

22 """ 

23 

24 return xr.DataArray(potential - electron_temp * sheath_potential).assign_attrs( 

25 norm=potential.norm, name="Sheath potential")