pyoculus.fields.spec_bfield

class pyoculus.fields.spec_bfield.SpecBfield(spec_data, lvol)
classmethod from_h5_file(h5_file, lvol)

! Initialize the SPEC magnetic field from a SPEC h5 file @param h5_file the path to the SPEC h5 file @param lvol which volume we are interested in, from 1 to spec_data.input.Mvol Only support SPEC version >=3.0

B(coords, *args)

! Returns magnetic fields @param coordinates f$(s,theta,zeta)f$ @param *args extra parameters @returns the contravariant magnetic fields

dBdX(coords, *args)

! Returns magnetic fields @param coordinates f$(s,theta,zeta)f$ @param *args extra parameters @returns B, dBdX, the contravariant magnetic fields, the derivatives of them

B_many(x1arr, x2arr, x3arr, input1D=True, *args)

! Returns magnetic fields, with multipy coordinate inputs @param x1arr the first coordinates. Should have the same length as the other two if input1D=True. @param x2arr the second coordinates. Should have the same length as the other two if input1D=True. @param x3arr the third coordinates. Should have the same length as the other two if input1D=True. @param input1D if False, create a meshgrid with sarr, tarr and zarr, if True, treat them as a list of points @param *args extra parameters @returns the contravariant magnetic fields

dBdX_many(x1arr, x2arr, x3arr, input1D=True, *args)

! Returns magnetic fields @param x1arr the first coordinates. Should have the same length as the other two if input1D=True. @param x2arr the second coordinates. Should have the same length as the other two if input1D=True. @param x3arr the third coordinates. Should have the same length as the other two if input1D=True. @param input1D if False, create a meshgrid with sarr, tarr and zarr, if True, treat them as a list of points @param *args extra parameters @returns B, dBdX, the contravariant magnetic fields, the derivatives of them

A(coords, *args)

! Returns the vector potential @param coordinates f$(s,theta,zeta)f$ @param *args extra parameters @returns the contravariant vector potential

convert_coords(stz)

! Python wrapper for getting the xyz coordinates from stz @param stz the stz coordinate @returns the xyz coordinates