-
Notifications
You must be signed in to change notification settings - Fork 2
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-42043: add deltaSkyCorr plot to analysis_tools #174
Conversation
173da7a
to
01d37db
Compare
|
||
def __call__(self, data: KeyedData, **kwargs) -> Scalar: | ||
if len(data[self.histKey.format(**kwargs)]) != 0: | ||
hist = cast(Vector, data[self.histKey.format(**kwargs)]) |
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.
You don't really need any casts here, unless you are thinking histMedian
should be typed with Vector
Scalar
etc.
c6cb005
to
9be3759
Compare
@@ -246,3 +246,90 @@ def __call__(self, data: KeyedData, **kwargs) -> Scalar: | |||
mask = self.getMask(**kwargs) | |||
arr = cast(Vector, data[self.vectorKey.format(**kwargs)])[mask] | |||
return cast(Scalar, np.nansum(arr)) | |||
|
|||
|
|||
class MedianHistAction(ScalarAction): |
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.
I think you also need to add MedianHistAction
and IqrHistAction
to the __all__
.
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.
Done by @aemerywatkins.
return med | ||
|
||
|
||
class IqrHistAction(ScalarAction): |
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.
My preference is for IQRHistAction
, but I admit that this style is more in keeping with other aspects of the code base in this file (e.g., sigmaMad
). I will leave it up to you as to your preference (also a question for @sr525).
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.
Also elsewhere where we use PsfFlux (for example) rather than PSFFlux. So my vote is for IqrHistAction.
histKey = Field[str]("Key of frequency Vector to median") | ||
midKey = Field[str]("Key of bin midpoints Vector to median") |
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.
I would remove the to median
parts of the sentences here (and in the other class as well) - I think it reads better that way.
9be3759
to
ad7d1bf
Compare
------- | ||
delta_skyCorr_hist : `dict`[`str`, `~numpy.ndarray`] | ||
A dictionary containing the histogram values and bin lower/upper | ||
edges for the skyCorr difference dataset. |
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.
Also mids
defaultTemplates={"outputName": "deltaSkyCorr"}, | ||
): | ||
data = ct.Input( | ||
doc="tmp", |
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.
Doc needs fixing
|
||
|
||
class DeltaSkyCorrXYPlot(AnalysisTool): | ||
parametrizeBands = False |
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.
Do we really not want this to not be done in every band?
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.
These are visit-level plot/metrics, so 1 visit = 1 band (i.e., there aren't multiple bands available).
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.
Discussed in an in-person chat, and agreed out of scope for this ticket.
64fb114
to
8143616
Compare
Switch to ArrowNumpyDict storage class (LSK edits) Add bin_mid to output Add MedianHistAction; calc for deltaSkyCorr Add IqrHistAction; change to line plot Edits following review
8143616
to
a353091
Compare
No description provided.