Skip to content

Automatic directional offsets for NIRISS SOSS#826

Open
jbrande wants to merge 4 commits intomainfrom
niriss_xshift
Open

Automatic directional offsets for NIRISS SOSS#826
jbrande wants to merge 4 commits intomainfrom
niriss_xshift

Conversation

@jbrande
Copy link
Collaborator

@jbrande jbrande commented Feb 3, 2026

Sometimes, given challenging position angle requirements for targets in multiple systems, observers might apply extra offsets to their NIRISS pointings. This PR includes code to grab the relevant offset information from the FITS headers and applies those to the PASTASOSS modeled traces to ensure correct straightening of the observed spectral trace and correct spectral extraction. This PR also includes code to extrapolate the trace position and wavelength solution out to longer (or shorter, I guess) wavelengths depending on the direction of the offset, so that observers don't lose any flux.

Currently, this works for X-offsets, but Y-offsets are also potentially allowed and we may want to add code to handle these as well. As these are observatory-level operations, I've currently chosen to make this an automatic, header-driven step in S3, but we might want to also allow for passing in custom offset values in the S3 ECFs.

@jbrande
Copy link
Collaborator Author

jbrande commented Feb 3, 2026

While messing around with this, it also occurred to me that it might be useful to plot the nominal spectral trace over the median flux in Fig. 3308. Colors and styles naturally preliminary.
fig3308_file0_order1_MedianFrame
Thoughts?

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 42.10526% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.82%. Comparing base (fd9d4ff) to head (6b50a72).

Files with missing lines Patch % Lines
src/eureka/S3_data_reduction/niriss.py 33.33% 18 Missing ⚠️
src/eureka/S3_data_reduction/plots_s3.py 63.63% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #826      +/-   ##
==========================================
- Coverage   59.88%   59.82%   -0.06%     
==========================================
  Files         107      107              
  Lines       14029    14064      +35     
==========================================
+ Hits         8401     8414      +13     
- Misses       5628     5650      +22     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevin218
Copy link
Owner

kevin218 commented Feb 3, 2026

Yes, I support adding a trace to the plot!

@jbrande
Copy link
Collaborator Author

jbrande commented Feb 6, 2026

That last commit fixes a minor oversight, where the default pastasoss trace retrieval assumes the trace is at the nominal position first, and then rotates it based on the pupil wheel position. Since rotations and translations don't commute, it's not proper to then shift that pre-rotated trace by the planned X-offset. This caused a difference of a few pixels out at the long wavelength end compared to the observed spectral trace, so I've edited my initial code to translate first, then rotate. I'm not convinced this makes a major difference in the final lightcurve stability, but we'll see.

Otherwise, unless anyone has any other suggestions for trace positioning or plotting edits (or whether we should support manual X-direction offsets in the ECFs), I don't think I've got anything else to change here.

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