-
Notifications
You must be signed in to change notification settings - Fork 43
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
Largest, not first maximum used in corfunc #2457
Closed
lucas-wilkins
wants to merge
15
commits into
main
from
2453-corfunc-parameter-extraction-is-not-correctly-identifying-the-long-period
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0b18a58
Added a line, but the values appear to be wrong.
lucas-wilkins e178471
More robust inflection point extraction method (still requires bugfix)
lucas-wilkins 7719c79
Bug squashed
lucas-wilkins fca9b6b
Remove prints
lucas-wilkins 59861b6
BUGFIX: Extrapolation calculation fixed
lucas-wilkins 0aba151
Added options to corfunc
lucas-wilkins 2f6ed27
Finished adding lines and diagram
lucas-wilkins 532d35b
Attempt to fix circular reference issue in test
lucas-wilkins 984b36a
Fixed utest
lucas-wilkins 54ae299
Much longer max wait time
lucas-wilkins 2a0bd21
Merge branch 'main' into 2444-parameter-extraction-lines-on-corfunc
lucas-wilkins 5e9e008
Removed defunct LineThroughPoints import
lucas-wilkins 5421a7d
Merge branch '2444-parameter-extraction-lines-on-corfunc' of https://…
lucas-wilkins 29cc82c
Fixed import error from cyclic import fix
lucas-wilkins 7ffab1f
Long period calculated from largest maximum not first
lucas-wilkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
from typing import Optional | ||
from sas.sascalc.corfunc.corfunc_calculator import SupplementaryParameters | ||
|
||
from sas.qtgui.Perspectives.Corfunc.CorfuncCanvas import CorfuncCanvas | ||
|
||
|
||
class ExtractionCanvas(CorfuncCanvas): | ||
""" Canvas for displaying real space representation""" | ||
|
||
def __init__(self, parent, width=5, height=4, dpi=100): | ||
super().__init__(parent, width, height, dpi) | ||
self._supplementary: Optional[SupplementaryParameters] = None | ||
|
||
@property | ||
def supplementary(self): | ||
return self._supplementary | ||
|
||
@supplementary.setter | ||
def supplementary(self, supplementary_data: SupplementaryParameters): | ||
self._supplementary = supplementary_data | ||
|
||
self.draw_data() # Is this needed? | ||
|
||
def draw_data(self): | ||
""" | ||
This function draws the real space data onto the plot | ||
|
||
The 1d correlation function in self.data, the 3d correlation function | ||
in self.data3, and the interface distribution function in self.data_idf | ||
are all draw in on the plot in linear cooredinates.""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but not mine |
||
|
||
self.fig.clf() | ||
|
||
self.axes = self.fig.add_subplot(111) | ||
self.axes.set_xscale("linear") | ||
self.axes.set_yscale("linear") | ||
self.axes.set_xlabel("Z [$\AA$]") | ||
self.axes.set_ylabel("Correlation") | ||
self.axes.set_title("Real Space Correlations") | ||
self.fig.tight_layout() | ||
|
||
if self.data is not None: | ||
data = self.data[0] | ||
self.axes.plot(data.x, data.y) | ||
|
||
if self.supplementary is not None: | ||
self.axes.axline( | ||
(self.supplementary.tangent_point_z, | ||
self.supplementary.tangent_point_gamma), | ||
slope=self.supplementary.tangent_gradient, | ||
color='k', | ||
linestyle='--', | ||
# transform=self.axes.transAxes, | ||
) | ||
|
||
# Interface properties | ||
self.axes.axvline(x=self.supplementary.interface_z, color='k', linestyle=':') | ||
self.axes.axvline(x=self.supplementary.core_z, color='k', linestyle=':') | ||
|
||
# Hard block estimation line | ||
self.axes.axhline(y=self.supplementary.hard_block_gamma, color='k', linestyle='--') | ||
|
||
x_points = [ | ||
self.supplementary.tangent_point_z, | ||
self.supplementary.first_minimum_z, | ||
self.supplementary.first_maximum_z, | ||
self.supplementary.hard_block_z] | ||
|
||
y_points = [ | ||
self.supplementary.tangent_point_gamma, | ||
self.supplementary.first_minimum_gamma, | ||
self.supplementary.first_maximum_gamma, | ||
self.supplementary.hard_block_gamma] | ||
|
||
self.axes.scatter( | ||
x_points, | ||
y_points, | ||
color='k') | ||
|
||
y_size = max(data.y) - min(data.y) | ||
|
||
self.axes.set_xlim(0, 1.1*max(x_points)) | ||
self.axes.set_ylim(min(y_points) - 0.1*y_size, max(data.y) + 0.1*y_size) | ||
|
||
else: | ||
self.axes.set_xlim(0, max(data.x) / 4) | ||
|
||
|
||
self.draw() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed? I only ask because you are asking yourself here.