Issue with flatness metric for smaller fields

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

Hi,

I do not understand what your Question actually is. What results do you get for your Flatness? Did you compare the pylinac results to calculations done by hand? According to the plot I would assume the Flatness is excellent?
Formula: Profiles & 1D Metrics - pylinac 3.28.0 documentation

regards
Thomas

Sorry, but if you look at the green box in the figure, the lower point makes no sense. The two points in the box should be localized to the profile.

Flatness should be close to 1, but I’m get 14 as a result.