desc.coils.MixedCoilSet.from_makegrid_coilfile
- classmethod MixedCoilSet.from_makegrid_coilfile(coil_file, method='cubic', ignore_groups=False, check_intersection=True)Source
Create a MixedCoilSet of SplineXYZCoils from a MAKEGRID coil txtfile.
If ignore_groups=False and the MAKEGRID contains more than one coil group (denoted by the number listed after the current on the last line defining a given coil), this function will try to return a MixedCoilSet of CoilSets, with each sub CoilSet pertaining to the different coil groups. If the coils in a group have differing numbers of knots, then it will return MixedCoilSets instead. The name of the sub (Mixed)CoilSet will be the number and the name of the group listed in the MAKEGRID file.
- Parameters:
coil_file (str or path-like) – path to coil file in txt format
method (str) –
method of interpolation
'nearest': nearest neighbor interpolation'linear': linear interpolation'cubic': C1 cubic splines (aka local splines)'cubic2': C2 cubic splines (aka natural splines)'catmull-rom': C1 cubic centripetal “tension” splines'cardinal': C1 cubic general tension splines. If used, default tension of c = 0 will be used'monotonic': C1 cubic splines that attempt to preserve monotonicity in the data, and will not introduce new extrema in the interpolated points'monotonic-0': same as ‘monotonic’ but with 0 first derivatives at both endpoints
ignore_groups (bool) – If False, return the coils in a nested MixedCoilSet, with a sub coilset per single coilgroup. If there is only a single group, however, this will not return a nested coilset, but just a single coilset for that group. if True, return the coils as just a single MixedCoilSet.
check_intersection (bool) – whether to check the resulting coilsets for intersecting coils.