desc.coils.CoilSet.from_makegrid_coilfile
- classmethod CoilSet.from_makegrid_coilfile(coil_file, method='cubic', check_intersection=True)Source
Create a CoilSet of SplineXYZCoils from a MAKEGRID-formatted coil txtfile.
If 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 attempt to return only a single CoilSet of all of the coils in the 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
check_intersection (bool) – whether to check the resulting coilsets for intersecting coils.