Skip to content

FLSHCORR: Scale for linear decrease over time#655

Draft
pllim wants to merge 4 commits into
spacetelescope:mainfrom
pllim:flash-on-low-budget
Draft

FLSHCORR: Scale for linear decrease over time#655
pllim wants to merge 4 commits into
spacetelescope:mainfrom
pllim:flash-on-low-budget

Conversation

@pllim

@pllim pllim commented May 8, 2025

Copy link
Copy Markdown
Contributor

FLSHCORR: Scale for linear decrease over time if the reference image is the last ever to be delivered.

But we do not want to merge this until we know for sure, though I coded it up such that it would still run without the scaling if those new keywords are not found in the reference image primary header.

Fix #627

RT https://github.com/spacetelescope/RegressionTests/actions/runs/14917237097

TODO

  • Run CI and RT, and fix any failures.
  • Wait for ACS Team sign off to merge or not. Rerun CI and RT.
  • Add new test case with prototype reference image to regression test.

@pllim pllim added this to the ACS-Oct-2025 milestone May 8, 2025
@github-actions github-actions Bot added the ACS label May 8, 2025
@pllim pllim requested review from jryon and mdlpstsci May 8, 2025 19:06
@pllim pllim force-pushed the flash-on-low-budget branch from 4329964 to 5d156da Compare May 8, 2025 22:16
@pllim

pllim commented May 8, 2025

Copy link
Copy Markdown
Contributor Author

As of 2025-05-08 implementation, if you give it the existing FLSHFILE from CRDS without these new keywords, it would skip the scaling (the following output is from -v option, so you call calacs.e blah_raw.fits -v). It would report the keyword is missing but then keep going without the scaling. It would also stop checking at the first missing keyword (3 total):

FLSHCORR PERFORM
Trying to open jref$39h2109kj_fls.fits...
Read in Primary header from jref$39h2109kj_fls.fits...
ERROR:    Keyword = `SLOPE'.
Performing post-flash subtraction on chip 1 in imset 2
Linear decrease over time scaling for post-flash: SKIPPED
Image has an offset of 0,0
Mean of post-flash image (MEANFLSH) = 17.0107
FLSHCORR COMPLETE

And if you give it the new FLSHFILE, it would be like this instead:

FLSHCORR PERFORM
Trying to open test_fls.fits...
Read in Primary header from test_fls.fits...
Performing post-flash subtraction on chip 1 in imset 2
Linear decrease over time scaling for post-flash: 1.026984e+00
Image has an offset of 0,0
Mean of post-flash image (MEANFLSH) = 12.2674
FLSHCORR COMPLETE

@pllim

pllim commented May 8, 2025

Copy link
Copy Markdown
Contributor Author

p.s. The scaling factor is greater than 1 probably because I just grabbed a random image from Artifactory to test and it is very old.

mdlpstsci
mdlpstsci previously approved these changes May 9, 2025

@mdlpstsci mdlpstsci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code changes look fine.

@pllim

pllim commented May 21, 2025

Copy link
Copy Markdown
Contributor Author

Update 2025-05-21: Jenna gave me a couple of sample inputs and expected outputs. I ran ACS2D from this branch and compared my outputs to hers. There are differences and I am waiting to hear back if they are expected or not.

@pllim pllim force-pushed the flash-on-low-budget branch from 5d156da to 6058fee Compare June 11, 2025 18:41
@pllim

pllim commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

At ACS Team meeting, we decided that scaling for old data is not pipeline problem because CRDS should not use this last flash file for old data where better match is available. If user purposefully stick this last flash in their old data, they are asking for it.

Local testing of this branch with sample inputs adjusted for years 2025 and 2030, a sample last flash reference file, and expected output values gracefully provided by Jenna Ryon showed that this branch implementation is good.

I will keep this in draft and revisit when we have a "go" from ACS Team.

Comment thread pkg/acs/Dates
@pllim pllim force-pushed the flash-on-low-budget branch from af61c21 to 1010a2f Compare September 22, 2025 19:33
@pllim pllim added on-hold Until INS/DO decision is made and removed Need INS response labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ACS on-hold Until INS/DO decision is made

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scale flash reference file to observation date in CALACS flash correction

2 participants