Skip to content

Commit

Permalink
rename TOPICA_front_face -> interpolate_front_face
Browse files Browse the repository at this point in the history
  • Loading branch information
jhillairet committed Dec 2, 2022
1 parent 78e1a49 commit 82a7f6e
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions west_ic_antenna/antenna.py
Expand Up @@ -1667,20 +1667,19 @@ def capacitor_velocities(self, power: NumberLike, phase: NumberLike,
return v_left.T, v_right.T # (nb_f, 2)

@classmethod
def TOPICA_front_face(self, Rc: float, mode: str = "L") -> rf.Network:
def interpolate_front_face(self, Rc: float, source: str = "TOPICA-L-mode") -> rf.Network:
"""
Return a TOPICA front-face rf.Network interpolated from the L or H mode data.
Parameters
----------
Rc : float
Desired interpolated coupling resistance value. Rc must be within
the interval of possible values, which depends of the mode:
L-mode plasma front-face have Rc in [1, 2.91]
H-mode plasma front-face have Rc in [0.39, 1.71]
the interval of possible values, which depends of the front-face type:
mode : str, optional
'L' or 'H' mode profile. The default is 'L'.
source : str, optional
'TOPICA-L-mode': L-mode plasmas from TOPICA. Rc in [1, 2.91] (default)
'TOPICA-H-mode': H-mode plasmas from TOPICA. Rc in [0.39, 1.71]
Returns
-------
Expand All @@ -1689,10 +1688,10 @@ def TOPICA_front_face(self, Rc: float, mode: str = "L") -> rf.Network:
Examples
--------
>>> plasma = WestIcrhAntenna.TOPICA_front_face(Rc=1, mode='L')
>>> plasma = WestIcrhAntenna.interpolate_front_face(Rc=1, mode='TOPICA-L-mode')
"""
if mode == "L":
if source == "TOPICA-L-mode":
ntwks = [
rf.Network(filename)
for filename in [
Expand All @@ -1703,7 +1702,7 @@ def TOPICA_front_face(self, Rc: float, mode: str = "L") -> rf.Network:
]
# Ideal coupling resistance for each of them
Rcs = [1.0, 1.34, 1.57, 1.81, 2.05, 2.45, 2.65, 2.91]
elif mode == "H":
elif source == "TOPICA-H-mode":
ntwks = [
rf.Network(
S_PARAMS_DIR
Expand All @@ -1720,6 +1719,18 @@ def TOPICA_front_face(self, Rc: float, mode: str = "L") -> rf.Network:
]
Rcs = [0.39, 0.80, 1.71]

elif source == "homogeneous-dielectric":
epsr = [1, 21, 41, 61, 81, 101, 121, 141, 161, 181, 200]
ntwks = [
rf.Network(filename)
for filename in [
S_PARAMS_DIR
+ f"/front_faces/homogeneous_dielectric/WEST_ICRH_front_face_Front Face Flat homogeneous Dielectric_epsr{idx:03}.s4p"
for idx in epsr
]
]
Rcs = [0.036, 0.045, 0.063, 0.097, 0.173, 0.335, 0.542, 0.775, 1.044, 1.316, 1.607]

ntw_set = rf.NetworkSet(ntwks)

# interpolate if desired Rc is within the Rcs
Expand Down

0 comments on commit 82a7f6e

Please sign in to comment.