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

DM-36231: Factor out duplicate code between stellar locus plots and metrics. #40

Merged
merged 4 commits into from Nov 16, 2022

Conversation

sr525
Copy link
Collaborator

@sr525 sr525 commented Oct 27, 2022

No description provided.

@sr525 sr525 force-pushed the tickets/DM-36231 branch 3 times, most recently from 7e37084 to abddc9d Compare October 28, 2022 00:28
Copy link
Collaborator

@jeffcarlin jeffcarlin left a comment

Choose a reason for hiding this comment

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

I confirmed that it runs and produces plots/metrics, but only on rc2_subset, so the outputs aren't that meaningful.

Since the output of all the stellar locus metrics (and summary values on plots) should be in mmag, it would be good to implement that conversion on this branch before pushing. Otherwise, this refactor has made things much more readable and useable.

Good to go once you've addressed the few comments I added!

}

# self.process.calculateActions.xPerp = StellarLocusFitAction()
# self.process.calculateActions.xPerp.stellarLocusFitDict = {}

self.produce.units = { # type: ignore
"wPerp_psfFlux_sigmaMAD": "mag", # TODO need to return mmag from wPerp
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we want this to be mmag, is there a reason why we're not doing that by default? (Same question applies for all other stellar locus classes.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No idea, that wasn't my comment, I can look into changing it if we want to?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should change it. In both the plots and the metric, we want stellar locus widths in mmag.

def setDefaults(self):
super().setDefaults()
self.prep.selectors.flagSelector.bands = ["g", "r", "i"]
self.prep.selectors.snSelector.bands = ["r"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Two questions:

  1. In the analysis_drp version, I think the default S/N band was "i" -- do we want to retain that?
  2. Wouldn't it make sense to apply a S/N cut in all three bands that go into this plot/metric?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I like the choice of r-band here, since it is part of the colors on both axes, but it's worth making sure that's what we want.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is probably another ticket to discuss/check/change these things.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, we can save it for another ticket. But we should probably settle on a "standard" for DM before thousands of metrics start appearing in analysis_tools.

self.prep.selectors.snSelector.bands = ["r"]
self.prep.selectors.snSelector.fluxType = "{band}_psfFlux"

self.prep.selectors.starSelector.vectorKey = "r_extendedness"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to above comment -- do we want r-band as the default for extendedness? The seeing will typically be better in i-band...

Maybe this is a larger conversation that should be had regarding "defaults" in QA work.

@jeffcarlin
Copy link
Collaborator

Another thing that occurred to me after reviewing: we should persist more than just the sigmaMAD of each stellar locus metric. Might be good to keep some other stats, and probably most importantly to keep the fit parameters so plots/metrics can be recreated.

@yalsayyad yalsayyad changed the title Tickets/DM-36231: Factor out duplicate code between stellar locus plots and metrics. DM-36231: Factor out duplicate code between stellar locus plots and metrics. Nov 14, 2022
@sr525
Copy link
Collaborator Author

sr525 commented Nov 14, 2022

I changed the units to mmags and added returning the median as well. How do we want to propagate the fit parameters?

@sr525 sr525 force-pushed the tickets/DM-36231 branch 5 times, most recently from 342d9ae to 4d9ad93 Compare November 15, 2022 04:06
@sr525 sr525 merged commit 7e2cd3a into main Nov 16, 2022
@sr525 sr525 deleted the tickets/DM-36231 branch November 16, 2022 04:23
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.

None yet

2 participants