|
5 | 5 | "id": "ec28e7e2", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | | - "fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')fig.savefig(\"saved_pvdiagram.png\", bbox_inches='tight')# Extracting and Plotting Position-Velocity Diagrams\n", |
| 8 | + "# Extracting and Plotting Position-Velocity Diagrams\n", |
9 | 9 | "\n", |
10 | 10 | "## Authors\n", |
11 | 11 | "Adam Ginsburg, Eric Koch\n", |
|
132 | 132 | "source": [ |
133 | 133 | "ax = pl.subplot(111, projection=cube.wcs.celestial)\n", |
134 | 134 | "ax.imshow(cube[25].value)\n", |
135 | | - "path.show_on_axis(ax, spacing=1, color='r')" |
| 135 | + "path.show_on_axis(ax, spacing=1, color='r')\n", |
| 136 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 137 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")" |
136 | 138 | ] |
137 | 139 | }, |
138 | 140 | { |
|
251 | 253 | "path.show_on_axis(ax, spacing=1, color='r')\n", |
252 | 254 | "\n", |
253 | 255 | "ww = wcs.WCS(pvdiagram.header)\n", |
| 256 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 257 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")\n", |
254 | 258 | "\n", |
255 | 259 | "ax = pl.subplot(122, projection=ww)\n", |
256 | 260 | "im = ax.imshow(pvdiagram.data)\n", |
|
317 | 321 | "source": [ |
318 | 322 | "ax = pl.subplot(111, projection=cube.wcs.celestial)\n", |
319 | 323 | "ax.imshow(cube[25].value)\n", |
320 | | - "skypath.show_on_axis(ax, spacing=1, color='r')" |
| 324 | + "skypath.show_on_axis(ax, spacing=1, color='r')\n", |
| 325 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 326 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")" |
321 | 327 | ] |
322 | 328 | }, |
323 | 329 | { |
|
344 | 350 | "skypath.show_on_axis(ax, spacing=1, color='r')\n", |
345 | 351 | "\n", |
346 | 352 | "ww = wcs.WCS(pvdiagram2.header)\n", |
| 353 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 354 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")\n", |
347 | 355 | "\n", |
348 | 356 | "ax = pl.subplot(122, projection=ww)\n", |
349 | 357 | "im = ax.imshow(pvdiagram2.data)\n", |
|
378 | 386 | "skypath.show_on_axis(ax, spacing=1, color='r')\n", |
379 | 387 | "\n", |
380 | 388 | "ww = wcs.WCS(pvdiagram2.header)\n", |
| 389 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 390 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")\n", |
| 391 | + "\n", |
381 | 392 | "\n", |
382 | 393 | "ax = pl.subplot(122, projection=ww)\n", |
383 | 394 | "im = ax.imshow(pvdiagram2.data)\n", |
|
452 | 463 | " linewidth=0.75)\n", |
453 | 464 | "\n", |
454 | 465 | "ww = wcs.WCS(pvdiagram3.header)\n", |
| 466 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 467 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")\n", |
455 | 468 | "\n", |
456 | 469 | "ax = pl.subplot(122, projection=ww)\n", |
457 | 470 | "im = ax.imshow(pvdiagram3.data)\n", |
|
465 | 478 | "ax1 = ax.coords[1]\n", |
466 | 479 | "ax1.set_format_unit(u.km/u.s)\n", |
467 | 480 | "\n", |
| 481 | + "\n", |
468 | 482 | "ax.set_ylabel(\"Velocity [km/s]\")\n", |
469 | 483 | "ax.set_xlabel(\"Offset [arcmin]\")" |
470 | 484 | ] |
|
488 | 502 | "source": [ |
489 | 503 | "pvdiagram4 = extract_pv_slice(cube=cube, path=skypath2, spacing=5)\n", |
490 | 504 | "\n", |
491 | | - "pl.figure(figsize=(12,6))\n", |
| 505 | + "fig = pl.figure(figsize=(12,6))\n", |
492 | 506 | "ax = pl.subplot(121, projection=cube.wcs.celestial)\n", |
493 | 507 | "ax.imshow(mx)\n", |
494 | 508 | "skypath2.show_on_axis(ax, spacing=5,\n", |
495 | 509 | " edgecolor='w', linestyle=':',\n", |
496 | 510 | " linewidth=0.75)\n", |
497 | 511 | "\n", |
498 | 512 | "ww = wcs.WCS(pvdiagram4.header)\n", |
| 513 | + "ax.set_xlabel(f\"Right Ascension [{cube.wcs.wcs.radesys}]\")\n", |
| 514 | + "ax.set_ylabel(f\"Declination [{cube.wcs.wcs.radesys}]\")\n", |
499 | 515 | "\n", |
500 | 516 | "ax = pl.subplot(122, projection=ww)\n", |
501 | 517 | "im = ax.imshow(pvdiagram4.data)\n", |
|
554 | 570 | ], |
555 | 571 | "metadata": { |
556 | 572 | "kernelspec": { |
557 | | - "display_name": "Python 3", |
| 573 | + "display_name": "Python 3.9", |
558 | 574 | "language": "python", |
559 | | - "name": "python3" |
| 575 | + "name": "py39" |
560 | 576 | }, |
561 | 577 | "language_info": { |
562 | 578 | "codemirror_mode": { |
|
568 | 584 | "name": "python", |
569 | 585 | "nbconvert_exporter": "python", |
570 | 586 | "pygments_lexer": "ipython3", |
571 | | - "version": "3.7.3" |
| 587 | + "version": "3.9.6" |
572 | 588 | } |
573 | 589 | }, |
574 | 590 | "nbformat": 4, |
|
0 commit comments