Skip to content

Conversation

@skhrg
Copy link
Member

@skhrg skhrg commented Nov 11, 2025

No description provided.

@skhrg skhrg requested review from elle-shaw and mhasself November 11, 2025 19:48
@mhasself
Copy link
Member

This doesn't need a version bump, since the "v2" parameters are a superset of the v1 parameters.

There will be less code duplication if we extend the existing function rather than add a whole new almost-the-same one.

@amaurea
Copy link
Contributor

amaurea commented Nov 13, 2025

Also, wouldn't it be more natural to apply the el right after the encoder el offset, instead of after it's been through a bunch of quaternion operations?

@skhrg
Copy link
Member Author

skhrg commented Nov 18, 2025

This doesn't need a version bump, since the "v2" parameters are a superset of the v1 parameters.

I think my one issue here is the scenario where someone has the new model but the old code, I don't think that would error out currently without a version bump. I suppose I could instead add a check that there are no unknown pars?

Also, wouldn't it be more natural to apply the el right after the encoder el offset, instead of after it's been through a bunch of quaternion operations?

Right now the sequence of operations go sort of "inside-out", so encoder offsets -> LATR offsets -> bearing offsets -> mirror offsets -> telescope tilt + sag. I can be talked out of this ordering (or convinced that tilt + sag is more "inside" than the LATR perhaps).

@mhasself
Copy link
Member

This doesn't need a version bump, since the "v2" parameters are a superset of the v1 parameters.

I think my one issue here is the scenario where someone has the new model but the old code, I don't think that would error out currently without a version bump. I suppose I could instead add a check that there are no unknown pars?

I believe it would error out; look for

if k not in param_defaults['lat_v1'] and v != 0.:

I had this situation in mind. You can even use new model params with old code, as long as the values are zero.

@skhrg
Copy link
Member Author

skhrg commented Nov 18, 2025

I had this situation in mind. You can even use new model params with old code, as long as the values are zero.

10 steps ahead as usual, I'll refactor things to be all in v1 and just edit the field in the h5 files.

@skhrg
Copy link
Member Author

skhrg commented Nov 25, 2025

Updated, @mhasself one thing you may see and object to is that I calculate a corrected az and el and then apply the base tilt and pointing model on that. You may (reasonably) say that I should do that earlier and only calculate a new az and el once, but this current order of operations is what was used when I fit the model.

If there is an equivalent (ie: no need to refit) method that is cleaner that is ideal and I am happy to switch over, otherwise I would need to refit which may or may not be worth it (or if I can calculate a conversion that is also fine I suppose).

Comment on lines 335 to 344
'lat_v2' : {
'enc_offset_az': 0,
'enc_offset_el': 0,
'enc_offset_cr': 0,
'el_axis_center_xi0': 0,
'el_axis_center_eta0': 0,
'cr_center_xi0': 0,
'cr_center_eta0': 0,
'mir_center_xi0': 0,
'mir_center_eta0': 0,
Copy link
Member

Choose a reason for hiding this comment

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

Delete these -- this is still lat_v1.

As written, I believe the code will error if you pass it an old params dict. Because the updated defaults will not be loaded. A smoke test would be helpful here.

Please add LAT model test to tests/test_pointing_model.py, including backwards compatibility check.

@skhrg
Copy link
Member Author

skhrg commented Dec 1, 2025

@mhasself let me know if these tests are sufficient. I didnt check behavior of all pars, just a basic sanity check that it works in both modes.

I do want to try moving the el sag up (right after the encoder offsets), but I want to see if I can translate the already fit params for that rather than doing another fit.

Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

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

Great!

Squash on merge.

@skhrg skhrg merged commit e2c74a6 into master Dec 2, 2025
5 checks passed
@skhrg skhrg deleted the latpmv2 branch December 2, 2025 15:39
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.

4 participants