PhangsTeam / pjpipe

Pipeline for processing JWST imaging data, tailored for nearby galaxies. Built for PHANGS
https://pjpipe.readthedocs.io/en/latest/
GNU General Public License v3.0
14 stars 1 forks source link

Add plane fitting to level_match_step.py #67

Closed thomaswilliamsastro closed 3 months ago

thomaswilliamsastro commented 5 months ago

This PR hugely extends the level_match capabilities to also allow for simple 2D planes as well as just a constant offset. This seems to be necessary in some cases, for reasons currently unclear.

The type of fitting can be specified at each stage via the new parameters:

When matching mosaic tiles, we need to define a reference image which we assume to be completely flat and edit other corrections relative to that. We either use the tile taken closest in time to the backgrounds (if they exist), or the one with maximal overlap between the tileset. As such, the lv2 step has been expanded slightly to include information on when the nearest background to the science observation was taken to make that easier

For now, this is a draft while we run through testing. Obvious test cases are NGC1792 and NGC253 where the level matching currently isn't great, but there may be others lurking

thomaswilliamsastro commented 5 months ago

Noticing some issues with NIRCam shorts. I'll poke into it

thomaswilliamsastro commented 3 months ago

@rchwn @low-sky Ready for testing and review! There's some changes in the level_match config for inspiration if you want to play around. I ran through the full NGC2566 stack which was catastrophically crashing last time and now works fine