|
58 | 58 | "import matplotlib.pyplot as plt\n", |
59 | 59 | "%matplotlib inline\n", |
60 | 60 | "import numpy as np\n", |
61 | | - "!pip install \"astroquery\"\n", |
62 | 61 | "\n", |
63 | 62 | "from astropy import units as u\n", |
64 | 63 | "from astropy.coordinates import SkyCoord, Distance, Galactic\n", |
|
96 | 95 | "outputs": [], |
97 | 96 | "source": [ |
98 | 97 | "SkyCoord(\n", |
99 | | - " ra=10*u.deg, \n", |
| 98 | + " ra=10*u.deg,\n", |
100 | 99 | " dec=20*u.deg,\n", |
101 | 100 | " pm_ra_cosdec=1*u.mas/u.yr,\n", |
102 | 101 | " pm_dec=2*u.mas/u.yr)" |
103 | 102 | ] |
104 | 103 | }, |
105 | | - { |
106 | | - "cell_type": "markdown", |
107 | | - "metadata": { |
108 | | - "id": "v6EeE4KsfSpq" |
109 | | - }, |
110 | | - "source": [ |
111 | | - "**Thought Questions:**\n", |
112 | | - "What value did we put in for our right ascension? What about our declination? What units are they in?" |
113 | | - ] |
114 | | - }, |
115 | 104 | { |
116 | 105 | "cell_type": "markdown", |
117 | 106 | "metadata": { |
|
132 | 121 | "outputs": [], |
133 | 122 | "source": [ |
134 | 123 | "SkyCoord(\n", |
135 | | - " ra=np.linspace(0, 10, 5)*u.deg, \n", |
| 124 | + " ra=np.linspace(0, 10, 5)*u.deg,\n", |
136 | 125 | " dec=np.linspace(5, 20, 5)*u.deg,\n", |
137 | 126 | " pm_ra_cosdec=np.linspace(-5, 5, 5)*u.mas/u.yr,\n", |
138 | 127 | " pm_dec=np.linspace(-5, 5, 5)*u.mas/u.yr)" |
|
158 | 147 | "outputs": [], |
159 | 148 | "source": [ |
160 | 149 | "velocity_coord = SkyCoord(\n", |
161 | | - " ra=10*u.deg, \n", |
| 150 | + " ra=10*u.deg,\n", |
162 | 151 | " dec=20*u.deg,\n", |
163 | 152 | " pm_ra_cosdec=1*u.mas/u.yr,\n", |
164 | 153 | " pm_dec=2*u.mas/u.yr,\n", |
|
272 | 261 | "# This cell will NOT work (you will receive an ConvertError warning) - this is expected!\n", |
273 | 262 | "\n", |
274 | 263 | "test_coord_1 = SkyCoord(\n", |
275 | | - " ra=10*u.deg, \n", |
| 264 | + " ra=10*u.deg,\n", |
276 | 265 | " dec=20*u.deg,\n", |
277 | 266 | " pm_ra_cosdec=1*u.mas/u.yr,\n", |
278 | 267 | " pm_dec=2*u.mas/u.yr)\n", |
|
298 | 287 | "outputs": [], |
299 | 288 | "source": [ |
300 | 289 | "test_coord_2 = SkyCoord(\n", |
301 | | - " ra=10*u.deg, \n", |
| 290 | + " ra=10*u.deg,\n", |
302 | 291 | " dec=20*u.deg,\n", |
303 | 292 | " distance=10*u.pc,\n", |
304 | 293 | " pm_ra_cosdec=1*u.mas/u.yr,\n", |
|
332 | 321 | "outputs": [], |
333 | 322 | "source": [ |
334 | 323 | "# Skip this cell if you are not connected to the internet\n", |
335 | | - "gaia_tbl = Gaia.query_object(SkyCoord.from_name('HD 219829'), \n", |
| 324 | + "gaia_tbl = Gaia.query_object(SkyCoord.from_name('HD 219829'),\n", |
336 | 325 | " radius=1*u.arcmin)" |
337 | 326 | ] |
338 | 327 | }, |
|
350 | 339 | "outputs": [], |
351 | 340 | "source": [ |
352 | 341 | "# the .read() below produces some warnings that we can safely ignore\n", |
353 | | - "with warnings.catch_warnings(): \n", |
| 342 | + "with warnings.catch_warnings():\n", |
354 | 343 | " warnings.simplefilter('ignore', UserWarning)\n", |
355 | | - " \n", |
| 344 | + "\n", |
356 | 345 | " gaia_tbl = QTable.read('HD_219829_query_results.ecsv')" |
357 | 346 | ] |
358 | 347 | }, |
|
397 | 386 | "outputs": [], |
398 | 387 | "source": [ |
399 | 388 | "hd219829_coord = SkyCoord(\n", |
400 | | - " ra=hd219829_row['ra'], \n", |
| 389 | + " ra=hd219829_row['ra'],\n", |
401 | 390 | " dec=hd219829_row['dec'],\n", |
402 | 391 | " distance=Distance(parallax=hd219829_row['parallax']),\n", |
403 | 392 | " pm_ra_cosdec=hd219829_row['pmra'],\n", |
|
466 | 455 | "hdu = fits.open(dss_cutout_filename)[0]\n", |
467 | 456 | "wcs = WCS(hdu.header)\n", |
468 | 457 | "\n", |
469 | | - "fig, ax = plt.subplots(1, 1, figsize=(8, 8), \n", |
| 458 | + "fig, ax = plt.subplots(1, 1, figsize=(8, 8),\n", |
470 | 459 | " subplot_kw=dict(projection=wcs))\n", |
471 | 460 | "ax.imshow(hdu.data, origin='lower', cmap='Greys_r')\n", |
472 | 461 | "ax.set_xlabel('RA')\n", |
|
520 | 509 | "outputs": [], |
521 | 510 | "source": [ |
522 | 511 | "# this produces some warnings that we can safely ignore\n", |
523 | | - "with warnings.catch_warnings(): \n", |
| 512 | + "with warnings.catch_warnings():\n", |
524 | 513 | " warnings.simplefilter('ignore', UserWarning)\n", |
525 | | - " \n", |
| 514 | + "\n", |
526 | 515 | " hd219829_coord_1950 = hd219829_coord.apply_space_motion(\n", |
527 | 516 | " new_obstime=Time('J1950'))" |
528 | 517 | ] |
|
544 | 533 | }, |
545 | 534 | "outputs": [], |
546 | 535 | "source": [ |
547 | | - "fig, ax = plt.subplots(1, 1, figsize=(8, 8), \n", |
| 536 | + "fig, ax = plt.subplots(1, 1, figsize=(8, 8),\n", |
548 | 537 | " subplot_kw=dict(projection=wcs))\n", |
549 | 538 | "ax.imshow(hdu.data, origin='lower', cmap='Greys_r')\n", |
550 | 539 | "ax.set_xlabel('RA')\n", |
|
616 | 605 | "name": "3-Coordinates-Velocities.ipynb", |
617 | 606 | "provenance": [] |
618 | 607 | }, |
619 | | - "kernelspec": { |
620 | | - "display_name": "Python 3 (ipykernel)", |
621 | | - "language": "python", |
622 | | - "name": "python3" |
623 | | - }, |
624 | 608 | "language_info": { |
625 | 609 | "codemirror_mode": { |
626 | 610 | "name": "ipython", |
|
630 | 614 | "mimetype": "text/x-python", |
631 | 615 | "name": "python", |
632 | 616 | "nbconvert_exporter": "python", |
633 | | - "pygments_lexer": "ipython3", |
634 | | - "version": "3.9.12" |
| 617 | + "pygments_lexer": "ipython3" |
635 | 618 | } |
636 | 619 | }, |
637 | 620 | "nbformat": 4, |
|
0 commit comments