I have been generating some figures for some profile measurements; however, I am finding that the flatness does not seem to work for “smaller” field sizes.
It works perfectly fine for larger than 10x10, just not for smaller field sizes (such as a 10x10 electron field).
Update: As shown in the plot, the lower value for tthe flatness is incorrect as it should reside on the profile. The result in getting is 14% (it should be less than 1%).
Any thoughts?
Some of my code below (taken from an excel file).
df = pd.read_csv('{}/{}.csv'.format(path, fn))
# Convert the Dataframe into a numpy array
a = df.to_numpy()
# Create the profile data using PyLinac functions (FFF)
profile1 = InflectionDerivativeProfilePhysical(values = a[:,1], x_values = a[:,0])
profile1.compute(metrics=[FlatnessDifferenceMetric(in_field_ratio=0.2)])
# Extra small field ratio to show the confusion
m