Closed javierggt closed 2 years ago
It looks like the problem is in the web front end (both current production and the new version). Somehow the tolerance parameter is not being set to the user-supplied value. When I do this case "by hand" with a tolerance of 3.0 arcsec it finds an attitude solution:
In [1]: txt = """slot yag zag mag
...: 0 -768.95 -1747.60 7.0
...: 1 2145.03 162.55 7.1
...: 2 -1822.70 156.53 7.1
...: 3 797.70 -2078.80 7.1
...: 4 2078.75 -73.90 9.3
...: 5 -2050.45 -963.75 8.6
...: 6 -1922.23 -400.10 9.4
...: 7 -589.58 1532.65 6.7
...: """
In [2]: from find_attitude.find_attitude import *
In [4]: stars = get_stars_from_text(txt)
In [5]: solutions = find_attitude_solutions(stars, tolerance=3.0)
2022-07-26 18:29:37,977 Using AGASC pairs file /Users/aldcroft/ska/data/find_attitude/distances.h5
2022-07-26 18:29:37,986 Starting get_match_graph
2022-07-26 18:29:37,986 Getting matches from file
2022-07-26 18:29:39,307 Adding edges from 1105350 matching distance pairs
2022-07-26 18:29:48,407 Added total of 359426 nodes
2022-07-26 18:29:48,415 Getting all triangles from match graph
2022-07-26 18:29:50,677 Finding triangles that match stars pattern
2022-07-26 18:29:50,861 Checking clique [452728128, 452729840, 452731944, 452731232]
2022-07-26 18:29:50,861
2022-07-26 18:29:50,865 Done with graph matching
Dataset = 1
Method = neldermead
Statistic = chi2
Initial fit statistic = 1.98127e+07
Final fit statistic = 5.50698 at function evaluation 259
Data points = 8
Degrees of freedom = 6
Probability [Q-value] = 0.480613
Reduced statistic = 0.91783
Change in statistic = 1.98127e+07
yagzag.dra -807.106
yagzag.ddec 2074.04
Dataset = 1
Method = neldermead
Statistic = chi2
Initial fit statistic = 5.50698
Final fit statistic = 5.20658 at function evaluation 314
Data points = 8
Degrees of freedom = 5
Probability [Q-value] = 0.391193
Reduced statistic = 1.04132
Change in statistic = 0.300399
yagzag.dra -807.142
yagzag.ddec 2074.03
yagzag.droll 0.260508
Well, that's good, because it means I can fix it right away.
<form action="/find_attitude/" method="post">
<div class="row">
<div class="col">
<label for="distance_tolerance">Distance tolerance (arcsec) </label>
<input type="text" class="form-control" id="distance_tolerance" name="tolerance" value="{{distance_tolerance}}">
</div>
</div>
I think that it should be name="distance_tolerance"
since the get
asks for that and not tolerance
.
I'm not sure what, if anything, the id
tag is doing here.
FIxed already.
Nice. I tried testing on web-kadi-test and it still fails. Is the fixed deployed on kadi-test?
It is not on kadi-test because I know it is going to work, so I figured I could save myself an iteration. I tested it in my local development setup.
We definitely want to get this in to test for the flight promotion and give Eric a chance to re-do his failing test and sign off that it is passing now. I'm really excited that we found and can easily fix a bug like this now.
I thought of merging this, modify web-kadi env file, install in kadi-test (with the patch release), then tell Eric, and so on.
If I install now on kadi-test, then I have to install again after I make the patch release, but I KNOW it is going to work.
I installed the fix in kadi-test
And I have seen with my own eyes now that it does work, thanks! :tada:
Find-attitude fails in a test by PCAD, while SAUSAGE manages to find an attitude.