Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
6a10d5b
initial commit
Mar 19, 2024
0af181a
add combine_focal_planes.py
Mar 19, 2024
32e24af
resolve wrong git operations
Mar 19, 2024
7cb9ac2
Merge branch 'master' into pointing_workflow
Apr 29, 2024
18dfb22
Merge branch 'mat_polfilt' into pointing_workflow
Apr 29, 2024
1689165
Merge remote-tracking branch 'origin/new_preprocess_methods' into poi…
Apr 29, 2024
76db4c5
using a new preprocess style in map_based pointing reconstruction
Apr 30, 2024
dba66bf
Merge remote-tracking branch 'origin' into pointing_workflow
Apr 30, 2024
20b522c
added except method in flags.reduce
Apr 30, 2024
2063544
Merge branch 'mat_polfilt' into pointing_workflow
Apr 30, 2024
4ca1ef9
Merge branch 'mat_polfilt' into pointing_workflow
Apr 30, 2024
740f1e3
added ReduceFlags function in preprocessing
Apr 30, 2024
2a9dcdb
Merge branch 'mat_polfilt' into pointing_workflow
Apr 30, 2024
7b403a7
new fitting code
May 2, 2024
4525865
Merge branch 'mat_polfilt', remote-tracking branch 'origin' into poin…
May 2, 2024
5101736
added argument save_normal_roll
May 7, 2024
d708edb
tod based fitting is automated
May 7, 2024
3d03e68
Merge branch 'iir_default' into pointing_workflow
tterasaki May 7, 2024
34481e7
main function is done
tterasaki May 9, 2024
2da7965
removed combine_focal_plane.py which is no longer used
tterasaki May 10, 2024
a26283a
Merge branch 'master' into pointing_workflow
tterasaki May 30, 2024
8d8fae4
removed planets.close()
tterasaki May 30, 2024
59f55ce
tuning for master branch
tterasaki May 31, 2024
6b8fce3
Merge branch 'master' into pointing_workflow
tterasaki May 31, 2024
5b80e50
fix preprocessing stuff
tterasaki May 31, 2024
6e91879
Added script that solves satv1 pointing model parameters.
Oct 11, 2024
51093ed
Make solve_pointing_model match site_pipeline standards.
Oct 21, 2024
0e5ef43
Edits to documentation
Oct 21, 2024
63308fd
Trying again with docs syntax.
Oct 21, 2024
fd14407
Edit docs syntax. Surely it is getting close by now.
Oct 21, 2024
b8c6ed9
Edit documentation. Fingers crossed.
Oct 21, 2024
2071000
Added lmfit to list of modules to mock import.
Oct 21, 2024
2247003
Small change to logger output for outliers after iteration.
Oct 21, 2024
64a9696
Made changes to log file and diagnostic plots.
Oct 23, 2024
89ec639
Renamed map_based_pointing and update pointing to get_brightsrc_point…
elle-shaw May 23, 2025
03ed8e9
Merge remote-tracking branch 'origin/master' into pointing_workflow
May 27, 2025
4ac7e45
Major update to solve_pointing_model.py to include per-detector fitti…
elle-shaw Jul 15, 2025
8042065
Fixed issue so now works for fitting LAT parameters. Minor changes to…
elle-shaw Aug 4, 2025
a7120c2
fixed conflicts in conf.py
elle-shaw Aug 4, 2025
dde4236
Added plotting capabilities to show effect of solved pointing paramet…
elle-shaw Aug 4, 2025
41aa7f1
feat: add joint fitting and some db fixes
skhrg Aug 6, 2025
be21499
Merge pull request #1320 from simonsobs/pm_joint_time
elle-shaw Aug 6, 2025
f601872
Added just_test_params functionality to only test initial params aga…
elle-shaw Aug 6, 2025
994081a
Merge remote-tracking branch 'origin/master' into pointing_workflow
elle-shaw Aug 25, 2025
954bdd5
Made small changes to make code be compatible with latest master branch.
elle-shaw Aug 25, 2025
e1e3dbc
Merge remote-tracking branch 'origin/master' into pointing_workflow
elle-shaw Aug 28, 2025
092b2ab
Removed offensive square brackets in a get_obs call
elle-shaw Aug 29, 2025
951de7a
add saturn to possible source objects
elle-shaw Sep 3, 2025
2a38cb3
removed obsolete logger entry
elle-shaw Sep 11, 2025
35adb2d
Merge remote-tracking branch 'origin/master' into solve_pointing
elle-shaw Nov 14, 2025
512d4eb
fixed bug on including a list of detectors to debug with
elle-shaw Nov 19, 2025
9560831
Merge remote-tracking branch 'origin/master' into solve_pointing
elle-shaw Nov 21, 2025
a7fef70
fix: fix supplying only some init pars and plotting when culled
skhrg Oct 27, 2025
f3cf323
Merge branch 'solve_pointing' of github.com:simonsobs/sotodlib into s…
elle-shaw Dec 19, 2025
458aafd
updating to current master changes
elle-shaw Jan 20, 2026
e7f007f
Updated rst documentation with example NERSC submission script
elle-shaw Jan 20, 2026
2de0b16
Changes according to requested comments. Condensed ReduceFlags into C…
elle-shaw Feb 16, 2026
f3befaa
Fixed issues with lonlat quat rotations and hacky negative xi solutions
elle-shaw Feb 25, 2026
e70d68a
Merge with master
elle-shaw Mar 3, 2026
76ae8df
Find boresight azimuth and elevation during detector crossings.
elle-shaw Mar 4, 2026
81ac886
propagate addition of az and el and roll to result set output in dumm…
elle-shaw Mar 18, 2026
5879bf3
Added ability to pass az el and roll values from get_brightsrc datase…
elle-shaw Mar 25, 2026
2601e0b
Merge remote-tracking branch 'origin/master' into pointing_workflow
elle-shaw Mar 25, 2026
3dbb7ed
Pre-fill detector pointing with central values from obs_info if per d…
elle-shaw Mar 26, 2026
2bf265f
feat: barebones epochs system implementation
skhrg Apr 1, 2026
139dc0d
fix: adjust era strictness
skhrg Apr 1, 2026
6c471af
fix: cast output of accumulate
skhrg Apr 1, 2026
4fae6dc
fix: correct variable name in era post init
skhrg Apr 1, 2026
852e214
feat: better strictness system
skhrg Apr 2, 2026
ca89a2c
feat: add tools in calendar to modify eras and epochs and check membe…
skhrg Apr 3, 2026
58875d6
feat: add functions to check on data presence
skhrg Apr 6, 2026
bc34b53
feat: add tag search
skhrg Apr 6, 2026
a77a99b
fix: switch to reduce
skhrg Apr 10, 2026
c6f3612
Lat pmchanges (#1605)
skhrg Apr 14, 2026
3cd40d8
fix: many small bugfixes in loading and initialization
skhrg Apr 14, 2026
e0de726
Merge branch 'pointing_workflow' into solve_pointing such that the
elle-shaw Apr 14, 2026
9838573
Refactoring of code to handle per-detector azimuth data. Implements s…
elle-shaw Apr 20, 2026
5b8780f
Fix bugs and typos. Handle measured vs template options in calculatio…
elle-shaw Apr 22, 2026
0288873
Remove breakpoint(). Error remains on float_ots == True
elle-shaw Apr 22, 2026
51b1ba7
fix: handle nans in OT float and catch some edge cases
skhrg Apr 23, 2026
4eb0d48
fix: minor plotting stuff
skhrg Apr 23, 2026
f473780
fix: dont allow OT offsets to be common mode across OTs and remove un…
skhrg Apr 24, 2026
620b4f5
feat: better ffp plots
skhrg Apr 25, 2026
f7f919c
Pulling in final changes from pointing_workflow and master onto this …
elle-shaw Apr 25, 2026
92dd729
Merge branch 'solve_pointing' of github.com:simonsobs/sotodlib into s…
skhrg May 5, 2026
8eaad8d
fix: more plotting improvements
skhrg May 9, 2026
6ada85f
feat: add ability to refer to previously defined eras during epoch co…
skhrg May 14, 2026
f6114b1
fix: sanatize scalars before saving
skhrg Jun 1, 2026
0412e73
feat: switch from strictness bool to operator input and fix some oper…
skhrg Jun 7, 2026
568809a
fix: pass in OT config properly
skhrg Jun 7, 2026
4489028
feat: First pass of containers for joint focal plane + pointing model…
skhrg Jun 12, 2026
22c41ae
Merge branch 'scalar_save_fix' into ffp_opt_fix
skhrg Jul 13, 2026
3cfd913
feat: lf fixes
skhrg Aug 5, 2026
3e81237
Merge branch 'master' into ffp_opt_fix
skhrg Aug 24, 2026
f470651
feat: dont rerun existing per-obs and some small qol features
skhrg Aug 24, 2026
c7b8b80
Merge branch 'ffp_opt_fix' into lf_point
skhrg Aug 25, 2026
fd0b41e
chore: pep8
skhrg Aug 25, 2026
adf3c36
perf: cache load
skhrg Aug 25, 2026
52e59b0
fix: a bunch of random LF fixes
skhrg Aug 25, 2026
5eb0e29
fix: load robust template
skhrg Aug 28, 2026
d3d9055
fix: some padding fixes
skhrg Aug 28, 2026
04e5159
fix: some minor fitting improvements
skhrg Aug 28, 2026
1ea2329
fix: skip missing entried
skhrg Aug 29, 2026
d503178
feat: add epoch lookup
skhrg Sep 4, 2026
b92b463
feat: add init function and lookup
skhrg Sep 4, 2026
6b24f98
feat: expose joint pm parameters
skhrg Sep 4, 2026
9ee2a64
feat: add fast batch update func
skhrg Sep 13, 2026
f8b1a1c
feat: allow passing in a loaded file string
skhrg Sep 16, 2026
dc66c41
feat: first IO pass
skhrg Sep 16, 2026
9301268
feat: add recursive config utils
skhrg Sep 17, 2026
143551c
fix: path.isfile
skhrg Sep 17, 2026
cf0a0f8
feat: rough pass of new pointing script and first pass of template sy…
skhrg Sep 17, 2026
d9a63d4
fix: lots of small bugfixes
skhrg Sep 22, 2026
a22152a
merged lf_point
skhrg Sep 22, 2026
b8b5607
fix: more bugs
skhrg Sep 22, 2026
3b02672
feat: template fitting
skhrg Sep 23, 2026
b5bac26
feat: add backup mode
skhrg Sep 23, 2026
6042ae6
feat: added some utilities for jobdb management
skhrg Oct 21, 2026
2698fe1
feat: add obslist generation
skhrg Nov 2, 2026
39b975b
feat: add obsloader
skhrg Nov 2, 2026
1b93eb1
Merge branch 'jdb_utils' into ffp_pm
skhrg Nov 3, 2026
ff70246
feat: add per obs job setup
skhrg Nov 3, 2026
aaa3b0d
feat: add per obs loop
skhrg Nov 3, 2026
f09ed87
feat: add plotting for ufms
skhrg Nov 3, 2026
1e9d552
fix: actually index when searching
skhrg Nov 5, 2026
eceb9f6
fix: many fixes:
skhrg Nov 5, 2026
50f13d3
Merge branch 'master' into ffp_pm
skhrg Nov 5, 2026
fe28969
fix: plot the correct fp fields
skhrg Nov 5, 2026
7cc6f1b
feat: add more padding infra
skhrg Nov 5, 2026
45c699e
Merge branch 'master' into ffp_pm
skhrg Nov 5, 2026
da6b17f
fix: pm inversion now supports distortion and actually use pm transfo…
skhrg Nov 6, 2026
3cc4169
fix: take in default overrides and reduce copies
skhrg Nov 6, 2026
ae8e70c
fix: only include numeric params in the top level parameter list
skhrg Nov 6, 2026
c7882e1
feat: move per obs to a dedicated func
skhrg Nov 6, 2026
e5f1ed6
feat: add infra for init pars and bounds
skhrg Nov 6, 2026
ed8de5e
feat: fit loop
skhrg Nov 9, 2026
de72dbb
feat: make focal plaes aware of their parents
skhrg Nov 9, 2026
a41118e
feat: punish per-det scatter
skhrg Nov 9, 2026
3738350
chore: pep8
skhrg Nov 9, 2026
d8cdf88
fix: avoid single point scatter from zeroing out chisq
skhrg Nov 9, 2026
149ce68
fix: bad fstring
skhrg Nov 9, 2026
05a04b5
fix: more consistant naming
skhrg Nov 9, 2026
fdd20f9
feat: add mdb and some small io fixes
skhrg Nov 9, 2026
d4f7ec2
feat: save per-obs every n obs
skhrg Nov 9, 2026
6e27948
feat: add plotting for fits
skhrg Nov 10, 2026
3ec0cec
fix: many small fixes and perf improvements
skhrg Nov 10, 2026
89eabc9
fix: clear cache on every iter and many speedups
skhrg Nov 14, 2026
f8a4992
feat: fit scaled pars
skhrg Nov 14, 2026
43ac23a
feat: nuisance fit
skhrg Nov 17, 2026
f5f4ead
fix!: remove roll check
skhrg Nov 18, 2026
478cf5c
feat: lots of caching and allow rescaling of cm prior
skhrg Nov 18, 2026
9e7c2e1
feat: cleaner logging, jac_sparsity, and gibbs sampling
skhrg Nov 18, 2026
8efca2c
feat: save mcmc to seperate file
skhrg Nov 18, 2026
0fe7289
feat: add nuisance plots
skhrg Nov 18, 2026
697c018
feat: remove hard cm priors and switch to csr
skhrg Nov 18, 2026
11d0c5c
feat: first pass at nuisance transforms
skhrg Nov 18, 2026
43da4fc
fix: update docstrings and a bunch of small fixes
skhrg Nov 18, 2026
c81fdd5
fix: lots of formatting and typos
skhrg Nov 20, 2026
1774c89
feat: start from results of last fit if desired
skhrg Nov 20, 2026
926d06a
perf: switch to block nuisance opt, add pool option, add selective thaw
skhrg Nov 24, 2026
bffbc84
fix: ensure that fake gamma fps dont compute a gamma form floating po…
skhrg Nov 24, 2026
bc63c03
feat: automatically compute pad transforms and make receiver hierarch…
skhrg Nov 24, 2026
c30b96b
feat: force mean zeor nuisance
skhrg Nov 24, 2026
bfa4824
fix: pep8
skhrg Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions docs/site_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,140 @@ the ``focal_plane`` dataset. This can be done like so:
This will give you a dict of ``Receiver`` dataclasses with all the focal plane data.
The keys of this dict are the start times for combined focal planes and the ``obs_id`` for per-obs.

solve_pointing_model
--------------------

This script solves for the pointing model parameters using moon observations.
The inputs are the the el_center, roll_center, and the UFM
center locations as fit by finalize_focal_plane,
per each moon observation.
The fitter uses lmfit with a Nelder-Mead minimization routine to minimize
the distance between modeled data points and the reference data points.
By default, the measured UFM centers are the reference points,
and the quaternion rotations of the pointing model are applied to the nominal, template, UFM center locations.
However, the model can be applied in reverse, with the template positions as reference -- some diagnostic plots are in this space, as it makes it easier to view residuals from multiple boresight orientations at once.
See the ``xieta_model`` parameter comments for more details.

``solve_pointing_model`` can be iterated once after the first parameter fit.
Specifying ``iterate_cutoff`` in arcmin will exlude outliers from next round of fitting.

.. automodule:: sotodlib.site_pipeline.solve_pointing_model
:members:
:undoc-members:

Config file format
``````````````````

Here is an annotated basic configuration file.
The first block are mandatory entries. The second block are optional.

.. code-block:: yaml

# Mandatory to include in config file

# Specify platform for the code to run on. (satp1, satp3 are supported)
platform: satp1
# pm_version tells coords.pointing_model which pointing model to use.
# It determines the quaternion model. Don't change this.
pm_version: sat_v1
# Tag for metadata versioning, will appended to output directory
solution_version_tag: YYMMDDr
# Output directory to save results in.
# A sub directory in {outdir} will be created as
#{platform}_pointing_model_{solution_version_tag}_{xieta_model}_{add_tag}
outdir: /your/save/directory
# Load data and reference focal plane templates
# ffp_path must be common mode subtracted version of focal_plane
ffp_path: "/path/to/centered/focal_plane/metadata/focal_plane_cmsub.h5"
# per_obs_fps are multiple per-observation focal_plane
# fits saved into one h5 file. These are fitted to moon measurements.
# only data from UFMs that had good detector fits are included.
per_obs_fps: /path/to/per-obs/finalize/focal/plane/results/per_obs/focal_plane.h5
# The provided context file is used to load boresight/elevation data from
# obs_ids included in per_obs_fps
context:
path: "/so/metadata/satp1/contexts/nominal/focal_plane.h5"
# List of ufms in order of wafer slot, not currently future
# proof when new ufms are swapped in.
# This assists unpacking per_obs_fps with its sparse UFM info.
ufms: ['ufm_mv19', 'ufm_mv18', 'ufm_mv22', 'ufm_mv29',
'ufm_mv7', 'ufm_mv9', 'ufm_mv15'] #satp1
# ufms: ['ufm_mv5', 'ufm_mv27', 'ufm_mv35', 'ufm_mv12',
# 'ufm_mv23', 'ufm_mv33', 'ufm_mv17'] #satp3

# Optional configuration parameters

# parameters included here will be fixed in the minimization.
# See comments for which to fix for different platforms.
fixed_params:
- az_rot #all
- base_tilt_cos #all
- base_tilt_sin #all
- fp_rot_eta0 #all
- fp_offset_eta0 #all
- fp_rot_xi0 #satp3 only
# "xieta_model" decides which parameter space the fitting occurs in.
# "measured": The fitter applies pointing model to template UFM xi-eta
# locations based on El and Roll of the obs, to get the modeled
# xi-etas to match the measured data points.
# Modeled data points get spread out based on boresight.
# "template": The fitter applies pointing model "backwards" on measured
# xieta data points to match them to template locations.
# The modeled data points cluster around
# the nominal template locations.
# Each method gives slightly different results. "measured" is default.
xieta_model: measured
# Define a weight cutoff for fitting routine.
weight_cutoff: 0.2
# Cut out any known bad observations.
skip_tags:
- "_1713" #bad timing satp1
- "1716423951" #Just a very bad fit satp1
# Option to iterate parameter fitting. If not None, data points with
# fit residuals higher than cutoff will be excluded from second round of fits.
iterate_cutoff: None # or arcmin
# Make diagnostic plots.
make_plots: True
# any additional tag to append on results directory
append: ""
save_output: True


Output file format
``````````````````

The inputs and outputs ``solve_pointing_model`` are stored as an AxisManager, before saving to an .h5 file.
Only the pointing model parameters + version are saved to the ManifestdB ``db.sqlite``.

.. code-block:: text

- ancil (aman)
- az_enc (num_obs * 7)
- boresight_enc (num_obs * 7)
- el_enc (num_obs * 7)
- ffp_ufm_center_fits ((xi, eta, gamma), num_obs * 7) #This where the info from per_obs_fps gets stored
- nom_ufm_centers ((xi, eta, gamma), num_obs * 7) #This is where info from cmsub focal_plane goes.
- obs_info (aman)
- obs_ids (num_obs)
- roll_c (num_obs * 7)
- weights (num_obs * 7)
- model_fits (aman)
- eta (num_obs * 7)
- xi (num_obs * 7)
- pointing_model (aman)
- pm_version
- parameters by name
#- parameter_fit_stats #Not yet implemented in output, but visible in log file.
# - name
# - value
# - vary
# - min
# - max
# - stderr
# - correl #correlation with other fit params
#- excluded (Data points)


preprocess-tod
--------------
This script is set up to run a preprocessing pipeline using the preprocess
Expand Down
Loading
Loading