Skip to content

Clusters plots with the residuals #456

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

Merged
merged 4 commits into from
Dec 6, 2024
Merged

Conversation

pstammler
Copy link
Collaborator

I extended the residual Python code, so we can study the clustering effects from the residuals. The GridSpec has been changed, so you have to be cautious about how you want to display some coordinates in both axis. I also implement new parameters, like the threshold for the residuals, set by default to 2. Here is an example of the structure you may have to try in the Post-Processing tutorial notebook: """
pp = xpsi.SignalPlotter([ST.runs])

Setting next the yticks for the 5 plots, alternating the main plot and the color bar y-ticks. # (None if using automatic tikcs)

xpsi.ResidualPlot.declare_settings(yticks=[[10,30,100],None, [10,30,100],None, [10,30,100],None, [10,30,100], [10,30,100], None, None, None]) pp.plot(IDs=OrderedDict([('ST', ['run']),
]),
combine=False, # use these controls if more than one run for a posterior
combine_all=False,
force_combine=False,
only_combined=False,
force_cache=True,
nsamples=100,
plots = {'ST': xpsi.ResidualPlot(threshlim=1.0)})

pp.plots["ST"].fig
"""

I extended the residual Python code, so we can study the clustering effects from the residuals. The GridSpec has been changed, so you have to be cautious about how you want to display some coordinates in both axis. I also implement new parameters, like the threshold for the residuals, set by default to 2. Here is an example of the structure you may have to try in the Post-Processing tutorial notebook:
"""
pp = xpsi.SignalPlotter([ST.runs])
# Setting next the yticks for the 5 plots, alternating the main plot and the color bar y-ticks.
# (None if using automatic tikcs)
xpsi.ResidualPlot.declare_settings(yticks=[[10,30,100],None, [10,30,100],None, [10,30,100],None, [10,30,100], [10,30,100], None, None, None])
pp.plot(IDs=OrderedDict([('ST', ['run']),
                        ]),
        combine=False, # use these controls if more than one run for a posterior
        combine_all=False,
        force_combine=False,
        only_combined=False,
        force_cache=True,
        nsamples=100,
        plots = {'ST': xpsi.ResidualPlot(threshlim=1.0)})

pp.plots["ST"].fig
"""
@pstammler pstammler self-assigned this Dec 4, 2024
@MHoogkamer MHoogkamer removed their request for review December 5, 2024 09:33
@lmauviard
Copy link
Collaborator

I'll look into it, since I also want to add code to this file

@lmauviard
Copy link
Collaborator

I move the clustering to an optional argument to be able to still make the old residual plot. Can someone test this ? It does work on my laptop when I remove the expected counts from __caching_targets__. Otherwise it does not work on my laptop, I get Invalid cache target. Can someone else check ?

@sguillot
Copy link
Contributor

sguillot commented Dec 5, 2024

Fix the residual distribution (bottom left plot)
Try to get the x-axis limit from the color bar limit if possible

@sguillot sguillot merged commit fac5459 into main Dec 6, 2024
4 checks passed
@sguillot sguillot deleted the 425-residual-cluster-plots branch December 6, 2024 08:48
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.

3 participants