Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pitch, attitude constraints and 2- and 3-star solutions #31

Merged
merged 34 commits into from
Aug 19, 2024

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Jul 18, 2024

Description

This adds a new Constraint object that allows specifying constraints on the selected star pairs and attitude solutions.

3-star solutions

Previously the code required at least 4 stars because it was searching the entire sky. Now with at least a pitch constraint (to within +1.5 deg of the estimated pitch), one can reliably get a good attitude with only 3 stars. This pitch constraint reduces the star pairs by at least a factor of 10.

If there is a reliable estimated attitude this constrains the search space even more (by over a factor of 100).

2-stars solutions

With these constraints, it is now possible to generate an attitude solution with as few as two stars, but from testing we find that this is not reliable enough for operational use (e.g. updating the on-board attitude and maneuvering).

Requires

Interface impacts

The find_attitude_solutions() API is backward compatible.

If no constraint is provided, that falls back to the legacy behavior of doing an all-sky search with no constraints. This option is not generally recommended going forward since in real operations we almost always know at least the pitch and expect that the spacecraft is sun-pointed (off-nominal roll close to zero).

If a constraint is provided then this requires a distances HDF5 file created with this PR that includes the HEALpix indices.

Post-install action

Create a new distances_1p8.h5 file (if not already available - needs to be made with the code from this PR that includes b2c4e54).

cp distances_1p8.h5 $SKA/data/find_attitude/
cd $SKA/data/find_attitude
mv distances{,_1p7}.h5
ln -s distances_1p8.h5 distances.h5

Testing

Unit tests

  • Mac
(ska3-dev) ➜  find_attitude git:(normal-sun-attitude-constraints) ✗ pytest -v
====================================================== test session starts ======================================================
platform darwin -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0 -- /Users/aldcroft/miniconda3/envs/ska3-dev/bin/python3.11
cachedir: .pytest_cache
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: timeout-2.2.0, anyio-4.3.0
collected 24 items                                                                                                              

find_attitude/tests/test_find_attitude.py::test_overlapping_distances PASSED                                              [  4%]
find_attitude/tests/test_find_attitude.py::test_multiple_solutions PASSED                                                 [  8%]
find_attitude/tests/test_find_attitude.py::test_att_constraint_3_stars[0] PASSED                                          [ 12%]
find_attitude/tests/test_find_attitude.py::test_att_constraint_3_stars[1] PASSED                                          [ 16%]
find_attitude/tests/test_find_attitude.py::test_att_constraint_3_stars[2] PASSED                                          [ 20%]
find_attitude/tests/test_find_attitude.py::test_att_constraint_3_stars[3] PASSED                                          [ 25%]
find_attitude/tests/test_find_attitude.py::test_att_constraint_3_stars[4] PASSED                                          [ 29%]
find_attitude/tests/test_find_attitude.py::test_att_constraint_2_stars PASSED                                             [ 33%]
find_attitude/tests/test_find_attitude.py::test_no_constraints_4_to_8_stars[20] PASSED                                    [ 37%]
find_attitude/tests/test_find_attitude.py::test_no_constraints_4_to_8_stars[21] PASSED                                    [ 41%]
find_attitude/tests/test_find_attitude.py::test_no_constraints_4_to_8_stars[22] PASSED                                    [ 45%]
find_attitude/tests/test_find_attitude.py::test_no_constraints_4_to_8_stars[23] PASSED                                    [ 50%]
find_attitude/tests/test_find_attitude.py::test_no_constraints_4_to_8_stars[24] PASSED                                    [ 54%]
find_attitude/tests/test_find_attitude.py::test_pitch_constraint_3_stars[30] PASSED                                       [ 58%]
find_attitude/tests/test_find_attitude.py::test_pitch_constraint_3_stars[31] PASSED                                       [ 62%]
find_attitude/tests/test_find_attitude.py::test_pitch_constraint_3_stars[32] PASSED                                       [ 66%]
find_attitude/tests/test_find_attitude.py::test_pitch_constraint_3_stars[33] PASSED                                       [ 70%]
find_attitude/tests/test_find_attitude.py::test_pitch_constraint_3_stars[34] PASSED                                       [ 75%]
find_attitude/tests/test_find_attitude.py::test_nsm_2024036 PASSED                                                        [ 79%]
find_attitude/tests/test_find_attitude.py::test_ra_dec_roll PASSED                                                        [ 83%]
find_attitude/tests/test_find_attitude.py::test_get_stars_from_greta PASSED                                               [ 87%]
find_attitude/tests/test_find_attitude.py::test_get_stars_from_table PASSED                                               [ 91%]
find_attitude/tests/test_find_attitude.py::test_get_stars_from_maude PASSED                                               [ 95%]
find_attitude/tests/test_find_attitude.py::test_at_times PASSED                                                           [100%]
...
========================================== 24 passed, 2 warnings in 131.57s (0:02:11) ===========================================

(ska3-dev) ➜  find_attitude git:(normal-sun-attitude-constraints) git rev-parse HEAD                                
487646018f227cee7e9a7b666efca19a94989708

Independent check of unit tests by Jean

  • Linux
Switched to a new branch 'normal-sun-attitude-constraints'
ska3-jeanconn-fido> pytest -vs
================================================ test session starts ================================================
platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0 -- /proj/sot/ska3/flight/bin/python3.11
cachedir: .pytest_cache
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.3.0, timeout-2.2.0
collected 6 items                                                                                                   

find_attitude/tests/test_find_attitude.py::test_overlapping_distances Removing star(2) 541327568 with ra=131.24753, dec=64.49365 mag=10.15 dist=20.16 arcsec
2024-08-12 09:03:46,192 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:03:46,205 Starting get_match_graph
2024-08-12 09:03:46,205 Getting matches from file
2024-08-12 09:03:48,274 Adding edges from 498901 matching distance pairs
2024-08-12 09:03:51,481 Added total of 150151 nodes
2024-08-12 09:03:51,488 Getting all triangles from match graph
2024-08-12 09:03:52,081 Finding triangles that match stars pattern
2024-08-12 09:03:52,106 Checking clique [541337704, 541736344, 541460960, 541466560, 541730152, 541465104, 541340472, 541862768]
2024-08-12 09:03:52,107 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 4.1243e+07
Final fit statistic   = 0.0758881 at function evaluation 267
Data points           = 16
Degrees of freedom    = 14
Probability [Q-value] = 1
Reduced statistic     = 0.00542058
Change in statistic   = 4.1243e+07
   yagzag.dra     1108.48     
   yagzag.ddec    1981.53     
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 0.0758881
Final fit statistic   = 0.00297146 at function evaluation 340
Data points           = 16
Degrees of freedom    = 13
Probability [Q-value] = 1
Reduced statistic     = 0.000228574
Change in statistic   = 0.0729166
   yagzag.dra     1108.51     
   yagzag.ddec    1981.52     
   yagzag.droll   -246.9      
*********************************************

============================
Input: RA Dec Roll = 131.13716 65.25370 112.43514
Solve: RA Dec Roll = 131.13716 65.25370 112.43512
 AGASC_ID    RA      DEC     YAG    YAG_ERR   ZAG   ZAG_ERR ...  m_yag     dy   m_zag    dz   dr  m_agasc_id
--------- -------- ------- -------- ------- ------- ------- ... -------- ----- ------- ----- ---- ----------
541736344 129.7983 65.0215    24.04   -0.00 2191.87   -0.00 ...    24.00  0.04 2191.88 -0.01 0.04  541736344
541337704 130.4016 64.7051 -1387.76   -0.00 1797.10   -0.01 ... -1387.74 -0.02 1797.10  0.00 0.02  541337704
541862768 131.6539 65.4555   379.55   -0.00 -992.69    0.01 ...   379.54  0.01 -992.68 -0.01 0.02  541862768
541730152 130.6386 66.0899  3062.82   -0.00 -477.61    0.01 ...  3062.84 -0.02 -477.62  0.01 0.02  541730152
541460960 131.8534 64.8755 -1670.57    0.01 -494.75   -0.00 ... -1670.57 -0.00 -494.76  0.00 0.00  541460960
541340472 130.0480 64.5679 -1626.01    0.00 2493.05   -0.00 ... -1626.00 -0.01 2493.05  0.00 0.02  541340472
541465104 131.6403 64.9641 -1253.47   -0.00 -311.71    0.00 ... -1253.47  0.00 -311.71  0.00 0.00  541465104
541466560 131.4742 64.6456 -2220.54   -0.00  354.77    0.00 ... -2220.55  0.01  354.77 -0.00 0.01  541466560
*********************************************

PASSED
find_attitude/tests/test_find_attitude.py::test_multiple_solutions 2024-08-12 09:03:54,504 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:03:54,521 Starting get_match_graph
2024-08-12 09:03:54,521 Getting matches from file
2024-08-12 09:03:57,575 Adding edges from 2082578 matching distance pairs
2024-08-12 09:04:19,920 Added total of 570129 nodes
2024-08-12 09:04:19,941 Getting all triangles from match graph
2024-08-12 09:04:25,639 Finding triangles that match stars pattern
2024-08-12 09:04:26,087 Checking clique [1130891248, 1130896168, 1130241560, 1130895384]
2024-08-12 09:04:26,098 Checking clique [260838832, 260851360, 260858632, 260856472, 189811352, 260863544, 189800592, 189804208]
2024-08-12 09:04:26,118 Checking clique [632305776, 632842952, 632312368, 632315056]
2024-08-12 09:04:26,132 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 690430
Final fit statistic   = 510.491 at function evaluation 217
Data points           = 8
Degrees of freedom    = 6
Probability [Q-value] = 4.6204e-107
Reduced statistic     = 85.0818
Change in statistic   = 689920
   yagzag.dra     -331.086    
   yagzag.ddec    -250.714    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 510.491
Final fit statistic   = 508.765 at function evaluation 313
Data points           = 8
Degrees of freedom    = 5
Probability [Q-value] = 1.02382e-107
Reduced statistic     = 101.753
Change in statistic   = 1.72547
   yagzag.dra     -331.143    
   yagzag.ddec    -250.832    
   yagzag.droll   -70.6788    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 8.52219e+07
Final fit statistic   = 6.46516 at function evaluation 262
Data points           = 16
Degrees of freedom    = 14
Probability [Q-value] = 0.953372
Reduced statistic     = 0.461797
Change in statistic   = 8.52219e+07
   yagzag.dra     914.24      
   yagzag.ddec    -3133.19    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 6.46516
Final fit statistic   = 6.30172 at function evaluation 335
Data points           = 16
Degrees of freedom    = 13
Probability [Q-value] = 0.934479
Reduced statistic     = 0.484748
Change in statistic   = 0.163442
   yagzag.dra     914.254     
   yagzag.ddec    -3133.19    
   yagzag.droll   111.612     
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 5.02538e+06
Final fit statistic   = 12408.2 at function evaluation 197
Data points           = 8
Degrees of freedom    = 6
Probability [Q-value] = 0
Reduced statistic     = 2068.03
Change in statistic   = 5.01297e+06
   yagzag.dra     514.413     
   yagzag.ddec    -994.307    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 12408.2
Final fit statistic   = 12406.6 at function evaluation 237
Data points           = 8
Degrees of freedom    = 5
Probability [Q-value] = 0
Reduced statistic     = 2481.32
Change in statistic   = 1.6267
   yagzag.dra     514.467     
   yagzag.ddec    -994.191    
   yagzag.droll   109.879     
*********************************************

============================
Input: RA Dec Roll = 190.32870 22.69844 111.51056
Solve: RA Dec Roll = 166.61269 -58.59654 289.17066
 AGASC_ID    RA      DEC     YAG    YAG_ERR   ZAG    ZAG_ERR ...  m_yag     dy   m_zag    dz     dr  m_agasc_id
--------- -------- ------- -------- ------- -------- ------- ... -------- ----- ------- ------ ----- ----------
260863544 189.7589 22.6594   567.40    0.62  1811.02   -0.29 ...       --    --      --     --    --         --
189804208 191.0937 21.9927 -3294.28   -0.18 -1445.82    0.81 ...       --    --      --     --    --         --
189800592 190.3440 21.8306 -2925.82   -0.38  1098.71    0.46 ... -2928.52  2.70 1088.84   9.87 10.23 1130241560
260856472 190.7874 23.2709  1363.52    0.29 -2168.31   -0.26 ...       --    --      --     --    --         --
260858632 190.1734 22.9717  1103.79   -0.37   118.09   -0.14 ...  1106.50 -2.71  127.64  -9.55  9.93 1130896168
189811352 190.1483 22.1509 -1612.85    0.24  1282.02   -0.31 ...       --    --      --     --    --         --
260838832 190.0534 23.5688  3249.59    0.68  -304.40   -0.17 ...  3246.34  3.24 -316.17  11.77 12.21 1130895384
260851360 190.2358 22.6256  -130.37    0.35   383.40    0.17 ...  -127.14 -3.23  395.48 -12.08 12.51 1130891248
BAD FIT!
============================
Input: RA Dec Roll = 190.32870 22.69844 111.51056
Solve: RA Dec Roll = 190.32854 22.69833 111.50212
 AGASC_ID    RA      DEC     YAG    YAG_ERR   ZAG    ZAG_ERR ...  m_yag     dy   m_zag     dz   dr  m_agasc_id
--------- -------- ------- -------- ------- -------- ------- ... -------- ----- -------- ----- ---- ----------
260863544 189.7589 22.6594   567.40    0.62  1811.02   -0.29 ...   566.69  0.71  1811.25 -0.23 0.75  260863544
189804208 191.0937 21.9927 -3294.28   -0.18 -1445.82    0.81 ... -3294.70  0.43 -1445.54 -0.28 0.51  189804208
189800592 190.3440 21.8306 -2925.82   -0.38  1098.71    0.46 ... -2924.81 -1.01  1098.09  0.62 1.18  189800592
260856472 190.7874 23.2709  1363.52    0.29 -2168.31   -0.26 ...  1363.52  0.00 -2168.17 -0.14 0.14  260856472
260858632 190.1734 22.9717  1103.79   -0.37   118.09   -0.14 ...  1104.38 -0.59   117.84  0.25 0.64  260858632
189811352 190.1483 22.1509 -1612.85    0.24  1282.02   -0.31 ... -1612.27 -0.57  1282.93 -0.91 1.08  189811352
260838832 190.0534 23.5688  3249.59    0.68  -304.40   -0.17 ...  3249.66 -0.07  -304.03 -0.37 0.38  260838832
260851360 190.2358 22.6256  -130.37    0.35   383.40    0.17 ...  -131.48  1.11   382.34  1.06 1.53  260851360
============================
Input: RA Dec Roll = 190.32870 22.69844 111.51056
Solve: RA Dec Roll = 109.69751 -5.45896 109.89203
 AGASC_ID    RA      DEC     YAG    YAG_ERR   ZAG    ZAG_ERR ...  m_yag     dy    m_zag    dz     dr  m_agasc_id
--------- -------- ------- -------- ------- -------- ------- ... -------- ------ ------- ------ ----- ----------
260863544 189.7589 22.6594   567.40    0.62  1811.02   -0.29 ...       --     --      --     --    --         --
189804208 191.0937 21.9927 -3294.28   -0.18 -1445.82    0.81 ...       --     --      --     --    --         --
189800592 190.3440 21.8306 -2925.82   -0.38  1098.71    0.46 ... -2937.85  12.04 1048.15  50.56 51.98  632842952
260856472 190.7874 23.2709  1363.52    0.29 -2168.31   -0.26 ...       --     --      --     --    --         --
260858632 190.1734 22.9717  1103.79   -0.37   118.09   -0.14 ...  1109.89  -6.10  145.75 -27.67 28.33  632305776
189811352 190.1483 22.1509 -1612.85    0.24  1282.02   -0.31 ...       --     --      --     --    --         --
260838832 190.0534 23.5688  3249.59    0.68  -304.40   -0.17 ...  3238.27  11.31 -357.04  52.64 53.84  632315056
260851360 190.2358 22.6256  -130.37    0.35   383.40    0.17 ...  -113.13 -17.24  458.94 -75.54 77.48  632312368
BAD FIT!
*********************************************

PASSED
find_attitude/tests/test_find_attitude.py::test_ra_dec_roll 2024-08-12 09:04:29,373 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:04:29,390 Starting get_match_graph
2024-08-12 09:04:29,390 Getting matches from file
2024-08-12 09:04:31,645 Adding edges from 1003949 matching distance pairs
2024-08-12 09:04:40,235 Added total of 321141 nodes
2024-08-12 09:04:40,249 Getting all triangles from match graph
2024-08-12 09:04:42,166 Finding triangles that match stars pattern
2024-08-12 09:04:42,268 Checking clique [1204815872, 1204815968, 1229590664, 1229592112, 1229601872, 1229598320, 1229593496, 1229592728]
2024-08-12 09:04:42,275 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 5.26603e+07
Final fit statistic   = 0.52915 at function evaluation 282
Data points           = 16
Degrees of freedom    = 14
Probability [Q-value] = 1
Reduced statistic     = 0.0377964
Change in statistic   = 5.26603e+07
   yagzag.dra     222.386     
   yagzag.ddec    -2555.98    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 0.52915
Final fit statistic   = 0.529092 at function evaluation 358
Data points           = 16
Degrees of freedom    = 13
Probability [Q-value] = 1
Reduced statistic     = 0.0406994
Change in statistic   = 5.80345e-05
   yagzag.dra     222.387     
   yagzag.ddec    -2555.98    
   yagzag.droll   86.1743     
*********************************************

============================
Input: RA Dec Roll = 115.77046 -75.65804 86.40891
Solve: RA Dec Roll = 115.77055 -75.65802 86.41509
 AGASC_ID     RA      DEC      YAG    YAG_ERR   ZAG    ZAG_ERR ...  m_yag     dy   m_zag     dz   dr  m_agasc_id
---------- -------- -------- -------- ------- -------- ------- ... -------- ----- -------- ----- ---- ----------
1229590664 113.9040 -75.5443   277.22   -0.00  1697.80    0.01 ...   277.35 -0.12  1697.79  0.01 0.12 1229590664
1229598320 117.5286 -75.5923   311.21   -0.21 -1558.08    0.09 ...   311.18  0.03 -1558.12  0.04 0.05 1229598320
1229593496 113.9002 -75.1111  1829.89    0.35  1847.92   -0.10 ...  1829.66  0.23  1847.90  0.01 0.23 1229593496
1229592728 114.4727 -75.4207   765.97   -0.10  1226.29   -0.04 ...   766.13 -0.16  1226.33 -0.04 0.16 1229592728
1204815968 114.9242 -74.8726  2766.51   -0.16   970.31    0.05 ...  2766.71 -0.20   970.03  0.28 0.35 1204815968
1229601872 116.9575 -76.1410 -1681.46    0.09 -1130.60    0.50 ... -1681.74  0.28 -1130.85  0.24 0.37 1229601872
1204815872 115.5212 -74.9482  2535.43   -0.04   392.08   -0.56 ...  2535.45 -0.02   392.46 -0.37 0.38 1204815872
1229592112 112.1747 -75.4081   595.26    0.24  3302.82   -0.17 ...   595.30 -0.04  3302.99 -0.17 0.18 1229592112
*********************************************

PASSED
find_attitude/tests/test_find_attitude.py::test_get_stars_from_greta 2024-08-12 09:04:43,534 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:04:43,552 Starting get_match_graph
2024-08-12 09:04:43,552 Getting matches from file
2024-08-12 09:04:44,450 Adding edges from 652365 matching distance pairs
2024-08-12 09:04:48,265 Added total of 182353 nodes
2024-08-12 09:04:48,273 Getting all triangles from match graph
2024-08-12 09:04:49,010 Finding triangles that match stars pattern
2024-08-12 09:04:49,037 Checking clique [260186640, 189142952, 189143696, 189148400, 189148592]
2024-08-12 09:04:49,042 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 3.31802e+07
Final fit statistic   = 4.36981 at function evaluation 236
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.822313
Reduced statistic     = 0.546226
Change in statistic   = 3.31802e+07
   yagzag.dra     1671.07     
   yagzag.ddec    -1960.45    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 4.36981
Final fit statistic   = 4.32025 at function evaluation 310
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.74224
Reduced statistic     = 0.617179
Change in statistic   = 0.0495546
   yagzag.dra     1671.08     
   yagzag.ddec    -1960.42    
   yagzag.droll   -255.815    
{'agasc_id_star_map': {189142952: 0,
                       189143696: 1,
                       189148400: 3,
                       189148592: 2,
                       260186640: 4},
 'agasc_ids': {260186640, 189143696, 189148400, 189148592, 189142952},
 'att_fit': <Quat q1=-0.13730809 q2=-0.76997581 q3=-0.60729077 q4=0.13957673>,
 'bad_fit': False,
 'm_yags': array([ 2310.14707404,   223.56970864,  -452.75600902,   598.24169619,
       -1254.46241673]),
 'm_zags': array([ 1139.79778303,    56.79304862, -2083.64590888,  2287.51359415,
         196.42155777]),
 'statval': 4.320251962809993,
 'summary': <Table masked=True length=5>
 slot type function fid    YAG      ZAG    MAG_ACA  m_yag      dy    m_zag      dz      dr   m_agasc_id
int64 str4   str4   str4 float64  float64  float64 float64  float64 float64  float64 float64   int64   
----- ---- -------- ---- -------- -------- ------- -------- ------- -------- ------- ------- ----------
    3 STAR     TRAK STAR   223.33    55.83    9.70   223.57   -0.24    56.79   -0.96    0.99  189142952
    4 STAR     TRAK STAR  -453.10 -2084.10    9.60  -452.76   -0.34 -2083.65   -0.45    0.57  189143696
    5 STAR     TRAK STAR -1255.12   196.58    9.20 -1254.46   -0.66   196.42    0.16    0.68  189148592
    6 STAR     TRAK STAR   598.18  2287.97    9.60   598.24   -0.06  2287.51    0.46    0.46  189148400
    7 STAR     TRAK STAR  2311.45  1140.60    9.80  2310.15    1.30  1139.80    0.80    1.53  260186640,
 'yags': <Column name='YAG' dtype='float64' length=5>
 2311.45
  223.33
  -453.1
  598.18
-1255.12,
 'zags': <Column name='ZAG' dtype='float64' length=5>
 1140.6
  55.83
-2084.1
2287.97
 196.58}
RA, Dec, Roll [177.40047461  22.43984761 103.98905944]
PASSED
find_attitude/tests/test_find_attitude.py::test_get_stars_from_table 2024-08-12 09:04:49,725 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:04:49,741 Starting get_match_graph
2024-08-12 09:04:49,741 Getting matches from file
2024-08-12 09:04:50,555 Adding edges from 652365 matching distance pairs
2024-08-12 09:04:54,470 Added total of 182353 nodes
2024-08-12 09:04:54,479 Getting all triangles from match graph
2024-08-12 09:04:55,202 Finding triangles that match stars pattern
2024-08-12 09:04:55,229 Checking clique [260186640, 189142952, 189143696, 189148400, 189148592]
2024-08-12 09:04:55,234 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 3.31802e+07
Final fit statistic   = 4.36981 at function evaluation 236
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.822313
Reduced statistic     = 0.546226
Change in statistic   = 3.31802e+07
   yagzag.dra     1671.07     
   yagzag.ddec    -1960.45    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 4.36981
Final fit statistic   = 4.32025 at function evaluation 310
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.74224
Reduced statistic     = 0.617179
Change in statistic   = 0.0495546
   yagzag.dra     1671.08     
   yagzag.ddec    -1960.42    
   yagzag.droll   -255.815    
{'agasc_id_star_map': {189142952: 0,
                       189143696: 1,
                       189148400: 3,
                       189148592: 2,
                       260186640: 4},
 'agasc_ids': {260186640, 189143696, 189148400, 189148592, 189142952},
 'att_fit': <Quat q1=-0.13730809 q2=-0.76997581 q3=-0.60729077 q4=0.13957673>,
 'bad_fit': False,
 'm_yags': array([ 2310.147074  ,   223.56970862,  -452.75600901,   598.24169614,
       -1254.46241676]),
 'm_zags': array([ 1139.79778309,    56.79304867, -2083.64590886,  2287.51359418,
         196.42155778]),
 'statval': 4.32025199683135,
 'summary': <Table masked=True length=5>
 slot   YAG      ZAG    MAG_ACA  m_yag      dy    m_zag      dz      dr   m_agasc_id
int64 float64  float64  float64 float64  float64 float64  float64 float64   int64   
----- -------- -------- ------- -------- ------- -------- ------- ------- ----------
    3   223.33    55.83    9.70   223.57   -0.24    56.79   -0.96    0.99  189142952
    4  -453.10 -2084.10    9.60  -452.76   -0.34 -2083.65   -0.45    0.57  189143696
    5 -1255.12   196.58    9.20 -1254.46   -0.66   196.42    0.16    0.68  189148592
    6   598.18  2287.97    9.60   598.24   -0.06  2287.51    0.46    0.46  189148400
    7  2311.45  1140.60    9.80  2310.15    1.30  1139.80    0.80    1.53  260186640,
 'yags': <Column name='YAG' dtype='float64' length=5>
 2311.45
  223.33
  -453.1
  598.18
-1255.12,
 'zags': <Column name='ZAG' dtype='float64' length=5>
 1140.6
  55.83
-2084.1
2287.97
 196.58}
RA, Dec, Roll [177.40047461  22.43984761 103.98905944]
PASSED
find_attitude/tests/test_find_attitude.py::test_at_times 2024-08-12 09:04:59,636 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:04:59,651 Starting get_match_graph
2024-08-12 09:04:59,651 Getting matches from file
2024-08-12 09:05:02,451 Adding edges from 1652212 matching distance pairs
2024-08-12 09:05:19,745 Added total of 500425 nodes
2024-08-12 09:05:19,764 Getting all triangles from match graph
2024-08-12 09:05:23,911 Finding triangles that match stars pattern
2024-08-12 09:05:24,138 Checking clique [556140088, 556277280, 556277696, 556144392, 556146512, 556140696, 556144544]
2024-08-12 09:05:24,139 Checking clique [556140088, 556277280, 556277696, 556144392, 556146512, 556140696, 556144545]
2024-08-12 09:05:24,159 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 1.64346e+07
Final fit statistic   = 4.58078 at function evaluation 268
Data points           = 14
Degrees of freedom    = 12
Probability [Q-value] = 0.970538
Reduced statistic     = 0.381731
Change in statistic   = 1.64346e+07
   yagzag.dra     1518.96     
   yagzag.ddec    -201.37     
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 4.58078
Final fit statistic   = 4.56669 at function evaluation 331
Data points           = 14
Degrees of freedom    = 11
Probability [Q-value] = 0.950325
Reduced statistic     = 0.415154
Change in statistic   = 0.0140842
   yagzag.dra     1518.95     
   yagzag.ddec    -201.381    
   yagzag.droll   -11.4557    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 1.64355e+07
Final fit statistic   = 3.65957 at function evaluation 267
Data points           = 14
Degrees of freedom    = 12
Probability [Q-value] = 0.988826
Reduced statistic     = 0.304964
Change in statistic   = 1.64355e+07
   yagzag.dra     1519.03     
   yagzag.ddec    -201.232    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 3.65957
Final fit statistic   = 3.60048 at function evaluation 337
Data points           = 14
Degrees of freedom    = 11
Probability [Q-value] = 0.980183
Reduced statistic     = 0.327317
Change in statistic   = 0.0590846
   yagzag.dra     1519        
   yagzag.ddec    -201.256    
   yagzag.droll   -11.4569    
[300.65772971  66.73093144 347.56141286]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    0 -1393.85   856.18    8.38 -1394.46  0.61   855.98  0.20 0.64  556144392
    1  1867.65 -1133.40    7.38  1867.98 -0.33 -1133.48  0.08 0.34  556277696
    2 -1800.83  2344.22    7.88 -1801.02  0.20  2344.34 -0.11 0.23  556140696
    3  2361.40  1381.50    9.19       --    --       --    --   --         --
    4 -1961.70 -1988.80    9.25 -1961.91  0.21 -1988.76 -0.04 0.22  556144545
    5  1793.12   857.25    8.88  1794.71 -1.59   857.12  0.13 1.59  556277280
    6 -1701.08  2402.55    8.94 -1701.60  0.53  2402.71 -0.16 0.55  556146512
    7 -1528.35  -104.58    8.19 -1528.71  0.36  -104.48 -0.09 0.37  556140088
2024-08-12 09:05:27,286 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:05:27,304 Starting get_match_graph
2024-08-12 09:05:27,305 Getting matches from file
2024-08-12 09:05:28,193 Adding edges from 571733 matching distance pairs
2024-08-12 09:05:30,447 Added total of 146726 nodes
2024-08-12 09:05:30,455 Getting all triangles from match graph
2024-08-12 09:05:30,972 Finding triangles that match stars pattern
2024-08-12 09:05:30,991 Checking clique [114303096, 114296256, 114297536, 115217168, 114301168]
2024-08-12 09:05:30,995 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 2.09306e+07
Final fit statistic   = 1.09824 at function evaluation 254
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.997548
Reduced statistic     = 0.13728
Change in statistic   = 2.09306e+07
   yagzag.dra     1286.79     
   yagzag.ddec    -1590.69    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 1.09824
Final fit statistic   = 0.90302 at function evaluation 331
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.996245
Reduced statistic     = 0.129003
Change in statistic   = 0.195216
   yagzag.dra     1286.85     
   yagzag.ddec    -1590.63    
   yagzag.droll   -143.913    
[183.5822259   14.07362292 215.99444066]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    3  1804.23 -1062.78    9.25  1804.49 -0.27 -1062.85  0.07 0.28  114296256
    4  -898.60  -198.68    9.25  -898.71  0.11  -198.82  0.15 0.18  114297536
    5  1658.60 -1197.12    9.06  1658.27  0.33 -1196.96 -0.17 0.37  114301168
    6   102.73 -2042.90    9.25   103.06 -0.34 -2043.38  0.48 0.59  114303096
    7 -1754.05   891.85    9.44 -1754.21  0.16   892.38 -0.53 0.56  115217168
2024-08-12 09:05:32,300 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:05:32,315 Starting get_match_graph
2024-08-12 09:05:32,316 Getting matches from file
2024-08-12 09:05:33,177 Adding edges from 320902 matching distance pairs
2024-08-12 09:05:34,265 Added total of 56585 nodes
2024-08-12 09:05:34,269 Getting all triangles from match graph
2024-08-12 09:05:34,413 Finding triangles that match stars pattern
2024-08-12 09:05:34,417 Checking clique [413421624, 411701808, 411707968, 413929808, 413421016]
2024-08-12 09:05:34,418 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 1.12458e+07
Final fit statistic   = 0.356036 at function evaluation 273
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.999964
Reduced statistic     = 0.0445045
Change in statistic   = 1.12458e+07
   yagzag.dra     -1358.35    
   yagzag.ddec    -635.649    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 0.356036
Final fit statistic   = 0.316919 at function evaluation 335
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.99988
Reduced statistic     = 0.0452742
Change in statistic   = 0.0391162
   yagzag.dra     -1358.32    
   yagzag.ddec    -635.678    
   yagzag.droll   101.66      
[299.90202348  40.71545505 101.98613369]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    3   856.00  1160.78    8.81   856.03 -0.03  1161.03 -0.25 0.25  411701808
    4   968.45   884.40    7.19   968.58 -0.13   884.46 -0.06 0.14  411707968
    5 -1344.40 -1703.70    8.69 -1344.74  0.34 -1703.96  0.26 0.43  413421016
    6   347.85 -1458.83    8.62   348.03 -0.18 -1458.76 -0.06 0.19  413421624
    7  1835.12 -2377.00    8.44  1835.13 -0.01 -2377.11  0.11 0.11  413929808
2024-08-12 09:05:35,600 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:05:35,616 Starting get_match_graph
2024-08-12 09:05:35,617 Getting matches from file
2024-08-12 09:05:36,579 Adding edges from 626902 matching distance pairs
2024-08-12 09:05:40,143 Added total of 170460 nodes
2024-08-12 09:05:40,151 Getting all triangles from match graph
2024-08-12 09:05:40,801 Finding triangles that match stars pattern
2024-08-12 09:05:40,818 Checking clique [525735456, 525732232, 525732488, 525609504, 525732528]
2024-08-12 09:05:40,820 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 1.59612e+07
Final fit statistic   = 2.42497 at function evaluation 267
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.965138
Reduced statistic     = 0.303121
Change in statistic   = 1.59612e+07
   yagzag.dra     522.568     
   yagzag.ddec    -1708.58    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 2.42497
Final fit statistic   = 2.42294 at function evaluation 321
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.932787
Reduced statistic     = 0.346135
Change in statistic   = 0.00202713
   yagzag.dra     522.569     
   yagzag.ddec    -1708.58    
   yagzag.droll   67.203      
[350.90860761  58.83232204  66.96183446]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    3   312.40 -1413.25    9.06   312.74 -0.34 -1414.51  1.26 1.31  525732232
    4 -1640.28   979.95    8.38 -1640.21 -0.07   980.20 -0.25 0.26  525732488
    5  2054.50  -521.35    9.31  2054.23  0.27  -520.99 -0.36 0.45  525732528
    6 -2310.08  1094.50    9.00 -2310.48  0.41  1094.84 -0.34 0.53  525609504
    7  1372.38  1143.48    7.06  1372.64 -0.27  1143.79 -0.31 0.41  525735456
2024-08-12 09:05:42,128 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:05:42,144 Starting get_match_graph
2024-08-12 09:05:42,144 Getting matches from file
2024-08-12 09:05:43,046 Adding edges from 334826 matching distance pairs
2024-08-12 09:05:43,915 Added total of 61050 nodes
2024-08-12 09:05:43,919 Getting all triangles from match graph
2024-08-12 09:05:44,078 Finding triangles that match stars pattern
2024-08-12 09:05:44,081 Checking clique [897717296, 896008984, 896009152, 896012968, 896014528]
2024-08-12 09:05:44,082 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 3.29828e+07
Final fit statistic   = 0.819601 at function evaluation 269
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.999151
Reduced statistic     = 0.10245
Change in statistic   = 3.29828e+07
   yagzag.dra     -2307.57    
   yagzag.ddec    -1127.52    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 0.819601
Final fit statistic   = 0.819009 at function evaluation 348
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.997245
Reduced statistic     = 0.117001
Change in statistic   = 0.000592253
   yagzag.dra     -2307.56    
   yagzag.ddec    -1127.52    
   yagzag.droll   -273.168    
[267.20119561 -27.18678788  86.50658263]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    3 -2199.58 -2014.73    8.81 -2199.56 -0.01 -2015.21  0.48 0.48  896008984
    4   522.30 -1210.33    7.25   522.19  0.11 -1210.40  0.08 0.13  896009152
    5 -1600.58  1713.03    8.62 -1600.64  0.06  1713.62 -0.60 0.60  896012968
    6 -1020.53  1769.45    7.62 -1020.58  0.06  1769.72 -0.27 0.27  896014528
    7  1253.10 -2241.47    8.19  1253.31 -0.21 -2241.78  0.30 0.37  897717296
2024-08-12 09:05:45,242 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:05:45,257 Starting get_match_graph
2024-08-12 09:05:45,257 Getting matches from file
2024-08-12 09:05:47,144 Adding edges from 1022361 matching distance pairs
2024-08-12 09:05:55,846 Added total of 329178 nodes
2024-08-12 09:05:55,860 Getting all triangles from match graph
2024-08-12 09:05:57,721 Finding triangles that match stars pattern
2024-08-12 09:05:57,850 Checking clique [53346328, 52693088, 52693160, 53231304, 52693840, 53230616, 53226584, 52697072]
2024-08-12 09:05:57,865 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 7.08695e+07
Final fit statistic   = 1.66514 at function evaluation 282
Data points           = 16
Degrees of freedom    = 14
Probability [Q-value] = 0.999973
Reduced statistic     = 0.118939
Change in statistic   = 7.08695e+07
   yagzag.dra     -2434.99    
   yagzag.ddec    -1711.44    
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 1.66514
Final fit statistic   = 1.12673 at function evaluation 338
Data points           = 16
Degrees of freedom    = 13
Probability [Q-value] = 0.999992
Reduced statistic     = 0.0866716
Change in statistic   = 0.538413
   yagzag.dra     -2435.11    
   yagzag.ddec    -1711.35    
   yagzag.droll   -196.575    
[256.19997397   3.49778023 163.47196349]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    0 -2125.95 -1244.88    8.62 -2126.16  0.21 -1244.46 -0.42 0.47   52693088
    1  -709.43  -902.35    9.25  -709.98  0.55  -902.67  0.32 0.64   52693840
    2  1267.95 -1026.45    9.25  1268.28 -0.33 -1026.64  0.19 0.38   53226584
    3  -394.53 -1129.73    6.12  -394.41 -0.11 -1129.58 -0.14 0.18   53230616
    4  1668.03   969.08    8.69  1668.09 -0.07   969.08 -0.00 0.07   52697072
    5  -569.65    52.85    7.50  -569.83  0.18    53.02 -0.17 0.25   52693160
    6   211.48 -1082.80    9.25   211.44  0.03 -1082.83  0.03 0.04   53231304
    7 -1846.33 -2334.70    8.19 -1845.86 -0.46 -2334.90  0.20 0.50   53346328
2024-08-12 09:05:59,748 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:05:59,766 Starting get_match_graph
2024-08-12 09:05:59,766 Getting matches from file
2024-08-12 09:06:00,785 Adding edges from 405391 matching distance pairs
2024-08-12 09:06:01,745 Added total of 79443 nodes
2024-08-12 09:06:01,750 Getting all triangles from match graph
2024-08-12 09:06:01,965 Finding triangles that match stars pattern
2024-08-12 09:06:01,969 Checking clique [671761568, 671222088, 671224352, 671226160, 671763744]
2024-08-12 09:06:01,970 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 3.46476e+07
Final fit statistic   = 2.06765 at function evaluation 254
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.978867
Reduced statistic     = 0.258456
Change in statistic   = 3.46476e+07
   yagzag.dra     342.291     
   yagzag.ddec    2609.91     
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 2.06765
Final fit statistic   = 2.05493 at function evaluation 339
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.956738
Reduced statistic     = 0.293561
Change in statistic   = 0.0127181
   yagzag.dra     342.293     
   yagzag.ddec    2609.89     
   yagzag.droll   -231.005    
[280.345703    -4.93268694 129.00403478]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    3  1984.48 -2250.93    8.94  1985.06 -0.59 -2251.03  0.11 0.60  671222088
    4  1554.38  -575.00    6.81  1554.75 -0.37  -575.20  0.20 0.42  671224352
    5 -1812.30  1908.05    8.25 -1813.08  0.78  1908.35 -0.30 0.83  671761568
    6  2397.53  2242.65    6.94  2397.67 -0.15  2242.07  0.58 0.60  671226160
    7 -1688.05  2347.68    7.50 -1688.38  0.33  2348.27 -0.59 0.68  671763744
2024-08-12 09:06:03,132 Using AGASC pairs file /proj/sot/ska3/flight/data/find_attitude/distances.h5
2024-08-12 09:06:03,147 Starting get_match_graph
2024-08-12 09:06:03,147 Getting matches from file
2024-08-12 09:06:04,115 Adding edges from 591220 matching distance pairs
2024-08-12 09:06:07,453 Added total of 155523 nodes
2024-08-12 09:06:07,460 Getting all triangles from match graph
2024-08-12 09:06:08,015 Finding triangles that match stars pattern
2024-08-12 09:06:08,026 Checking clique [1165388184, 1165367920, 1167076088, 1167077048, 1165375192]
2024-08-12 09:06:08,028 Done with graph matching
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 3.45305e+06
Final fit statistic   = 0.717094 at function evaluation 247
Data points           = 10
Degrees of freedom    = 8
Probability [Q-value] = 0.999482
Reduced statistic     = 0.0896367
Change in statistic   = 3.45305e+06
   yagzag.dra     789.701     
   yagzag.ddec    258.864     
Dataset               = 1
Method                = neldermead
Statistic             = chi2
Initial fit statistic = 0.717094
Final fit statistic   = 0.596209 at function evaluation 363
Data points           = 10
Degrees of freedom    = 7
Probability [Q-value] = 0.999012
Reduced statistic     = 0.0851728
Change in statistic   = 0.120885
   yagzag.dra     789.66      
   yagzag.ddec    258.851     
   yagzag.droll   179.526     
[ 85.45926357 -66.96891392 180.04231941]
slots   YAG      ZAG    MAG_ACA  m_yag     dy   m_zag     dz   dr  m_agasc_id
----- -------- -------- ------- -------- ----- -------- ----- ---- ----------
    3  1760.38 -1454.88    6.69  1760.65 -0.28 -1455.29  0.41 0.50 1165367920
    4   787.33   265.12    8.50   787.49 -0.17   265.37 -0.25 0.30 1165388184
    5 -1915.98  -947.65    8.88 -1916.11  0.13  -947.36 -0.29 0.32 1167076088
    6 -1703.95  1664.30    9.06 -1704.33  0.38  1664.21  0.09 0.39 1167077048
    7  1975.80 -2423.08    7.50  1975.87 -0.07 -2423.12  0.04 0.08 1165375192
PASSED

=========================================== 6 passed in 147.97s (0:02:27) ===========================================
ska3-jeanconn-fido> git rev-parse HEAD
07a9307cbc9acce234ba4dcf25289aa3ff403030

Functional tests

New notebook test-find-attitude.ipynb does significant functional testing.

@taldcroft taldcroft changed the title WIP: Normal sun attitude constraints WIP: Normal sun and attitude constraints Jul 18, 2024
@taldcroft taldcroft force-pushed the normal-sun-attitude-constraints branch from 410ce78 to c8891ec Compare July 18, 2024 14:43
@taldcroft taldcroft deleted the branch master July 26, 2024 23:16
@taldcroft taldcroft closed this Jul 26, 2024
@taldcroft taldcroft reopened this Jul 27, 2024
@taldcroft taldcroft changed the base branch from agasc1p8 to master July 27, 2024 10:08
@taldcroft taldcroft force-pushed the normal-sun-attitude-constraints branch from 07a9307 to 46db7b3 Compare July 28, 2024 10:12
@taldcroft taldcroft changed the title WIP: Normal sun and attitude constraints Add pitch, attitude constraints and 2- and 3-star solutions Aug 7, 2024
@taldcroft taldcroft marked this pull request as ready for review August 7, 2024 15:38
@taldcroft taldcroft requested review from javierggt and jeanconn August 7, 2024 15:38
@jeanconn
Copy link
Contributor

jeanconn commented Aug 8, 2024

Does "coming up with a solution" to 2-star inputs count as an interface change? I only mention in that we probably want to update the web app to have some reasonable warning on that.

@taldcroft
Copy link
Member Author

Does "coming up with a solution" to 2-star inputs count as an interface change? I only mention in that we probably want to update the web app to have some reasonable warning on that.

I would say the web app won't support 2-star inputs. I'm somewhat leaning to having the web app continue to only support the no-constraints interface. Instead we would just run a template jupyter notebook that makes it easy to provide the inputs and evaluate the results.

@jeanconn
Copy link
Contributor

jeanconn commented Aug 12, 2024

Looks like the find_attitude code and the demo/test notebook use a dev ska_helpers that doesn't appear to have been checked in.

@taldcroft
Copy link
Member Author

Looks like the find_attitude code and the demo/test notebook use a dev ska_helpers that doesn't appear to have been checked in.

I have updated the description.

@jeanconn
Copy link
Contributor

The description should also be updated to note that this requires the new distances file with the healpix index, so that's a post-promotion install activity.

@jeanconn
Copy link
Contributor

And as an enhancement request - I think catalog mags for the solution stars should be in the solution "summary" to save the user doing that lookup. Naively it also seems like that could get rolled into some kind of goodness-of-solution metric, but I didn't think about that too much except wonder about it in passing.

Maximum off-nominal roll angle in degrees (default=2.0).
min_stars : int or None
Minimum number of stars required for a valid solution. Default is None, meaning
the minimum number of stars is determined from the constraints. Key use case for
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding "Default is None, meaning the minimum number of stars is determined from the constraints." - I don't understand what this means. This is the constraint so how is the minimum number of stars determined from the constraints?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest a reference to see get_min_stars() .

Copy link
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

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

This looks good to me. My only non-required comments are docs improvements. As noted it would be good to reference get_min_stars in the Constraints min_stars area. It would also be helpful to mention someplace for our future selves that the distance pairs file has one fixed epoch, so the date of the constraint doesn't change that, but the constraint date is used in the other attitude constraints (pitch, roll) and for the reporting of the residuals on the stars pairs that were pulled out as being the closest ones. And given how easy it is to make a new-epoch distances.h5 file (even if it doesn't make much difference), perhaps that update should be something that just gets done on a regular basis.

@taldcroft
Copy link
Member Author

Thanks for the review, I'll address your doc requests.

@taldcroft taldcroft merged commit 3da891f into master Aug 19, 2024
2 checks passed
@taldcroft taldcroft deleted the normal-sun-attitude-constraints branch August 19, 2024 11:07
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.

2 participants