Skip to content

Commit 70f53d0

Browse files
committed
minor tweaks
1 parent d362c17 commit 70f53d0

File tree

1 file changed

+14
-31
lines changed

1 file changed

+14
-31
lines changed

tutorials/astropy-coordinates/3-Coordinates-Velocities.ipynb

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"import matplotlib.pyplot as plt\n",
5959
"%matplotlib inline\n",
6060
"import numpy as np\n",
61-
"!pip install \"astroquery\"\n",
6261
"\n",
6362
"from astropy import units as u\n",
6463
"from astropy.coordinates import SkyCoord, Distance, Galactic\n",
@@ -96,22 +95,12 @@
9695
"outputs": [],
9796
"source": [
9897
"SkyCoord(\n",
99-
" ra=10*u.deg, \n",
98+
" ra=10*u.deg,\n",
10099
" dec=20*u.deg,\n",
101100
" pm_ra_cosdec=1*u.mas/u.yr,\n",
102101
" pm_dec=2*u.mas/u.yr)"
103102
]
104103
},
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-
},
115104
{
116105
"cell_type": "markdown",
117106
"metadata": {
@@ -132,7 +121,7 @@
132121
"outputs": [],
133122
"source": [
134123
"SkyCoord(\n",
135-
" ra=np.linspace(0, 10, 5)*u.deg, \n",
124+
" ra=np.linspace(0, 10, 5)*u.deg,\n",
136125
" dec=np.linspace(5, 20, 5)*u.deg,\n",
137126
" pm_ra_cosdec=np.linspace(-5, 5, 5)*u.mas/u.yr,\n",
138127
" pm_dec=np.linspace(-5, 5, 5)*u.mas/u.yr)"
@@ -158,7 +147,7 @@
158147
"outputs": [],
159148
"source": [
160149
"velocity_coord = SkyCoord(\n",
161-
" ra=10*u.deg, \n",
150+
" ra=10*u.deg,\n",
162151
" dec=20*u.deg,\n",
163152
" pm_ra_cosdec=1*u.mas/u.yr,\n",
164153
" pm_dec=2*u.mas/u.yr,\n",
@@ -272,7 +261,7 @@
272261
"# This cell will NOT work (you will receive an ConvertError warning) - this is expected!\n",
273262
"\n",
274263
"test_coord_1 = SkyCoord(\n",
275-
" ra=10*u.deg, \n",
264+
" ra=10*u.deg,\n",
276265
" dec=20*u.deg,\n",
277266
" pm_ra_cosdec=1*u.mas/u.yr,\n",
278267
" pm_dec=2*u.mas/u.yr)\n",
@@ -298,7 +287,7 @@
298287
"outputs": [],
299288
"source": [
300289
"test_coord_2 = SkyCoord(\n",
301-
" ra=10*u.deg, \n",
290+
" ra=10*u.deg,\n",
302291
" dec=20*u.deg,\n",
303292
" distance=10*u.pc,\n",
304293
" pm_ra_cosdec=1*u.mas/u.yr,\n",
@@ -332,7 +321,7 @@
332321
"outputs": [],
333322
"source": [
334323
"# 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",
336325
" radius=1*u.arcmin)"
337326
]
338327
},
@@ -350,9 +339,9 @@
350339
"outputs": [],
351340
"source": [
352341
"# the .read() below produces some warnings that we can safely ignore\n",
353-
"with warnings.catch_warnings(): \n",
342+
"with warnings.catch_warnings():\n",
354343
" warnings.simplefilter('ignore', UserWarning)\n",
355-
" \n",
344+
"\n",
356345
" gaia_tbl = QTable.read('HD_219829_query_results.ecsv')"
357346
]
358347
},
@@ -397,7 +386,7 @@
397386
"outputs": [],
398387
"source": [
399388
"hd219829_coord = SkyCoord(\n",
400-
" ra=hd219829_row['ra'], \n",
389+
" ra=hd219829_row['ra'],\n",
401390
" dec=hd219829_row['dec'],\n",
402391
" distance=Distance(parallax=hd219829_row['parallax']),\n",
403392
" pm_ra_cosdec=hd219829_row['pmra'],\n",
@@ -466,7 +455,7 @@
466455
"hdu = fits.open(dss_cutout_filename)[0]\n",
467456
"wcs = WCS(hdu.header)\n",
468457
"\n",
469-
"fig, ax = plt.subplots(1, 1, figsize=(8, 8), \n",
458+
"fig, ax = plt.subplots(1, 1, figsize=(8, 8),\n",
470459
" subplot_kw=dict(projection=wcs))\n",
471460
"ax.imshow(hdu.data, origin='lower', cmap='Greys_r')\n",
472461
"ax.set_xlabel('RA')\n",
@@ -520,9 +509,9 @@
520509
"outputs": [],
521510
"source": [
522511
"# this produces some warnings that we can safely ignore\n",
523-
"with warnings.catch_warnings(): \n",
512+
"with warnings.catch_warnings():\n",
524513
" warnings.simplefilter('ignore', UserWarning)\n",
525-
" \n",
514+
"\n",
526515
" hd219829_coord_1950 = hd219829_coord.apply_space_motion(\n",
527516
" new_obstime=Time('J1950'))"
528517
]
@@ -544,7 +533,7 @@
544533
},
545534
"outputs": [],
546535
"source": [
547-
"fig, ax = plt.subplots(1, 1, figsize=(8, 8), \n",
536+
"fig, ax = plt.subplots(1, 1, figsize=(8, 8),\n",
548537
" subplot_kw=dict(projection=wcs))\n",
549538
"ax.imshow(hdu.data, origin='lower', cmap='Greys_r')\n",
550539
"ax.set_xlabel('RA')\n",
@@ -616,11 +605,6 @@
616605
"name": "3-Coordinates-Velocities.ipynb",
617606
"provenance": []
618607
},
619-
"kernelspec": {
620-
"display_name": "Python 3 (ipykernel)",
621-
"language": "python",
622-
"name": "python3"
623-
},
624608
"language_info": {
625609
"codemirror_mode": {
626610
"name": "ipython",
@@ -630,8 +614,7 @@
630614
"mimetype": "text/x-python",
631615
"name": "python",
632616
"nbconvert_exporter": "python",
633-
"pygments_lexer": "ipython3",
634-
"version": "3.9.12"
617+
"pygments_lexer": "ipython3"
635618
}
636619
},
637620
"nbformat": 4,

0 commit comments

Comments
 (0)