diff --git a/notebooks/cross_instrument/background_estimation_imaging/Imaging_Sky_Background_Estimation.ipynb b/notebooks/cross_instrument/background_estimation_imaging/Imaging_Sky_Background_Estimation.ipynb index c82b45e44..06d9b977d 100644 --- a/notebooks/cross_instrument/background_estimation_imaging/Imaging_Sky_Background_Estimation.ipynb +++ b/notebooks/cross_instrument/background_estimation_imaging/Imaging_Sky_Background_Estimation.ipynb @@ -56,17 +56,15 @@ " Tophat2DKernel, convolve)\n", "from astropy.modeling import fitting, models\n", "from astropy.nddata.blocks import block_reduce\n", - "from astropy.stats import SigmaClip, gaussian_fwhm_to_sigma\n", + "from astropy.stats import SigmaClip\n", "from astropy.table import Table\n", - "from IPython.display import Video\n", + "from IPython.display import Image\n", "from jdaviz import Imviz\n", - "from photutils.background import (Background2D, BiweightLocationBackground,\n", + "from photutils.background import (Background2D,\n", " BkgIDWInterpolator, BkgZoomInterpolator,\n", - " MedianBackground, SExtractorBackground)\n", + " MedianBackground)\n", "from photutils.datasets import make_gaussian_sources_image\n", "from photutils.segmentation import detect_sources, make_2dgaussian_kernel\n", - "from photutils.utils import ShepardIDWInterpolator as idw\n", - "from scipy import interpolate, ndimage, stats\n", "from scipy.ndimage import median_filter" ] }, @@ -231,7 +229,7 @@ "metadata": {}, "outputs": [], "source": [ - "imviz.app" + "imviz.load_data(noiseless_sky, data_label='noiseless_sky_background')" ] }, { @@ -240,7 +238,7 @@ "metadata": {}, "outputs": [], "source": [ - "imviz.load_data(noiseless_sky, data_label='noiseless_sky_background')" + "imviz.show()" ] }, { @@ -318,7 +316,7 @@ "metadata": {}, "outputs": [], "source": [ - "imviz2.app" + "imviz2.show()" ] }, { @@ -362,9 +360,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Video:\n", - "\n", - "Link two images in different windows by pixel and manipulate image." + "The two images are linked by pixel by default. Click on the zoom/pan tool to take a closer look at the images. The two images will zoom and pan syncronously." ] }, { @@ -373,8 +369,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Video showing how to link two images in pixel space using plugin\n", - "Video(url='https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/Background_Estimation/imviz_demo_1.mov', width=700, height=500)" + "Image('./imviz_2images.png', alt='Imviz with two viewers. Highlighted tool for linked zoom and pan.')" ] }, { @@ -938,7 +933,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Check for bias in due to the galaxies\n", + "## Check for bias due to the galaxies\n", "\n", "Since we are dealing with a simulation, where we know truth, we can evaluate the biases directly. (In the case of a real image, we can't do that; we'll suggest another test further down). \n", "\n", @@ -1092,7 +1087,7 @@ ] }, { - "cell_type": "raw", + "cell_type": "markdown", "metadata": {}, "source": [ "Plot the residuals vs. source radius, separately for the masked, unmasked, and randomized source positions. The sizes of the markers are proportional to the fluxes of the sources." @@ -1224,7 +1219,7 @@ "source": [ "plt.figure(figsize=(10, 6))\n", "perfect = rms['perfect']\n", - "plt.plot(rms['widths'], rms['bkg1']/perfect, alpha=0.5,label='bkg1')\n", + "plt.plot(rms['widths'], rms['bkg1']/perfect, alpha=0.5, label='bkg1')\n", "plt.plot(rms['widths'], rms['bkg2']/perfect, alpha=0.5, label='bkg2')\n", "plt.plot(rms['widths'], rms['bkg3']/perfect, alpha=0.5, label='bkg3')\n", "plt.plot(rms['widths'], rms['bkg4']/perfect, alpha=0.5, label='bkg4')\n", @@ -1257,7 +1252,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/notebooks/cross_instrument/background_estimation_imaging/imviz_2images.png b/notebooks/cross_instrument/background_estimation_imaging/imviz_2images.png new file mode 100644 index 000000000..a6d34d1b2 Binary files /dev/null and b/notebooks/cross_instrument/background_estimation_imaging/imviz_2images.png differ diff --git a/notebooks/cross_instrument/background_estimation_imaging/pre-requirements.txt b/notebooks/cross_instrument/background_estimation_imaging/pre-requirements.txt deleted file mode 100644 index 751a69147..000000000 --- a/notebooks/cross_instrument/background_estimation_imaging/pre-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy==1.25.2 diff --git a/notebooks/cross_instrument/background_estimation_imaging/requirements.txt b/notebooks/cross_instrument/background_estimation_imaging/requirements.txt index cf08c393e..e8f57a4c4 100644 --- a/notebooks/cross_instrument/background_estimation_imaging/requirements.txt +++ b/notebooks/cross_instrument/background_estimation_imaging/requirements.txt @@ -1,6 +1,7 @@ -astropy >= 5.3.3 -matplotlib >= 3.7.2 -scipy >= 1.11.2 -photutils >= 1.9.0 +numpy >= 2.0.0 +astropy >= 6.1.1 +matplotlib >= 3.9.1 +scipy >= 1.14.0 +photutils >= 1.13.0 scikit-image >= 0.21.0 -jdaviz >= 3.6.2 +jdaviz >= 3.10.2