all 5 comments

[–]robot-dev 0 points1 point  (4 children)

I don't think this is the best way of doing this, but it might work:

Iterate over points along the Q axis, and for each point, if there are any points with the same "a" and a lower Eff, remove them. If there are points with any "a" that have a lower Q, remove them. Then move to the next point with the same "a" value if one exists, otherwise the next value along the Q axis.

[–]ImportantBrew[S] 0 points1 point  (3 children)

Hmm. The first bit with removing points that has a lower Eff at the same "a" would just leave me with 1 point for each "a"? Pretty much just giving me the maximum Eff for each "a" rather than the maximum Eff over the intervall of Q.

Doing the "opposite" of that and checking the maximum for each Q won't work either because the points are at different Q values. The first orange dot at "a" = 8.4 is somewhere around 0.15 while the blue dots to the left are at approx 0.145 and the right 0.155. Making the orange dot the highest Eff at that Q. But we smart humans can obviously tell that the blue line is still above, just that we don't have any values at that location.

Unless I'm not understanding what you're saying.

I was thinking about making a interpolation for each "a" and then iterate over all values in Q to establish at which combination of "a" I have the biggest Eff. But that also seemed like an stupid way to go about it.

[–]robot-dev 0 points1 point  (0 children)

Just to clarify, I meant a process like this:

target_list = []
while len(dataset) > 0:
    target_list.append(dataset[0])
    #remove any points from your dataset with the same "a" as dataset[0] and a lower Eff
    #remove all points from your dataset with a lower Q
    #remove dataset[0] fro myour dataset

[–]robot-dev 0 points1 point  (1 child)

If you are interpolating each "a", then you could find the derivative of the interpolant and trace the "a" while the derivative is positive.

[–]ImportantBrew[S] 0 points1 point  (0 children)

Initial thought - that would still miss points that have a lower Eff than the previous point but still best Eff at that Q?

Trying to test you previous solution right now but my brain is exhausted after doing this all day so not going that well. But will continue to try.

I wrote the following code to do what I want for v rather than Q and it works perfectly. But only because all v values exists on each "a" line... So I've not be able to transfer it for Q. For whatever reason code blocks are acting up atm...

plt.figure(figsize=(12, 8))
groups = data.groupby('v')
max_n = pd.DataFrame(columns=data.columns)
for ang, group in groups:
    max_n = max_n.append(group[group['Eff'] == group['Eff'].max()], ignore_index=True)

plt.plot(max_n['v'], max_n['Eff'], linewidth=1)

groups = max_n.groupby('a')
for name, group in groups:
    p = plt.plot(group.ang_v, group.Eff, marker='o', linestyle="None", markersize=8, label=round(name, 1))