Skip to content

Commit

Permalink
Merge pull request #505 from adrn/nov-fixes
Browse files Browse the repository at this point in the history
Misc. fixes for astropy 5.0 and new matplotlib
  • Loading branch information
adrn authored Nov 23, 2021
2 parents 18b4801 + c2484e2 commit f8364fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
6 changes: 3 additions & 3 deletions tutorials/FITS-cubes/FITS-cubes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
"\n",
"# Display the moment map image\n",
"im = ax.imshow(herschel_data_nonans, cmap='viridis', \n",
" norm=LogNorm(), vmin=2, vmax=50)\n",
" norm=LogNorm(vmin=2, vmax=50))\n",
"# ax.invert_yaxis() # Flips the Y axis \n",
"\n",
"# Add axes labels\n",
Expand Down Expand Up @@ -633,7 +633,7 @@
"\n",
"# Display the moment map image\n",
"im = ax.imshow(herschel_data_nonans, cmap='viridis', \n",
" norm=LogNorm(), vmin=5, vmax=50, alpha=.8)\n",
" norm=LogNorm(vmin=5, vmax=50), alpha=.8)\n",
"# ax.invert_yaxis() # Flips the Y axis \n",
"\n",
"# Add axes labels\n",
Expand Down Expand Up @@ -748,7 +748,7 @@
"\n",
"# Display the moment map image\n",
"im = ax.imshow(rescaled_herschel_data_nonans, cmap = 'viridis', \n",
" norm = LogNorm(), vmin = 5, vmax = 50, alpha = .8)\n",
" norm = LogNorm(vmin=5, vmax=50), alpha = .8)\n",
"#im = ax.imshow(rescaled_herschel_imagehdu.data, cmap = 'viridis', \n",
"# norm = LogNorm(), vmin = 5, vmax = 50, alpha = .8)\n",
"ax.invert_yaxis() # Flips the Y axis \n",
Expand Down
26 changes: 14 additions & 12 deletions tutorials/astropy-coordinates/1-Coordinates-Intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,19 @@
"metadata": {},
"outputs": [],
"source": [
"cols = ['source_id',\n",
" 'ra',\n",
" 'dec',\n",
" 'parallax',\n",
" 'parallax_error',\n",
" 'pmra',\n",
" 'pmdec',\n",
" 'radial_velocity',\n",
" 'phot_g_mean_mag',\n",
" 'phot_bp_mean_mag',\n",
" 'phot_rp_mean_mag']\n",
"cols = [\n",
" 'source_id',\n",
" 'ra',\n",
" 'dec',\n",
" 'parallax',\n",
" 'parallax_error',\n",
" 'pmra',\n",
" 'pmdec',\n",
" 'radial_velocity',\n",
" 'phot_g_mean_mag',\n",
" 'phot_bp_mean_mag',\n",
" 'phot_rp_mean_mag'\n",
"]\n",
"ngc188_table[cols].write('gaia_results.fits', overwrite=True)"
]
},
Expand Down Expand Up @@ -503,7 +505,7 @@
"metadata": {},
"outputs": [],
"source": [
"gaia_dist = Distance(parallax=ngc188_table_3d['parallax'])"
"gaia_dist = Distance(parallax=ngc188_table_3d['parallax'].filled(np.nan))"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions tutorials/gaia-galactic-orbits/gaia-galactic-orbits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
"source": [
"fig, ax = plt.subplots(1, 1, figsize=(6, 6))\n",
"\n",
"ax.plot(BP_RP, M_G, \n",
"ax.plot(BP_RP.value, M_G.value, \n",
" marker='.', linestyle='none', alpha=0.3)\n",
"\n",
"ax.set_xlim(0, 3)\n",
Expand Down Expand Up @@ -576,12 +576,12 @@
"source": [
"fig, ax = plt.subplots(1, 1, figsize=(6, 6))\n",
"\n",
"ax.plot(BP_RP, M_G, \n",
"ax.plot(BP_RP.value, M_G.value, \n",
" marker='.', linestyle='none', alpha=0.1)\n",
"\n",
"for mask, color in zip([lo_mass_mask, hi_mass_mask],\n",
" [lo_mass_color, hi_mass_color]):\n",
" ax.plot(BP_RP[mask], M_G[mask], \n",
" ax.plot(BP_RP[mask].value, M_G[mask].value, \n",
" marker='.', linestyle='none', \n",
" alpha=0.5, color=color)\n",
"\n",
Expand Down

0 comments on commit f8364fa

Please sign in to comment.