MCFlowMace / CRESana

Analytic CRES signal modeling
2 stars 1 forks source link

AnalyticRotationSymmetricField treats negative B-values incorrectly #10

Closed MCFlowMace closed 8 months ago

MCFlowMace commented 8 months ago

It was observed that the b-field of AnalyticRotationSymmetricField apparently only reproduces positive B-values even if the input B-profile is negative.

B_background = 0.96

z_max = 2.
nz = 100
z = np.linspace(-z_max, z_max, nz)
poly = np.poly1d([2.5, 0.5, 0., B_background])
plt.plot(z, poly(z))
plt.xlabel('z[m]')
plt.ylabel('B[T]')

bfield = AnalyticRotationSymmetricField(poly)
bfield.plot_field_profile(r0=0., z0=z_max, nz=nz)

Result:

image

image

MCFlowMace commented 8 months ago

Turns out that the first plot is B_z, and the second is |B|. I.e. no negative values are the expectation