Skip to content

Added script that solves satv1 pointing model parameters. - #999

Open
elle-shaw wants to merge 78 commits into
masterfrom
solve_pointing
Open

elle-shaw wants to merge 78 commits into
masterfrom
solve_pointing

Conversation

@elle-shaw

Copy link
Copy Markdown
Contributor

Script that solves for pointing model parameters given an input config and saves manifest/metadata.

@elle-shaw
elle-shaw requested a review from mhasself October 11, 2024 18:19

@mhasself mhasself left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Here's the round 1 review (there will be more rounds).

As a site_pipeline script, this should conform to site_pipeline standards (which I admit are not evenly enforced):

  • Reformulate main(...), add a get_parser() function, and use util.main_launcher. See site_pipeline/preprocess_tod.py for a correct example.
  • Register the function in site_pipeline/cli.py so it can be run from the command line using so-site-pipeline entry point.
  • Add an entry in docs/site_pipeline.rst. Make sure the text includes an example config file. If command line args are non-trivial, it should include those two. Both of those things can be "automagically" dropped in by sphinx, from the module code / docstrings, with the right constructions. (See other examples in site_pipeline.rst)

One more big request for overall scope: I know this fitter has been validated on this dataset, elsewhere. But when it is used on future data sets it will be essential to visualize the results, to see the residuals, and explore param combos. So... please include plotting functionality in here.

(Also a few minor comments inline.)

Added plotting functionality, added fit iteration, added documentation.
@elle-shaw

Copy link
Copy Markdown
Contributor Author

I had to do lots of the code editing on site computing while NERSC was down, so when I copied it back to NERSC to do the git push-ing, it makes it look like every line of code is new! Sorry

elle-shaw and others added 3 commits November 21, 2025 13:22
Merging master with this branch so latest pointing model version is
usable.
…olve_pointing

I forgot to push a rebase, then Saianeesh made a commit.
@tskisner

Copy link
Copy Markdown
Member

Just a heads up that the tests on the most recent push will fail. so3g and toast both had releases in the last couple hours and I'm about to merge a PR that updates the sotodlib interfaces in a couple places. I'll post more info on dm-support shortly.

elle-shaw and others added 17 commits January 20, 2026 12:32
…ombineFlags, implemented MPI parallel processing, and other syntax updates.
…ts through to the outputs of finalize focal plane. Useful for per-obs usecase, and when loaded with Receiver.load the values will be under det_boresight
* feat: lat v2 pointing model

* Update sotodlib/coords/pointing_model.py

Co-authored-by: Matthew Hasselfield <mhasself@users.noreply.github.com>

* Update sotodlib/coords/pointing_model.py

Co-authored-by: Matthew Hasselfield <mhasself@users.noreply.github.com>

* feat: quiver plot

* fix: use correct roll

* fix: remove unused lines

* feat: add option for optics tubes to float and moved some fitter options to config file

* fix: dont run second iteration if there are no cut points and fix missing comma

* fix: apply ot offsets when plotting

* fix: use same xieta_mode when making final plots and save ot offsets seperately

---------

Co-authored-by: Matthew Hasselfield <mhasself@users.noreply.github.com>
perdetector azimuth changes to finalize_focal_plane and fp_coords will
function.
…aving of lmfit parameter errors and correlations matrix. Simplifies loading of data into axis managers.
…n of differential xi and eta in analyze_PM_with_all_dets function. Feature plot of correlation matrix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Had a question about why the if "ot_float_aman" statement is only on this second statement. We could have it make the fancy plots for both first and second fits. If that was the case, should the ot_float statement also apply to both minimizations?

@elle-shaw elle-shaw left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Quick changes look good to me, I just have the one question on the ot_float option handling on the analyze_PM_with_all_dets plotting section.

elle-shaw and others added 7 commits April 24, 2026 22:10
* Allow different fit types for first and second minimizations. Bug fix in plotting full data set plots to handle template or measured modeling type. Include residual mean and median log messages. Add median residual line to histograms.

* Feature SAT version 2 pointing model. Include elevation sag, non perpindicularity, and restructure handling of azimuth and elevation wobble.

* Bring xi and eta error data through finalize_focal_plane scripts so it can be used in pointing model solving. Add signal vs azimuth plot in get_brighsrc_pointing_step2. Fix errors in solve_pointing_model which prented proper culling of data. Add parameter choosing the nominal focal plane template epoch timestamp to be used for each epoch.

* Updated documentation for config files used with solve_pointing_model. Small bug fix on debug plotting in get_brightsrc_pointing_step2

* Fix typo in call for focal plane timestamp for Plotter in just_test_params

* updated sign conventions of harmonic parameters in sat_v2 pointing model to match TPoint definitions. Better assists with comparison of star camera data.

* fix white spaces

* Added option in config file to define free parameters instead of fixed parameters. Fixed bug where second fit method did not actually update in minimizer

* Save pointing model fit data stats to h5 file even if just testing a set of parameters

* Combined pointing_model script with latest from master and current LAT updates. Fixed integration errors on solve_pointing_model. Added in-prep option to limit number of data points across az,el,roll bins

* Paste latest changes from satPMv2_justmodel and put here. Include way to completely throw out extremely large outlier fits.

* remove commented out code and clean up unused plot function

Enhance pointing model pipeline and align with recent changes to LAT pointing.

Applies same changes to pointing_model.py as PR 1777 satPMv2_justmodel, which includes the LAT non-linear focal plane distortion support from master already.
… in fp_containers for loading data without xi_err or eta_err
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.

5 participants