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

Feature branch that add PSF-related plots. #16

Merged
merged 8 commits into from
Nov 20, 2024
Merged

Conversation

LR-inaf
Copy link
Collaborator

@LR-inaf LR-inaf commented Nov 15, 2024

So far, a new task called PlotPsfZernTask has been implemented in the plot_aos_task.py. This task exploits an external script called psf_from_zern.py that creates the panel and gives it back to the task.

Copy link

@mfisherlevine mfisherlevine left a comment

Choose a reason for hiding this comment

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

This isn't a repo I should be reviewing the code for, so just leaving these as comments - you should get a review from an AOS person:

  • At least in DM, people always merge from a tickets/DM-NNNNN branch which you'll get by filing a Jira ticket. donut_viz may not care though, but just so you know.
  • You're not passing a Figure in to psfPanel even though you can. If you don't change that you will have a memory leak, and you won't be able to run this as part of Rapid Analysis without it crashing all the time. You just need to make a figure, hold it on the class, and reuse that though, and it should all work as long as you clear it properly between uses.
  • Putting all the work in the runQuantum method, rather than having it pass all the needed variables through to a run() method is not the normal pattern, but again, I don't know how much you want to stick to DM standards.

Copy link
Member

@jbkalmbach jbkalmbach left a comment

Choose a reason for hiding this comment

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

Can you add a unit test into tests/test_donut_viz_pipeline_science_sensors.py?

filename=psf_zk_panel,
)

def get_psf_degr(self, zset):
Copy link
Member

Choose a reason for hiding this comment

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

Can you add docstrings for all the functions?

xs = np.array(xs)
ys = np.array(ys)
zs = np.array(zs)
psf = np.array([[self.get_psf_degr(pair) for pair in det] for det in zs])
Copy link
Member

Choose a reason for hiding this comment

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

Will this work if there are not the same number of pairs in every detector? (For instance one detector didn't have enough good sources.) If this doesn't have to be an array maybe it could just be a list and that would prevent issues here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see, you right. I will leave them as lists

@teweitsai teweitsai changed the base branch from main to develop November 19, 2024 16:24
@teweitsai
Copy link

teweitsai commented Nov 19, 2024

Please merge to default develop branch. We have the branch protection rule there. Thanks!

@jbkalmbach
Copy link
Member

Copy link
Member

@jbkalmbach jbkalmbach left a comment

Choose a reason for hiding this comment

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

Looks good. Some little documentation comments. Thanks for creating this!

dettype="LSSTComCam",
fig=None,
figsize=(11, 14),
maxcol=3,
Copy link
Member

Choose a reason for hiding this comment

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

maxcol needs an entry in the docstring

"""Run the PlotPsfZern AOS task.

This task create a 3x3 grid of subplots,
each axe contains the psf value for each pair of
Copy link
Member

Choose a reason for hiding this comment

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

each subplot contains the psf values calculated from Zernike coefficients might make it clearer where these PSF values are coming from.

) -> Figure:
"""Make a per-detector psf scatter plot

Subplots shows for each detector the psf retrieve from the zernike value
Copy link
Member

Choose a reason for hiding this comment

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

retrieved

@LR-inaf LR-inaf merged commit 06b31d4 into develop Nov 20, 2024
3 checks passed
@jbkalmbach jbkalmbach deleted the u/LRosignoli/psf_addon branch November 21, 2024 01:19
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.

4 participants