Skip to content

Polynomial pointing model#28

Merged
JBorrow merged 22 commits intomainfrom
poly_model
May 1, 2026
Merged

Polynomial pointing model#28
JBorrow merged 22 commits intomainfrom
poly_model

Conversation

@axf295
Copy link
Copy Markdown
Contributor

@axf295 axf295 commented Apr 29, 2026

add the polynomial pointing model to mapcat

Copy link
Copy Markdown

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

Adds a new polynomial-based pointing residual model to Mapcat and updates persistence/tests to support storing/retrieving this new model type alongside the existing constant model.

Changes:

  • Introduces PolynomialPointingModel with coefficient fitting, prediction, and basic statistics helpers.
  • Updates PointingResidualTable.residual_model to store either a constant or polynomial model via JSON (TypeAdapter-backed deserialization).
  • Expands pointing tests to cover constant-model behavior and basic polynomial fitting/prediction.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/test_pointing.py Updates unit imports and adds tests for constant and polynomial pointing models.
mapcat/pointing/poly.py New polynomial pointing model implementation (fit + predict + stats).
mapcat/pointing/const.py Adjusts ConstantPointingModel.predict to subtract offsets.
mapcat/database/pointing_residual.py Allows storing either constant or polynomial pointing model in residual_model.
mapcat/database/json.py Switches JSON deserialization to Pydantic TypeAdapter (enables unions).

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

Comment thread mapcat/database/pointing_residual.py Outdated
Comment thread mapcat/pointing/poly.py Outdated
Comment thread mapcat/pointing/poly.py Outdated
Comment thread mapcat/pointing/poly.py
Comment thread mapcat/pointing/poly.py Outdated
Comment thread mapcat/pointing/poly.py Outdated
Comment thread mapcat/pointing/poly.py
Copy link
Copy Markdown
Member

@JBorrow JBorrow left a comment

Choose a reason for hiding this comment

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

Some minor comments. It seems kinda overcomplicated for a polynomial model but that's ok. Is there a reason we can't just use https://numpy.org/doc/stable/reference/generated/numpy.polyfit.html

Comment thread mapcat/database/pointing_residual.py
Comment thread mapcat/database/pointing_residual.py Outdated
Comment thread mapcat/pointing/poly.py Outdated
Comment thread mapcat/pointing/poly.py
Comment thread mapcat/pointing/poly.py Outdated
@axf295
Copy link
Copy Markdown
Contributor Author

axf295 commented Apr 30, 2026

@JBorrow
re: numpy poly fit, I think that is only 1D?

other changes have been included; removed separate ra,dec uncertianty + weights; just use a weights input since they're degenerate and the user can decide what weights to use.

@JBorrow JBorrow merged commit 9282598 into main May 1, 2026
6 checks passed
@JBorrow JBorrow deleted the poly_model branch May 1, 2026 18:12
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