Break out jupyter cells, now that it is possible
parent
6e73e1d75b
commit
1d33022187
|
@ -193,27 +193,90 @@
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
" pix_catalog = generate_star_catalog(fname)\n",
|
" pix_catalog = generate_star_catalog(fname)"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" print(colored(f\"Computing astrometric calibration for {fname}\", \"yellow\"))\n",
|
" print(colored(f\"Computing astrometric calibration for {fname}\", \"yellow\"))\n",
|
||||||
" solved = generate_reference_with_anet(fname, \"\", calfname)\n",
|
" solved = generate_reference_with_anet(fname, \"\", calfname)"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Generate star catalog\n",
|
" # Generate star catalog\n",
|
||||||
" pix_catalog = pixel_catalog(f\"{fname}.cat\")\n",
|
" pix_catalog = pixel_catalog(f\"{fname}.cat\")"
|
||||||
" \n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Calibrate from reference\n",
|
" # Calibrate from reference\n",
|
||||||
" calibrate_from_reference(fname, calfname, pix_catalog)\n",
|
" calibrate_from_reference(fname, calfname, pix_catalog)"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Store calibration\n",
|
" # Store calibration\n",
|
||||||
" store_calibration(pix_catalog, f\"{fname}.cal\")\n",
|
" store_calibration(pix_catalog, f\"{fname}.cal\")"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Read Fourframe\n",
|
" # Read Fourframe\n",
|
||||||
" ff = FourFrame(fname)\n",
|
" ff = FourFrame(fname)"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Stars available and used\n",
|
" # Stars available and used\n",
|
||||||
" nused = np.sum(pix_catalog.flag == 1)\n",
|
" nused = np.sum(pix_catalog.flag == 1)\n",
|
||||||
" nstars = pix_catalog.nstars\n",
|
" nstars = pix_catalog.nstars"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Write output\n",
|
" # Write output\n",
|
||||||
" screenoutput = \"%s %10.6f %10.6f %4d/%4d %5.1f %5.1f %6.2f +- %6.2f\" % (\n",
|
" screenoutput = \"%s %10.6f %10.6f %4d/%4d %5.1f %5.1f %6.2f +- %6.2f\" % (\n",
|
||||||
" os.path.basename(ff.fname), ff.crval[0], ff.crval[1], nused, nstars,\n",
|
" os.path.basename(ff.fname), ff.crval[0], ff.crval[1], nused, nstars,\n",
|
||||||
|
@ -225,32 +288,77 @@
|
||||||
"\n",
|
"\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" color = \"red\"\n",
|
" color = \"red\"\n",
|
||||||
" print(colored(screenoutput, color))\n",
|
" print(colored(screenoutput, color))"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Generate predictions\n",
|
" # Generate predictions\n",
|
||||||
" predictions = ff.generate_satellite_predictions(cfg)\n",
|
" predictions = ff.generate_satellite_predictions(cfg)"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Find tracks\n",
|
" # Find tracks\n",
|
||||||
" if is_calibrated(ff):\n",
|
" if is_calibrated(ff):\n",
|
||||||
" tracks = ff.find_tracks_by_hough3d(cfg)\n",
|
" tracks = ff.find_tracks_by_hough3d(cfg)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" tracks = []\n",
|
" tracks = []"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Identify tracks\n",
|
" # Identify tracks\n",
|
||||||
" satno = 90000\n",
|
" satno = 90000\n",
|
||||||
" for t in tracks:\n",
|
" for t in tracks:\n",
|
||||||
" is_identified = t.identify(predictions, satno, \"22 500A\", None, cfg, abbrevs, tlefiles)\n",
|
" is_identified = t.identify(predictions, satno, \"22 500A\", None, cfg, abbrevs, tlefiles)\n",
|
||||||
" if not is_identified:\n",
|
" if not is_identified:\n",
|
||||||
" satno += 1\n",
|
" satno += 1"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Format observations\n",
|
" # Format observations\n",
|
||||||
" obs = []\n",
|
" obs = []\n",
|
||||||
" for t in tracks:\n",
|
" for t in tracks:\n",
|
||||||
" # Add to observation\n",
|
" # Add to observation\n",
|
||||||
" obs.append(Observation(ff, t.tmid, t.x0, t.y0, ff.site_id,\n",
|
" obs.append(Observation(ff, t.tmid, t.x0, t.y0, ff.site_id,\n",
|
||||||
" t.satno, t.cospar, t.catalogname))\n",
|
" t.satno, t.cospar, t.catalogname))"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Write observations\n",
|
" # Write observations\n",
|
||||||
" for o in obs:\n",
|
" for o in obs:\n",
|
||||||
" iod_line = o.to_iod_line()\n",
|
" iod_line = o.to_iod_line()\n",
|
||||||
|
@ -269,12 +377,30 @@
|
||||||
" elif o.catalogname == \"unid\":\n",
|
" elif o.catalogname == \"unid\":\n",
|
||||||
" color = \"magenta\"\n",
|
" color = \"magenta\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
" print(colored(iod_line, color))\n",
|
" print(colored(iod_line, color))"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # Generate plots\n",
|
" # Generate plots\n",
|
||||||
" # PNG image without lines overlaid\n",
|
" # PNG image without lines overlaid\n",
|
||||||
" ff.diagnostic_plot(predictions, None, None, cfg)\n",
|
" ff.diagnostic_plot(predictions, None, None, cfg)"
|
||||||
"\n",
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
" # PNG image for each track found\n",
|
" # PNG image for each track found\n",
|
||||||
" for track, o in zip(tracks, obs):\n",
|
" for track, o in zip(tracks, obs):\n",
|
||||||
" ff.diagnostic_plot(predictions, track, o, cfg)"
|
" ff.diagnostic_plot(predictions, track, o, cfg)"
|
||||||
|
|
Loading…
Reference in New Issue