Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum finding algorithm seems to have a slight error #97

Open
tbody-cfs opened this issue Sep 6, 2024 · 2 comments
Open

Minimum finding algorithm seems to have a slight error #97

tbody-cfs opened this issue Sep 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@tbody-cfs
Copy link
Collaborator

Exact minimum point is a bit off — what is going on here?

Screenshot 2024-09-06 at 3 36 59 PM
@tbody-cfs tbody-cfs self-assigned this Sep 6, 2024
@hassec hassec added the bug Something isn't working label Sep 9, 2024
@tbody-cfs
Copy link
Collaborator Author

In the separatrix_operational_space.ipynb notebook, you can see what is causing this issue. Where there are multiple points fulfilling the mask condition with the same value, the code is returning the first value it finds.

from cfspopcon.shaping_and_selection import find_coords_of_minimum

dataset["SepOS_LH_transition"].T.plot(vmin=0.9, vmax=1.1)
dataset["SepOS_LH_transition"].T.plot.contour(levels=[1.0])

point = dataset.isel(find_coords_of_minimum(dataset["separatrix_electron_temp"], mask=dataset["SepOS_LH_transition"] > 1.0))

plt.scatter(point.separatrix_electron_density, point.separatrix_electron_temp, color="r")

plt.ylim(50, 70)

image

@tbody-cfs
Copy link
Collaborator Author

Increasing the resolution is a simple solution, i.e. 10x increase in both dimensions

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants