Find favorable amsat pass between two locations.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

135 lines
3.8 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import ephem\n",
"\n",
"philly = ephem.Observer()\n",
"philly.lon, philly.lat = '-75.16961', '39.92435'\n",
"\n",
"portland = ephem.Observer()\n",
"portland.lon, portland.lat = '-122.68092', '45.50901'\n",
"\n",
"fo_29 = ephem.readtle(\n",
" \"JAS-2 (FO-29)\",\n",
" \"1 24278U 96046B 19132.42991715 .00000011 00000-0 48833-4 0 9994\",\n",
" \"2 24278 98.5319 290.9039 0349934 336.8182 21.7496 13.53090691122769\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"philly.date = '2019/5/12'\n",
"portland.date = '2019/5/12'\n",
"\n",
"def next_n_passses(location, sat, n):\n",
" passes = []\n",
" for i in range(n):\n",
" info = location.next_pass(sat)\n",
" passes.append((info[0], info[4], info[3]))\n",
" location.date = info[4] + 0.01\n",
" return passes\n",
"\n",
"philly_passes = next_n_passses(philly, fo_29, 20)\n",
"portland_passes = next_n_passses(portland, fo_29, 20)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"overlap!\n",
"2019/5/12 00:10:59 2019/5/12 00:23:07\n",
"2019/5/12 00:09:52 2019/5/12 00:30:50\n",
"0.9643829464912415 6:18:04.0 61:33:22.3\n",
"overlap!\n",
"2019/5/12 08:35:52 2019/5/12 08:53:00\n",
"2019/5/12 08:45:29 2019/5/12 08:55:52\n",
"1.2769035622477531 78:39:18.9 5:29:38.7\n",
"overlap!\n",
"2019/5/12 10:24:19 2019/5/12 10:36:32\n",
"2019/5/12 10:25:41 2019/5/12 10:42:03\n",
"0.3876809626817703 8:48:42.3 31:01:27.2\n",
"overlap!\n",
"2019/5/12 21:28:51 2019/5/12 21:49:59\n",
"2019/5/12 21:34:01 2019/5/12 21:40:30\n",
"1.4334367364645004 83:18:54.0 1:11:06.4\n",
"overlap!\n",
"2019/5/12 23:14:45 2019/5/12 23:32:03\n",
"2019/5/12 23:15:04 2019/5/12 23:34:39\n",
"0.17535218596458435 18:16:17.0 28:19:05.9\n",
"overlap!\n",
"2019/5/13 07:41:14 2019/5/13 07:57:51\n",
"2019/5/13 07:55:31 2019/5/13 07:59:13\n",
"0.6650917669758201 38:36:50.8 0:30:25.8\n",
"overlap!\n",
"2019/5/13 09:26:37 2019/5/13 09:42:48\n",
"2019/5/13 09:32:31 2019/5/13 09:46:39\n",
"0.2721569836139679 29:40:06.1 14:04:29.7\n",
"overlap!\n",
"2019/5/13 22:19:08 2019/5/13 22:39:15\n",
"2019/5/13 22:20:55 2019/5/13 22:36:46\n",
"0.5122278779745102 40:32:54.0 11:11:59.4\n",
"overlap!\n",
"2019/5/14 00:05:49 2019/5/14 00:18:37\n",
"2019/5/14 00:04:52 2019/5/14 00:25:53\n",
"0.8954902663826942 7:07:52.2 58:26:20.3\n",
"9\n"
]
}
],
"source": [
"overlap_count = 0\n",
"for o_rise, o_set, o_max in philly_passes:\n",
" for t_rise, t_set, t_max in portland_passes:\n",
" if t_rise < o_set and t_set > o_rise:\n",
" overlap_count += 1\n",
" print(\"overlap!\")\n",
" print(o_rise, o_set)\n",
" print(t_rise, t_set)\n",
" print(abs(o_max - t_max), o_max, t_max)\n",
"\n",
"print(overlap_count)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}