Skip to content

Commit

Permalink
Initial rewrite of source detection notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcraig committed Mar 25, 2024
1 parent 8da3bb8 commit e38f3f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
6 changes: 6 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ parts:
title: Handling images that need masking
- file: notebooks/photometry/01.01.03-Background-estimation-FEDER.ipynb
title: Removing a gradient
- file: notebooks/photometry/01.02-IRAF-like-detection.ipynb
title: IRAF-like source detection
sections:
- file: notebooks/photometry/01.02.01-IRAF-like-detection-simulated-data.ipynb
title: Overview with simulated image


# - url: https://github.com/mwcraig/ccd-reduction-and-photometry-guide
# title: GitHub repository
19 changes: 6 additions & 13 deletions notebooks/photometry/01.02-IRAF-like-photutils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# IRAF-like: photutils\n",
"# IRAF-like source detection using photutils\n",
"\n",
"[photutils]() provides a couple of options for stellar source detection that will be familiar to users of IRAF. One is DAOFIND and the other is IRAF's starfind. The recommendation is to use DAOFIND because it is more general than starfind (e.g. it allows elliptical sources) and detects more sources. This notebook will focus on DAOFIND, implemented in photutils by the class `DAOStarFinder`.\n",
"[photutils]() provides a couple of options for stellar source detection that will be familiar to users of IRAF. One is DAOFIND and the other is IRAF's starfind. The recommendation is to use DAOFIND because it is more general than starfind (e.g. it allows elliptical sources) and detects more sources. There are examples of each method in the notebooks that follow.\n",
"\n",
"Both methods find sources above a threshold that is specified as a multiple of the background noise level, and both require that the background be subtracted from the image.\n",
"\n",
"You can use any of the background subtraction methods that you like; often simply subtracting the median will be adequate, which is what we will do in this notebook. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DAOPHOT"
"You can use any of the background subtraction methods that you like; often simply subtracting the median will be adequate. "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -37,9 +30,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"metadata": {},
"outputs": [],
"source": [
"plt.style.use('../photutils_notebook_style.mplstyle')"
"plt.style.use('../../photutils_notebook_style.mplstyle')"
]
},
{
Expand Down Expand Up @@ -562,7 +562,7 @@
"outputs": [],
"source": [
"sources_findpeaks = find_peaks(xdf_image.data, mask=xdf_image.mask, \n",
" threshold=20. * std, box_size=30, \n",
" threshold=20. * std, box_size=29, \n",
" centroid_func=centroid_2dg) \n",
"print(sources_findpeaks)"
]
Expand Down Expand Up @@ -827,7 +827,7 @@
"ax1.set_title('Original Data')\n",
"\n",
"# Plot the segmentation image\n",
"rand_cmap = make_random_cmap(random_state=12345)\n",
"rand_cmap = make_random_cmap(seed=12345)\n",
"rand_cmap.set_under('black')\n",
"segplot = ax2.imshow(np.ma.masked_where(xdf_image.mask, segm), vmin=1, cmap=rand_cmap)\n",
"ax2.set_xlabel('X (pixels)')\n",
Expand Down Expand Up @@ -858,9 +858,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"fig, axs = plt.subplots(3,3, figsize=(3, 3))\n",
Expand Down Expand Up @@ -918,9 +916,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"catalog = source_properties(xdf_image.data, segm)\n",
Expand Down Expand Up @@ -1058,7 +1054,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1072,9 +1068,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
"version": "3.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit e38f3f2

Please sign in to comment.