Skip to content

Refactor astrometric calibration, implement arbitrary binnings, DIPOL photo-polarimetry#183

Merged
juanep97 merged 29 commits intomainfrom
update
Feb 24, 2026
Merged

Refactor astrometric calibration, implement arbitrary binnings, DIPOL photo-polarimetry#183
juanep97 merged 29 commits intomainfrom
update

Conversation

@juanep97
Copy link
Owner

@juanep97 juanep97 commented Feb 23, 2026

This PR:

  • Refactors astrometric calibration, improving the use of signed pair displacement hints.
  • Implements handling of arbitrary binnings.
  • Improves centroid finding during aperture selection and photometry.
  • Implements relative photometry extraction during DIPOL polarimetry.
  • Includes many other small fixes and improvements.
Details Per-file overview (adapted from copiot review):
File Description
iop4lib/utils/sourcepairing.py Added get_pairs_dxy_sign function for signed displacement pair finding; updated docstrings
iop4lib/utils/astrometry.py Refactored to split parameter generation from WCS building; removed allsky parameter; added automatic position hint adjustment for pointing mismatches
iop4lib/iop4.py Added filtering of .bak files in file listing functions
iop4lib/instruments/instrument.py Added binning support methods; new abstract classify_juliandate_rawfit method; improved centroid finding; added exception handling for aperture photometry
iop4lib/instruments/osn_cameras.py Removed allsky parameter from get_astrometry_position_hint; improved warning messages for source mismatches
iop4lib/instruments/dipol.py Implemented binning-independent calculations; added magnitude computation to polarimetry; refactored build_shotgun_params; improved photometry field selection logic
iop4lib/instruments/dipol_astrometry.yaml Added TDE source type rules; added condition to check for non-null photometry reference
iop4lib/instruments/cafos.py Refactored build_shotgun_params; removed allsky parameter
iop4lib/db/reducedfit.py Added hint_disp_sign_mean property; removed allsky parameter from get_astrometry_position_hint
iop4lib/db/rawfit.py Added instrument_cls and hint_disp_sign_mean properties; formatting fixes
iop4lib/db/photopolresult.py Added datetime property; removed unused variable
iop4lib/db/epoch.py Added filtering of .bak files when listing local files
iop4lib/db/astrosource.py Added is_calibrator as an object property, with caching mechanism
iop4lib/db/aperphotresult.py Updated to use hint_disp_sign_mean property; reordered plot elements
iop4lib/config.example.yaml Removed deprecated astrometry_allsky_allow and astrometry_allsky_septhreshold configuration options
iop4api/views/plot.py Moved df_crosscheck initialization inside conditional block to avoid unnecessary DataFrame creation
iop4lib/utils/__init__.py fix/improve Simbad queries; improved build_wcs_centered_on error handling; added debug logging for magnitude calibration

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the astrometric calibration system to support arbitrary binnings and implements photo-polarimetry support for DIPOL instrument. The changes enable binning-independent pixel calculations and add magnitude computation capabilities to DIPOL polarimetry observations.

Changes:

  • Refactored astrometry calibration to remove allsky parameter and improve position hint handling with automatic detection of pointing mismatches
  • Implemented support for arbitrary binnings through reference_binning class attribute and binning-independent pixel calculation methods
  • Added DIPOL photo-polarimetry support with magnitude computation and calibration for polarimetry observations

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/test_generic.py Formatting fix (trailing whitespace)
iop4lib/utils/sourcepairing.py Added get_pairs_dxy_sign function for signed displacement pair finding; updated docstrings
iop4lib/utils/sourcedetection.py Formatting fix (trailing whitespace)
iop4lib/utils/astrometry.py Refactored to split parameter generation from WCS building; removed allsky parameter; added automatic position hint adjustment for pointing mismatches
iop4lib/utils/init.py Updated Simbad API calls to use lowercase column names; improved build_wcs_centered_on error handling; added debug logging for magnitude calibration
iop4lib/iop4.py Added filtering of .bak files in file listing functions
iop4lib/instruments/instrument.py Added binning support methods; new abstract classify_juliandate_rawfit method; improved centroiding with Gaussian smoothing; added exception handling for aperture photometry
iop4lib/instruments/osn_cameras.py Removed allsky parameter from get_astrometry_position_hint; improved warning messages for source mismatches
iop4lib/instruments/dipol.py Implemented binning-independent calculations; added magnitude computation to polarimetry; refactored build_shotgun_params; improved photometry field selection logic
iop4lib/instruments/dipol_astrometry.yaml Added TDE source type rules; added condition to check for non-null photometry reference
iop4lib/instruments/cafos.py Refactored build_shotgun_params to return param dictionaries directly; removed allsky parameter
iop4lib/db/reducedfit.py Added hint_disp_sign_mean property; removed allsky parameter from get_astrometry_position_hint
iop4lib/db/rawfit.py Added instrument_cls and hint_disp_sign_mean properties; formatting fixes
iop4lib/db/photopolresult.py Added datetime property; removed unused variable
iop4lib/db/fitfilemodel.py Removed trailing whitespace
iop4lib/db/epoch.py Added filtering of .bak files when listing local files
iop4lib/db/astrosource.py Added is_calibrator property with caching mechanism
iop4lib/db/aperphotresult.py Updated to use hint_disp_sign_mean property; reordered plot elements
iop4lib/config.example.yaml Removed deprecated astrometry_allsky_allow and astrometry_allsky_septhreshold configuration options
iop4api/views/plot.py Moved df_crosscheck initialization inside conditional block to avoid unnecessary DataFrame creation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

juanep97 and others added 6 commits February 23, 2026 18:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Feb 23, 2026

@juanep97 I've opened a new pull request, #184, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as off-topic.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@juanep97

This comment was marked as off-topic.

Copy link

Copilot AI commented Feb 23, 2026

@juanep97 I've opened a new pull request, #186, to work on those changes. Once the pull request is ready, I'll request review from you.

@juanep97 juanep97 merged commit dd245c5 into main Feb 24, 2026
5 of 7 checks passed
@juanep97 juanep97 changed the title Refactor astrometric calibration, implement aribitrary binnings, DIPOL photo-polarimetry Refactor astrometric calibration, implement arbitrary binnings, DIPOL photo-polarimetry Feb 24, 2026
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.

3 participants