@@ -1101,7 +1101,7 @@ def parse_vmec_inputs(vmec_fname, threshold=0): # noqa: C901
11011101 )
11021102 )
11031103 ctype = vmec_indata .get ("PCURR_TYPE" , "power_series" )
1104- if ctype .lower () != "power_series" :
1104+ if not ctype .lower () in [ "power_series" , "power_series_i" ] :
11051105 warnings .warn (
11061106 colored (
11071107 "current is not a power series! DESC can only read power series"
@@ -1135,7 +1135,11 @@ def parse_vmec_inputs(vmec_fname, threshold=0): # noqa: C901
11351135 # read current
11361136 curr_tor = vmec_indata .get ("CURTOR" , None )
11371137 AC = np .atleast_1d (vmec_indata .get ("AC" , np .array ([0.0 ]))).astype (float )
1138- ls = np .arange (0 , AC .size ) * 2
1138+ ls = (
1139+ np .arange (0 , AC .size ) * 2
1140+ if ctype .lower == "power_series"
1141+ else np .arange (1 , AC .size + 1 ) * 2
1142+ )
11391143 inputs ["current" ] = np .vstack ([ls , AC ]).T
11401144
11411145 # axis
@@ -1511,16 +1515,17 @@ def parse_vmec_inputs(vmec_fname, threshold=0): # noqa: C901
15111515 # scale pressure profile
15121516 inputs ["pressure" ][:, 1 ] *= pres_scale
15131517 if not iota_flag :
1514- # integrate current profile wrt s=rho^2
1515- inputs ["current" ] = np .pad (
1516- np .vstack (
1517- (
1518- inputs ["current" ][:, 0 ] + 2 ,
1519- inputs ["current" ][:, 1 ] * 2 / (inputs ["current" ][:, 0 ] + 2 ),
1520- )
1521- ).T ,
1522- ((1 , 0 ), (0 , 0 )),
1523- )
1518+ if ctype == "power_series" :
1519+ # integrate current derivative profile wrt s=rho^2
1520+ inputs ["current" ] = np .pad (
1521+ np .vstack (
1522+ (
1523+ inputs ["current" ][:, 0 ] + 2 ,
1524+ inputs ["current" ][:, 1 ] * 2 / (inputs ["current" ][:, 0 ] + 2 ),
1525+ )
1526+ ).T ,
1527+ ((1 , 0 ), (0 , 0 )),
1528+ )
15241529 # scale current profile
15251530 if curr_tor is not None :
15261531 inputs ["current" ][:, 1 ] *= curr_tor / (
0 commit comments