Skip to content

Commit

Permalink
Cleaning up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dcajacob committed Dec 19, 2022
1 parent 88d92dc commit a27dcdb
Show file tree
Hide file tree
Showing 15 changed files with 1,164 additions and 3,862 deletions.
426 changes: 1 addition & 425 deletions TLEFit - COE - FD.ipynb

Large diffs are not rendered by default.

32 changes: 1 addition & 31 deletions TLEFit - COE - JAX.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@
"metadata": {},
"outputs": [],
"source": [
"#tle_filename = 'tles/boom.txt'\n",
"tle_filename = 'tles/TWOLINE.TXT'\n",
"tle_filename = 'tles/22335.txt'"
]
Expand Down Expand Up @@ -570,35 +569,6 @@
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 29,
"id": "subtle-spanking",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"failed_tles"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "copyrighted-economics",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -617,7 +587,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]"
},
"vscode": {
"interpreter": {
Expand Down
64 changes: 0 additions & 64 deletions TLEFit - EQN - FD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@
"metadata": {},
"outputs": [],
"source": [
"tle_filename = 'tles/boom.txt'\n",
"tle_filename = 'tles/TWOLINE.TXT'\n",
"# tle_filename = 'tles/cubesat.txt'\n",
"# tle_filename = 'tles/analyst.txt'\n",
"# tle_filename = 'tles/22335.txt'"
]
},
Expand Down Expand Up @@ -616,67 +613,6 @@
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 15,
"id": "060610fe-0a1f-477a-9151-a1fb4daaa9a0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 00005U 3 12.169 m 8.93e-09 m\n",
" 04632U 1 4.631 m 1.80e+00 m\n",
" 06251U 2 12.161 m 1.69e-04 m\n",
" 08195U 4 13.523 m 3.93e-08 m\n",
" 09880U 4 13.278 m 3.81e-07 m\n",
" 09998U 1 4.614 m 5.46e-01 m\n",
" 14128U 2 4.622 m 1.77e-02 m\n",
" 16925U 4 13.337 m 8.37e-02 m\n",
" 20413U 4 4.425 m 6.83e-02 m\n",
" 21897U 3 13.108 m 6.40e-05 m\n"
]
}
],
"source": [
"# Dunno about this, it hard-codes lambda and then tries really hard to win if it fails\n",
"\n",
"limit = 9#*1000000\n",
"failed_tles = []\n",
"\n",
"for idx, tle in enumerate(tles):\n",
"\n",
" line1 = tle[1]\n",
" line2 = tle[2]\n",
" satellite = EarthSatellite(line1, line2, tle[0], ts)\n",
" \n",
" try:\n",
"# iterations, sigma, sigmas, dxs, bs, b_epoch, b_new_epoch, b, P, A = test_tle_fit(satellite, central_diff=True)\n",
" iterations, sigma, sigmas, dxs, bs, b_epoch, b_new_epoch, b, P, A = test_tle_fit_normalized_equinoctial(satellite, central_diff=True, lamda=1)\n",
"\n",
" print(\"%24s %5d %9.3f m %10.2e m\" % (tle[0], iterations, np.sqrt(np.diag(P)[0]) * 1000, sigma * 1000))\n",
" except:\n",
"# close_sat = coarse_fit(satellite, debug=True)\n",
" for lamda in (1, 10, 100, 1000):\n",
" try:\n",
" iterations, sigma, sigmas, dxs, bs, b_epoch, b_new_epoch, b, P, A = test_tle_fit_normalized_equinoctial(satellite, central_diff=True, lamda=lamda)#, debug=True)\n",
" print(\"%24s %5d %9.3f m %10.2e m\" % (tle[0], iterations, np.sqrt(np.diag(P)[0]) * 1000, sigma * 1000))\n",
" except:\n",
" continue\n",
" else:\n",
" break\n",
" \n",
" print(\"%24s Failed\" % (tle[0]))\n",
" failed_tles.append(tle)\n",
" \n",
" pass\n",
" \n",
" if idx == limit:\n",
" break\n",
" "
]
}
],
"metadata": {
Expand Down
25 changes: 1 addition & 24 deletions TLEFit - EQN - GPS FD - GPS Sat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@
"metadata": {},
"outputs": [],
"source": [
"# launch_objects = json.loads(st.gp(object_name=op.like('~~GPS~~'), orderby='TLE_LINE1', format='json'))\n",
"launch_objects = json.loads(st.gp(mean_motion=op.inclusive_range(1.95, 2.05), orderby='TLE_LINE1', format='json'))"
]
},
Expand Down Expand Up @@ -2108,9 +2107,7 @@
" res_epoch = np.sqrt(res[-1])\n",
" res = np.sqrt(np.mean(res))\n",
"\n",
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))\n",
"\n",
" # print(f'{sat[\"TLE_LINE0\"][2:]} {solution_residuals(t_is, solve_sat, candidate_sat.model)}')"
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))"
]
},
{
Expand Down Expand Up @@ -2752,26 +2749,6 @@
"sat_epoch_datetime(ref_tle.model)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "5085ef0a-be34-463d-9def-88d7bef57e1e",
"metadata": {},
"outputs": [],
"source": [
"# iterations, aligned_solve_sat, elements_coe, sigma, sigmas, dxs, bs, lamdas, b_epoch, b_new_epoch, b, P, A = test_tle_fit_normalized_equinoctial(t, ephemeris, last_obs=last_obs, obs_stride=obs_stride, lamda=1e-3, rms_epsilon=0.0001, debug=False)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "22bcdf33-0ee9-4b65-a3bd-5b88c757dbd4",
"metadata": {},
"outputs": [],
"source": [
"# exporter.export_tle(aligned_solve_sat.model)"
]
},
{
"cell_type": "code",
"execution_count": 36,
Expand Down
4 changes: 1 addition & 3 deletions TLEFit - EQN - GPS FD - Icesat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,7 @@
" res_epoch = np.sqrt(res[-1])\n",
" res = np.sqrt(np.mean(res))\n",
"\n",
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))\n",
"\n",
" # print(f'{sat[\"TLE_LINE0\"][2:]} {solution_residuals(t_is, solve_sat, candidate_sat.model)}')"
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))"
]
},
{
Expand Down
25 changes: 1 addition & 24 deletions TLEFit - EQN - GPS JAX - GPS Sat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@
"metadata": {},
"outputs": [],
"source": [
"# launch_objects = json.loads(st.gp(object_name=op.like('~~GPS~~'), orderby='TLE_LINE1', format='json'))\n",
"launch_objects = json.loads(st.gp(mean_motion=op.inclusive_range(1.95, 2.05), orderby='TLE_LINE1', format='json'))"
]
},
Expand Down Expand Up @@ -2154,9 +2153,7 @@
" res_epoch = np.sqrt(res[-1])\n",
" res = np.sqrt(np.mean(res))\n",
"\n",
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))\n",
"\n",
" # print(f'{sat[\"TLE_LINE0\"][2:]} {solution_residuals(t_is, solve_sat, candidate_sat.model)}')"
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))"
]
},
{
Expand Down Expand Up @@ -2798,26 +2795,6 @@
"sat_epoch_datetime(ref_tle.model)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "5085ef0a-be34-463d-9def-88d7bef57e1e",
"metadata": {},
"outputs": [],
"source": [
"# iterations, aligned_solve_sat, elements_coe, sigma, sigmas, dxs, bs, lamdas, b_epoch, b_new_epoch, b, P, A = test_tle_fit_normalized_equinoctial(t, ephemeris, last_obs=last_obs, obs_stride=obs_stride, lamda=1e-3, rms_epsilon=0.0001, debug=False)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "22bcdf33-0ee9-4b65-a3bd-5b88c757dbd4",
"metadata": {},
"outputs": [],
"source": [
"# exporter.export_tle(aligned_solve_sat.model)"
]
},
{
"cell_type": "code",
"execution_count": 37,
Expand Down
28 changes: 1 addition & 27 deletions TLEFit - EQN - GPS JAX - Icesat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,7 @@
" res_epoch = np.sqrt(res[-1])\n",
" res = np.sqrt(np.mean(res))\n",
"\n",
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))\n",
"\n",
" # print(f'{sat[\"TLE_LINE0\"][2:]} {solution_residuals(t_is, solve_sat, candidate_sat.model)}')"
" candidates.append((sat[\"NORAD_CAT_ID\"], sat[\"OBJECT_ID\"], sat[\"EPOCH\"], sat[\"TLE_LINE0\"], sat[\"TLE_LINE1\"], sat[\"TLE_LINE2\"], res, res_epoch))"
]
},
{
Expand Down Expand Up @@ -1283,10 +1281,6 @@
"metadata": {},
"outputs": [],
"source": [
"# line1 = '1 27642U 03002A 03052.45515171 .00001751 00000-0 18097-3 0 9997'\n",
"# line2 = '2 27642 093.9975 201.0818 0002009 083.8037 276.3148 14.90459945 5876'\n",
"# ref_tle = EarthSatellite(line1, line2, 'ICESAT', ts)\n",
"\n",
"ref_tle = candidate_sat"
]
},
Expand All @@ -1311,26 +1305,6 @@
"sat_epoch_datetime(ref_tle.model)"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "5085ef0a-be34-463d-9def-88d7bef57e1e",
"metadata": {},
"outputs": [],
"source": [
"# iterations, aligned_solve_sat, elements_coe, sigma, sigmas, dxs, bs, lamdas, b_epoch, b_new_epoch, b, P, A = test_tle_fit_normalized_equinoctial(t, ephemeris, last_obs=last_obs, obs_stride=obs_stride, lamda=1e-3, rms_epsilon=0.0001, debug=False)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "22bcdf33-0ee9-4b65-a3bd-5b88c757dbd4",
"metadata": {},
"outputs": [],
"source": [
"# exporter.export_tle(aligned_solve_sat.model)"
]
},
{
"cell_type": "code",
"execution_count": 44,
Expand Down
Loading

0 comments on commit a27dcdb

Please sign in to comment.