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

459 residuals plotting options #483

Merged
merged 17 commits into from
Dec 16, 2024

Conversation

lmauviard
Copy link
Collaborator

More plotting options including :

Choice of a parameter for the plots using postprocessor (instead of random samples)
Bolometric pulse : data and model along with chi square
Blurring the residuals for better visualisation
Add sin_inclination to be used in ProjectionTool of required

PostProcessing notebook modified too

May close #90
Closes #459

@lmauviard lmauviard requested a review from thjsal December 6, 2024 13:56
@lmauviard
Copy link
Collaborator Author

I will make an independent chi square calculator in Signal ! Wait until merging

@lmauviard lmauviard changed the title 459 residuals plotting options [WIP] 459 residuals plotting options Dec 6, 2024
@lmauviard lmauviard changed the title [WIP] 459 residuals plotting options 459 residuals plotting options Dec 6, 2024
@lmauviard
Copy link
Collaborator Author

Now closes #90

@lmauviard
Copy link
Collaborator Author

It is good to go now, can someone review this ?

@lmauviard lmauviard requested a review from sguillot December 6, 2024 16:43
@lmauviard lmauviard requested review from thjsal and sguillot and removed request for thjsal and sguillot December 12, 2024 13:56
Copy link
Contributor

@sguillot sguillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks all good, but one of the spectrum figures has a weird yrange:
Screenshot 2024-12-12 at 16 29 58
Is the yrange hard-coded somewhere ?

@lmauviard
Copy link
Collaborator Author

I will have a look at it, this is a bit weird indeed

@thjsal
Copy link
Contributor

thjsal commented Dec 12, 2024

Seems like something that changed this yrange has occured already outside of this branch. In the online pages (https://xpsi-group.github.io/xpsi/Post-processing.html) the figure looks still normal, but when I ran the PostProcessing notebook in another branch that is up-to-date with the main, I get this same weird yrange.

@sguillot
Copy link
Contributor

Then perhaps we can ignore this very minor issue and close this PR.
The y-range for this plot can be fixed later no?

@drannawatts
Copy link
Member

So before merging make a non-urgent issue to address the weird y-range at some point?

@sguillot
Copy link
Contributor

sguillot commented Dec 13, 2024

I created #495 to remember to make the fix later.
The branch can be merged I think

@sguillot sguillot self-requested a review December 13, 2024 11:39
@sguillot
Copy link
Contributor

Sorry, I cancelled the review because the two residual plots show best-fit gaussians that are different. Even the distributions are different. Different binning? Not sure why. See figures:
Screenshot 2024-12-13 at 12 39 37
Screenshot 2024-12-13 at 12 39 27

@lmauviard
Copy link
Collaborator Author

This is because the samples used for residuals are not the same. Basically you draw 100 different samples for each, which are different for each. If you use same parameters_vector you should get the same residuals

@DevarshiChoudhury
Copy link
Member

Closes #496

if ('-' in model) and (not('-S' in model) and not('-U' in model) and not('-Ua' in model)):
print (r"ERROR: model not recognised. If model has derived quantities and does not fall into the categories mentioned below: transform your dictionary to match \"-U\" requirements. Recognised hot spot names are \"ST\", \"\PST\", \"\CST\", \"EST\", \"PDT\", \"CDT\", \"EDT\"; for two hot spot model connect each hot spot model with \" \" (first for primary; second for secondary). If the two hot spots have the same name, add \"-S\" (if all the secondary hot spot is antipodal and its temperature and radius is the same of the primary); \"-U\" if the properties of the secondary spot is completely unrelated to the primary ones; \"-Ua\" if the secondary hot spot is antipodal to the primary but has independent radius and temperature.")
print ("ERROR: model not recognised. If model has derived quantities and does not fall into the categories mentioned below: transform your dictionary to match \"-U\" requirements. Recognised hot spot names are \"ST\", \"\PST\", \"\CST\", \"EST\", \"PDT\", \"CDT\", \"EDT\"; for two hot spot model connect each hot spot model with \" \" (first for primary; second for secondary). If the two hot spots have the same name, add \"-S\" (if all the secondary hot spot is antipodal and its temperature and radius is the same of the primary); \"-U\" if the properties of the secondary spot is completely unrelated to the primary ones; \"-Ua\" if the secondary hot spot is antipodal to the primary but has independent radius and temperature.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the letter "r" from here? There should be "r" so that it won't give a SyntaxWarning, since having a string that has backslashes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the "r" now back.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I did not remove it, I guess it was already not in the original branch when I pulled to create this one

@@ -293,7 372,7 @@ def _add_data(self):

data = self._ax_data.pcolormesh(self._signal.data.phases,
channel_edges,
self._signal.data.counts/2.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since not dividing with 2 anymore, should the title in the plots change from counts to counts/cycles? This change means also that the old X-PSI signal plots will not look the same anymore if produced using the same script. Maybe that is at least worth to mention in the tutorial or in the Changelog?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, 'counts/cycle' (well actually it's counts per bin per cycle I guess)? and agreed we should mention this explicitly in the Changelog

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess it is maybe counts / (bin / cycles)... if you count all the bins within all the shown cycles. But I am not sure what is best/correct. Would be just good to be clear that this has changed.

@lmauviard lmauviard merged commit f3a7e81 into xpsi-group:main Dec 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more plotting to residuals Chi-squared calculator
5 participants