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

feat: add inpaint-mode for lst binner #907

Merged
merged 19 commits into from
Sep 5, 2023
Merged

feat: add inpaint-mode for lst binner #907

merged 19 commits into from
Sep 5, 2023

Conversation

steven-murray
Copy link
Contributor

This adds an "inpaint" mode for the LST-binner. In this mode, flagged data is assumed to have been in-painted to preserve spectral smoothness.

Copy link
Member

@jsdillon jsdillon left a comment

Choose a reason for hiding this comment

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

Looking pretty good. Some minor feedback about default modes and assumptions, but I think this is close.

hera_cal/datacontainer.py Show resolved Hide resolved
hera_cal/datacontainer.py Outdated Show resolved Hide resolved
hera_cal/datacontainer.py Outdated Show resolved Hide resolved
hera_cal/lstbin.py Outdated Show resolved Hide resolved
hera_cal/lstbin_simple.py Outdated Show resolved Hide resolved
hera_cal/lstbin_simple.py Outdated Show resolved Hide resolved
hera_cal/lstbin_simple.py Show resolved Hide resolved
hera_cal/lstbin_simple.py Show resolved Hide resolved
Comment on lines 1168 to 1173
mode. In this case, either choice is bad: to include them in the average is bad
because even though they may have been actually in-painted, whatever value they have
is clearly triggering the sigma-clipper and is therefore an outlier. On the other
hand, to ignore them is bad because the point of in-painting mode is to get
smoother spectra, and this negates that. So, it's best just to not do sigma-clipping
in inpainted mode.
Copy link
Member

Choose a reason for hiding this comment

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

Can there be a mode where inpainted data cannot get sigma-clipped but non-inpainted data can?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I'll add that.

@jsdillon
Copy link
Member

Also, what do you want to do about tests failing?

return data, flags


def get_lst_mad(
Copy link
Member

Choose a reason for hiding this comment

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

This does both med and mad, so I feel like both should be in the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Fixed that up.

hera_cal/lstbin_simple.py Outdated Show resolved Hide resolved
Copy link
Member

@jsdillon jsdillon left a comment

Choose a reason for hiding this comment

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

Just a few tiny changes, but otherwise good to go! Thanks for this @steven-murray!

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Patch coverage: 98.69% and project coverage change: +0.01% 🎉

Comparison is base (f5f463c) 97.17% compared to head (89abe8f) 97.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #907      +/-   ##
==========================================
+ Coverage   97.17%   97.19%   +0.01%     
==========================================
  Files          23       23              
  Lines       10282    10429     +147     
==========================================
+ Hits         9992    10136     +144     
- Misses        290      293       +3     
Flag Coverage Δ
unittests 97.19% <98.69%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
hera_cal/utils.py 95.63% <95.23%> (+0.04%) ⬆️
hera_cal/lstbin_simple.py 97.58% <98.75%> (-0.08%) ⬇️
hera_cal/datacontainer.py 98.78% <100.00%> (+0.08%) ⬆️
hera_cal/io.py 98.16% <100.00%> (+<0.01%) ⬆️
hera_cal/lstbin.py 96.92% <100.00%> (+0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jsdillon jsdillon 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 good to me! Nice work @steven-murray

@jsdillon jsdillon self-requested a review August 24, 2023 02:32
Copy link
Member

@jsdillon jsdillon left a comment

Choose a reason for hiding this comment

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

Just saw there's one minor test that's failing. Assuming it's no big deal to fix, I approve.

@steven-murray steven-murray merged commit 5693047 into main Sep 5, 2023
8 checks passed
@steven-murray steven-murray deleted the lst-inpaint-mode branch September 5, 2023 19:39
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.

2 participants