Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ab8ada3
Adds first draft of tutorial #14
emmalieb Jun 10, 2022
26a516e
Delete plotting_quasar_observations.ipynb
emmalieb Jun 10, 2022
b34b63c
Added first draft of tutorial 14
emmalieb Jun 10, 2022
8ac335c
Finished code for first plot
emmalieb Jun 20, 2022
1590f46
Ran cells, started on spectra
emmalieb Jun 30, 2022
012c3a9
Debug wavelength issue
emmalieb Jul 11, 2022
bae0ae0
Finished plotting_quasar_observations
emmalieb Jul 12, 2022
9b063e9
Created ultrafaint_dwarf_galaxy_search
emmalieb Jul 14, 2022
9e3120f
Delete ultrafaint_dwarf_galaxy_search.ipynb
emmalieb Jul 14, 2022
0ee18e3
created folder for new notebook
emmalieb Jul 19, 2022
7ead93f
Uploaded draft of ultrafaint_dwarf_galaxy_search
emmalieb Jul 19, 2022
3ba5779
Wrote introduction
emmalieb Jul 20, 2022
da39cf7
Plotted CMD and FOV
emmalieb Jul 27, 2022
bbbbcb1
Fixed typo
emmalieb Jul 27, 2022
8c8fa9a
Added second target and color image
emmalieb Aug 11, 2022
14aa573
Updated mark down cells, still working on plotting spectrum
emmalieb Aug 30, 2022
4137388
Continued plotting spectrum for member of UFD
emmalieb Sep 12, 2022
d07e05e
Added exercise solutions, finished notebook, added requirements.txt
emmalieb Sep 16, 2022
34d85d0
Fixed most of the reviewers suggestions
emmalieb Sep 21, 2022
76e9ae0
Improved FOV images
emmalieb Sep 22, 2022
0995aa5
Addressed most comments from reviewer
emmalieb Sep 26, 2022
7049592
Addresses reviewer comments, changed notebook name
emmalieb Sep 28, 2022
bf61c52
Addressed final comments on notebook
emmalieb Sep 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,568 changes: 1,568 additions & 0 deletions notebooks/MAST/dwarf_galaxy_search/dwarf_galaxy_search.ipynb

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions notebooks/MAST/dwarf_galaxy_search/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
astroquery>=0.4.6
numpy>=1.22.3
matplotlib>=3.5.1
Jdavis>=3
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "b6ab59f6",
"metadata": {},
"source": [
"# Solution to Exercise in ultrafaint_dwarf_galaxy_search.ipynb\n",
"\n",
"## 1. Plot Field of View of Draco II \n",
"\n",
"Can you recreate the steps we took for **Leo I** to plot the field of view of **Draco II** in black and white and in color? \n",
"\n",
"### Start by building the url to the fits file of the region for our target"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1199c638",
"metadata": {},
"outputs": [],
"source": [
"#read RA and Dec from either SIMBAD or Table 1 in Laevens et al 2015\n",
"r = '15:52:47.6'\n",
"d = '+64:33:55'\n",
"\n",
"#Convert the RA and Dec to degrees\n",
"c = SkyCoord(r+d, unit=(u.hourangle, u.deg))\n",
"ra = str(c.ra.degree)\n",
"dec = str(c.dec.degree)\n",
"\n",
"filters = \"grizy\"\n",
"size = \"240\" #extracted image size in pixels (0.25 arcsec/pixel)\n",
"form = \"fits\" #file format of the file we would like\n",
"\n",
"color = \"red\" #you can change this, red is typically the i or r filter\n",
"\n",
"#get the url to the PS1 images\n",
"images_url = \"https://ps1images.stsci.edu/cgi-bin/ps1filenames.py?ra=\"+ra+\"&dec=\"+dec+\"&filters=\"+filters\n",
"#read the images data into a table\n",
"img_table = Table.read(images_url, format='ascii')\n",
"\n",
"#get the first filename from the list of images\n",
"file = img_table['filename'][0]\n",
"\n",
"#build the url to the fits file\n",
"fits_url = \"https://ps1images.stsci.edu/cgi-bin/fitscut.cgi?ra=\"+ra+\"&dec=\"+dec+\"&size=\"+size+\"&format=\"+form+\"&\"+color+\"=\"+file\n",
"\n",
"print(fits_url)"
]
},
{
"cell_type": "markdown",
"id": "88629e31",
"metadata": {},
"source": [
"### Open the fits file and plot the image\n",
"\n",
"Here we will plot the field of view containing our UFD, Leo I. Remember, it is Ultra-Faint!\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c325c0f2",
"metadata": {},
"outputs": [],
"source": [
"#open the fits file and get the data\n",
"fh = fits.open(fits_url)\n",
"fits_img = fh[0].data\n",
"\n",
"# replace NaN values with zero for display\n",
"fits_img[np.isnan(fits_img)] = 0.0\n",
"\n",
"#show the fits image\n",
"plt.imshow(fits_img,cmap=\"gray\",origin=\"lower\")\n",
"plt.title(\"Draco II - PS1 i\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "910d4f49",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "1e23ec4a",
"metadata": {},
"outputs": [],
"source": [
"#make a stacked color image by combining filters\n",
"filters = \"grizy\"\n",
"size = \"240\" #extracted image size in pixels (0.25 arcsec/pixel)\n",
"form = \"fits\" #file format of the file we would like\n",
"\n",
"red = \"red\" #you can change this, red is typically the r or i filter\n",
"blue = \"blue\"\n",
"green = \"green\"\n",
"\n",
"#get the url to the PS1 images\n",
"images_url = \"https://ps1images.stsci.edu/cgi-bin/ps1filenames.py?ra=\"+ra+\"&dec=\"+dec+\"&filters=\"+filters\n",
"#read the images data into a table\n",
"img_table = Table.read(images_url, format='ascii')\n",
"\n",
"#get the first filename from the list of images\n",
"file = img_table['filename'][0]\n",
"\n",
"#build the url to the fits file\n",
"red_fits_url = \"https://ps1images.stsci.edu/cgi-bin/fitscut.cgi?ra=\"+ra+\"&dec=\"+dec+\"&size=\"+size+\"&format=\"+form+\"&\"+red+\"=\"+file\n",
"blue_fits_url = \"https://ps1images.stsci.edu/cgi-bin/fitscut.cgi?ra=\"+ra+\"&dec=\"+dec+\"&size=\"+size+\"&format=\"+form+\"&\"+blue+\"=\"+file\n",
"green_fits_url = \"https://ps1images.stsci.edu/cgi-bin/fitscut.cgi?ra=\"+ra+\"&dec=\"+dec+\"&size=\"+size+\"&format=\"+form+\"&\"+green+\"=\"+file\n",
"\n",
"\n",
"print(fits_url)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fa39a1e9",
"metadata": {},
"outputs": [],
"source": [
"#open the fits file and get the data\n",
"fh_red = fits.open(red_fits_url)\n",
"fh_blue = fits.open(blue_fits_url)\n",
"fh_green = fits.open(green_fits_url)\n",
"\n",
"red_fits_img = fh_red[0].data\n",
"blue_fits_img = fh_blue[0].data\n",
"green_fits_img = fh_green[0].data\n",
"\n",
"# replace NaN values with zero for display\n",
"red_fits_img[np.isnan(red_fits_img)] = 0.0\n",
"blue_fits_img[np.isnan(blue_fits_img)] = 0.0\n",
"green_fits_img[np.isnan(green_fits_img)] = 0.0\n",
"\n",
"#show the fits image\n",
"plt.imshow(green_fits_img,cmap=\"Greens_r\",origin=\"lower\", alpha = 0.35)\n",
"plt.imshow(red_fits_img,cmap=\"Reds_r\",origin=\"lower\", alpha = 0.45)\n",
"plt.imshow(blue_fits_img,cmap=\"Blues_r\",origin=\"lower\", alpha = 0.25)\n",
"plt.title(\"Draco II - PS1 r,g,i\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading