|
193 | 193 | "from jwst.datamodels import ImageModel\n",
|
194 | 194 | "\n",
|
195 | 195 | "# Background and PSF Functions\n",
|
196 |
| - "from photutils.background import MMMBackground, MADStdBackgroundRMS, Background2D, LocalBackground\n", |
| 196 | + "from photutils.background import MMMBackground, MADStdBackgroundRMS, LocalBackground\n", |
197 | 197 | "\n",
|
198 | 198 | "# Photutils library and tools\n",
|
199 | 199 | "from photutils.aperture import CircularAperture\n",
|
200 | 200 | "from photutils.detection import DAOStarFinder\n",
|
201 |
| - "from photutils import EPSFBuilder\n", |
202 | 201 | "\n",
|
203 | 202 | "# set up crds if necessary\n",
|
204 | 203 | "from crds import client\n",
|
|
450 | 449 | " data = fits.open(file)['SCI', 1].data\n",
|
451 | 450 | " dq = fits.open(file)['DQ', 1].data\n",
|
452 | 451 | " data[dq >= 10] = np.nan\n",
|
453 |
| - " hdul['SCI',1].data = data\n", |
| 452 | + " hdul['SCI', 1].data = data\n", |
454 | 453 | " hdul.flush()"
|
455 | 454 | ]
|
456 | 455 | },
|
|
492 | 491 | "# Reference Link: http://simbad.cds.unistra.fr/simbad/sim-basic?Ident=2MASSJ17430448%2B6655015&submit=SIMBAD+search\n",
|
493 | 492 | "source_location = SkyCoord('17:43:04.4879', '+66:55:01.837', unit=(u.hourangle, u.deg))\n",
|
494 | 493 | "ref_wcs = ref_fits.get_fits_wcs()\n",
|
495 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
| 494 | + "ref_y, ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
496 | 495 | "ref_cutout = extract_array(ref_data, (21, 21), (ref_x, ref_y))\n",
|
497 | 496 | "\n",
|
498 | 497 | "# The scale should highlight the background noise so it is possible to see all faint sources.\n",
|
499 | 498 | "norm1 = simple_norm(ref_cutout, stretch='log', min_cut=4.3, max_cut=15)\n",
|
500 |
| - "plt.imshow(ref_cutout,origin='lower', norm=norm1, cmap='gray')\n", |
| 499 | + "plt.imshow(ref_cutout, origin='lower', norm=norm1, cmap='gray')\n", |
501 | 500 | "clb = plt.colorbar()\n",
|
502 | 501 | "clb.set_label('MJy/Str', labelpad=-40, y=1.05, rotation=0)\n",
|
503 | 502 | "plt.title('PID1028,Obs006')\n",
|
|
539 | 538 | "source": [
|
540 | 539 | "# Zoom in to see the source\n",
|
541 | 540 | "source_location = SkyCoord('17:43:04.4879', '+66:55:01.837', unit=(u.hourangle, u.deg))\n",
|
542 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, wcs.WCS(ref_fits['SCI', 1], ref_fits))\n", |
543 |
| - "ref_cutout = extract_array(ref_data,(11, 11), (ref_x, ref_y))\n", |
544 |
| - "norm1 = simple_norm(ref_cutout,stretch='linear', min_cut=-1, max_cut=10)\n", |
| 541 | + "ref_y, ref_x = skycoord_to_pixel(source_location, wcs.WCS(ref_fits['SCI', 1], ref_fits))\n", |
| 542 | + "ref_cutout = extract_array(ref_data, (11, 11), (ref_x, ref_y))\n", |
| 543 | + "norm1 = simple_norm(ref_cutout, stretch='linear', min_cut=-1, max_cut=10)\n", |
545 | 544 | "plt.imshow(ref_cutout, origin='lower', norm=norm1, cmap='gray')\n",
|
546 | 545 | "plt.title('PID1028,Obs006')\n",
|
547 | 546 | "plt.gca().tick_params(labelcolor='none', axis='both', color='none')\n",
|
|
569 | 568 | "# The function get_jwst_psf is a space_phot wrapper for the WebbPSF calc_psf and CreatePSFLibrary functions. It is intended to provide easy, but limited, access to WebbPSF.\n",
|
570 | 569 | "# The source code for psfs = space_phot.get_jwst_psf(jwst_obs, source_location) is as follows:\n",
|
571 | 570 | "\n",
|
572 |
| - " # c = webbpsf.gridded_library.CreatePSFLibrary(inst, inst.filter, num_psfs = 1, psf_location=(x,y), fov_pixels=psf_width, detectors=st_obs.detector, save=False)\n", |
573 |
| - " # grid = c.create_grid()\n", |
| 571 | + "# c = webbpsf.gridded_library.CreatePSFLibrary(inst, inst.filter, num_psfs = 1, psf_location=(x, y), fov_pixels=psf_width, detectors=st_obs.detector, save=False)\n", |
| 572 | + "# grid = c.create_grid()\n", |
574 | 573 | "\n",
|
575 | 574 | "# In most cases, we assume the user wishes to simply grab the default WebbPSF. Advanced users should consider using webbpsf.\n",
|
576 | 575 | "# In that case, you would use the code below.<br>\n",
|
577 | 576 | "\n",
|
578 |
| - " # psf_model = inst.calc_psf(oversample=4,normalize='last') # creates a psf model in webbpsf\n", |
579 |
| - " # psfs = photutils.psf.FittableImageModel(psf[0].data*16,normalize=False,oversampling=oversampling) # turns the psf into a fittableimage model to improve processing time\n", |
| 577 | + "# psf_model = inst.calc_psf(oversample=4,normalize='last') # creates a psf model in webbpsf\n", |
| 578 | + "# psfs = photutils.psf.FittableImageModel(psf[0].data*16,normalize=False,oversampling=oversampling) # turns the psf into a fittableimage model to improve processing time\n", |
580 | 579 | "\n",
|
581 | 580 | "# There are more advanced methods for generating your WebbPSF, but those are beyond the scope of this notebook.\n",
|
582 | 581 | "# Useful reference: https://webbpsf.readthedocs.io/en/latest/api/webbpsf.JWInstrument.html#webbpsf.JWInstrument.calc_psf"
|
|
605 | 604 | "outputs": [],
|
606 | 605 | "source": [
|
607 | 606 | "# The scale should highlight the background noise so it is possible to see all faint sources.\n",
|
608 |
| - "ref_cutout = extract_array(psfs[0].data,(41, 41), (122, 122))\n", |
| 607 | + "ref_cutout = extract_array(psfs[0].data, (41, 41), (122, 122))\n", |
609 | 608 | "norm1 = simple_norm(ref_cutout, stretch='log', min_cut=0.0, max_cut=0.2)\n",
|
610 | 609 | "plt.imshow(ref_cutout, origin='lower', norm=norm1, cmap='gray')\n",
|
611 | 610 | "clb = plt.colorbar()\n",
|
|
660 | 659 | "outputs": [],
|
661 | 660 | "source": [
|
662 | 661 | "# Do PSF Photometry using space_phot (details of fitting are in documentation)\n",
|
663 |
| - "jwst_obs.psf_photometry(psfs, source_location, bounds={'flux' :[-10000, 10000],\n", |
664 |
| - " 'centroid' :[-2, 2],\n", |
665 |
| - " 'bkg' :[0, 50]},\n", |
666 |
| - " fit_width=7,\n", |
667 |
| - " fit_centroid='pixel',\n", |
668 |
| - " fit_bkg=True,\n", |
669 |
| - " fit_flux='single')\n", |
| 662 | + "jwst_obs.psf_photometry(\n", |
| 663 | + " psfs,\n", |
| 664 | + " source_location,\n", |
| 665 | + " bounds={\n", |
| 666 | + " 'flux': [-10000, 10000],\n", |
| 667 | + " 'centroid': [-2, 2],\n", |
| 668 | + " 'bkg': [0, 50],\n", |
| 669 | + " },\n", |
| 670 | + " fit_width=7,\n", |
| 671 | + " fit_centroid='pixel',\n", |
| 672 | + " fit_bkg=True,\n", |
| 673 | + " fit_flux='single'\n", |
| 674 | + ")\n", |
| 675 | + "\n", |
670 | 676 | "jwst_obs.plot_psf_fit()\n",
|
671 | 677 | "plt.show()\n",
|
672 | 678 | "\n",
|
|
794 | 800 | "source_location = SkyCoord('17:43:04.4879', '+66:55:01.837', unit=(u.hourangle, u.deg))\n",
|
795 | 801 | "\n",
|
796 | 802 | "ref_wcs = ref_fits.get_fits_wcs()\n",
|
797 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
| 803 | + "ref_y, ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
798 | 804 | "ref_cutout = extract_array(ref_data, (21, 21), (ref_x, ref_y))\n",
|
799 | 805 | "\n",
|
800 | 806 | "# The scale should highlight the background noise so it is possible to see all faint sources.\n",
|
|
842 | 848 | "# The function get_jwst_psf is a space_phot wrapper for the WebbPSF calc_psf function and uses a lot of the same keywords.\n",
|
843 | 849 | "# There are more advanced methods for generating your WebbPSF, but those are beyond the scope of this notebook.\n",
|
844 | 850 | "# The defaults used by get_jwst_psf in this notebook are:\n",
|
845 |
| - " # oversample=4\n", |
846 |
| - " # normalize='last'\n", |
847 |
| - " # Non-distorted PSF\n", |
| 851 | + "# oversample=4\n", |
| 852 | + "# normalize='last'\n", |
| 853 | + "# Non-distorted PSF\n", |
848 | 854 | "# Useful reference: https://webbpsf.readthedocs.io/en/latest/api/webbpsf.JWInstrument.html#webbpsf.JWInstrument.calc_psf\n",
|
849 | 855 | "\n",
|
850 | 856 | "# Get PSF from WebbPSF\n",
|
|
900 | 906 | "source": [
|
901 | 907 | "# Do PSF Photometry using space_phot (details of fitting are in documentation)\n",
|
902 | 908 | "# See detailed notes in Section 3.1 above about the fitting process and diagnostics\n",
|
903 |
| - "jwst3_obs.psf_photometry(psf3, source_location, bounds={'flux' :[-10000, 10000],\n", |
904 |
| - " 'centroid' :[-2, 2],\n", |
905 |
| - " 'bkg' :[0, 50]},\n", |
906 |
| - " fit_width=9,\n", |
907 |
| - " fit_bkg=True,\n", |
908 |
| - " fit_flux=True)\n", |
| 909 | + "jwst3_obs.psf_photometry(\n", |
| 910 | + " psf3,\n", |
| 911 | + " source_location,\n", |
| 912 | + " bounds={\n", |
| 913 | + " 'flux': [-10000, 10000],\n", |
| 914 | + " 'centroid': [-2, 2],\n", |
| 915 | + " 'bkg': [0, 50],\n", |
| 916 | + " },\n", |
| 917 | + " fit_width=9,\n", |
| 918 | + " fit_bkg=True,\n", |
| 919 | + " fit_flux=True\n", |
| 920 | + ")\n", |
909 | 921 | "\n",
|
910 | 922 | "jwst_obs.plot_psf_fit()\n",
|
911 | 923 | "plt.show()\n",
|
|
1057 | 1069 | "# Pick a blank part of the sky to calculate the upper limit\n",
|
1058 | 1070 | "source_location = SkyCoord('17:43:00.0332', '+66:54:42.677', unit=(u.hourangle, u.deg))\n",
|
1059 | 1071 | "ref_wcs = ref_fits.get_fits_wcs()\n",
|
1060 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
| 1072 | + "ref_y, ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
1061 | 1073 | "ref_cutout = extract_array(ref_data, (21, 21), (ref_x, ref_y))\n",
|
1062 | 1074 | "\n",
|
1063 | 1075 | "# The scale should highlight the background noise so it is possible to see all faint sources.\n",
|
|
1104 | 1116 | "source": [
|
1105 | 1117 | "# Pick a blank part of the sky to calculate the upper limit\n",
|
1106 | 1118 | "source_location = SkyCoord('17:43:00.0332', '+66:54:42.677', unit=(u.hourangle, u.deg))\n",
|
1107 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, wcs.WCS(ref_fits['SCI', 1], ref_fits))\n", |
1108 |
| - "ref_cutout = extract_array(ref_data,(11, 11),( ref_x, ref_y))\n", |
| 1119 | + "ref_y, ref_x = skycoord_to_pixel(source_location, wcs.WCS(ref_fits['SCI', 1], ref_fits))\n", |
| 1120 | + "ref_cutout = extract_array(ref_data, (11, 11), (ref_x, ref_y))\n", |
1109 | 1121 | "norm1 = simple_norm(ref_cutout, stretch='linear', min_cut=-1, max_cut=10)\n",
|
1110 | 1122 | "\n",
|
1111 | 1123 | "plt.imshow(ref_cutout, origin='lower', norm=norm1, cmap='gray')\n",
|
|
1126 | 1138 | "# The function get_jwst_psf is a space_phot wrapper for the WebbPSF calc_psf function and uses a lot of the same keywords.\n",
|
1127 | 1139 | "# There are more advanced methods for generating your WebbPSF, but those are beyond the scope of this notebook.\n",
|
1128 | 1140 | "# The defaults used by get_jwst_psf in this notebook are:\n",
|
1129 |
| - " # oversample=4\n", |
1130 |
| - " # normalize='last'\n", |
1131 |
| - " # Non-distorted PSF\n", |
| 1141 | + "# oversample=4\n", |
| 1142 | + "# normalize='last'\n", |
| 1143 | + "# Non-distorted PSF\n", |
1132 | 1144 | "# Useful reference: https://webbpsf.readthedocs.io/en/latest/api/webbpsf.JWInstrument.html#webbpsf.JWInstrument.calc_psf\n",
|
1133 | 1145 | "\n",
|
1134 | 1146 | "# Get PSF from WebbPSF\n",
|
|
1168 | 1180 | "source": [
|
1169 | 1181 | "# Do PSF Photometry using space_phot (details of fitting are in documentation)\n",
|
1170 | 1182 | "# https://st-phot.readthedocs.io/en/latest/examples/plot_a_psf.html#jwst-images\n",
|
1171 |
| - "jwst_obs.psf_photometry(psfs,source_location, bounds={'flux' :[-10, 1000],\n", |
1172 |
| - " 'bkg' :[0, 50]},\n", |
1173 |
| - " fit_width=5,\n", |
1174 |
| - " fit_bkg=True,\n", |
1175 |
| - " fit_centroid='fixed',\n", |
1176 |
| - " fit_flux='single')\n", |
| 1183 | + "jwst_obs.psf_photometry(\n", |
| 1184 | + " psfs,\n", |
| 1185 | + " source_location,\n", |
| 1186 | + " bounds={\n", |
| 1187 | + " 'flux': [-10, 1000],\n", |
| 1188 | + " 'bkg': [0, 50],\n", |
| 1189 | + " },\n", |
| 1190 | + " fit_width=5,\n", |
| 1191 | + " fit_bkg=True,\n", |
| 1192 | + " fit_centroid='fixed',\n", |
| 1193 | + " fit_flux='single'\n", |
| 1194 | + ")\n", |
1177 | 1195 | "jwst_obs.plot_psf_fit()\n",
|
1178 | 1196 | "plt.show()\n",
|
1179 | 1197 | "\n",
|
|
1256 | 1274 | "# Pick a blank part of the sky to calculate the upper limit\n",
|
1257 | 1275 | "source_location = SkyCoord('17:43:00.0332', '+66:54:42.677', unit=(u.hourangle, u.deg))\n",
|
1258 | 1276 | "ref_wcs = ref_fits.get_fits_wcs()\n",
|
1259 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
| 1277 | + "ref_y, ref_x = skycoord_to_pixel(source_location, ref_wcs)\n", |
1260 | 1278 | "ref_cutout = extract_array(ref_data, (21, 21), (ref_x, ref_y))\n",
|
1261 | 1279 | "\n",
|
1262 | 1280 | "# The scale should highlight the background noise so it is possible to see all faint sources.\n",
|
|
1303 | 1321 | "# Pick a blank part of the sky to calculate the upper limit\n",
|
1304 | 1322 | "source_location = SkyCoord('17:43:00.0332', '+66:54:42.677', unit=(u.hourangle, u.deg))\n",
|
1305 | 1323 | "\n",
|
1306 |
| - "ref_y,ref_x = skycoord_to_pixel(source_location, wcs.WCS(ref_fits['SCI', 1], ref_fits))\n", |
| 1324 | + "ref_y, ref_x = skycoord_to_pixel(source_location, wcs.WCS(ref_fits['SCI', 1], ref_fits))\n", |
1307 | 1325 | "ref_cutout = extract_array(ref_data, (11, 11), (ref_x, ref_y))\n",
|
1308 | 1326 | "norm1 = simple_norm(ref_cutout, stretch='linear', min_cut=-1, max_cut=10)\n",
|
1309 | 1327 | "\n",
|
|
1326 | 1344 | "# The function get_jwst_psf is a space_phot wrapper for the WebbPSF calc_psf function and uses a lot of the same keywords.\n",
|
1327 | 1345 | "# There are more advanced methods for generating your WebbPSF, but those are beyond the scope of this notebook.\n",
|
1328 | 1346 | "# The defaults used by get_jwst_psf in this notebook are:\n",
|
1329 |
| - " # oversample=4\n", |
1330 |
| - " # normalize='last'\n", |
1331 |
| - " # Non-distorted PSF\n", |
| 1347 | + "# oversample=4\n", |
| 1348 | + "# normalize='last'\n", |
| 1349 | + "# Non-distorted PSF\n", |
1332 | 1350 | "# Useful reference: https://webbpsf.readthedocs.io/en/latest/api/webbpsf.JWInstrument.html#webbpsf.JWInstrument.calc_psf\n",
|
1333 | 1351 | "\n",
|
1334 | 1352 | "# Get PSF from WebbPSF\n",
|
|
1366 | 1384 | },
|
1367 | 1385 | "outputs": [],
|
1368 | 1386 | "source": [
|
1369 |
| - "jwst3_obs.psf_photometry(psf3,source_location, bounds={'flux' :[-1000, 1000],\n", |
1370 |
| - " 'bkg' :[0, 50]},\n", |
1371 |
| - " fit_width=9,\n", |
1372 |
| - " fit_bkg=True, \n", |
1373 |
| - " fit_centroid=False,\n", |
1374 |
| - " fit_flux=True)\n", |
| 1387 | + "jwst3_obs.psf_photometry(\n", |
| 1388 | + " psf3,\n", |
| 1389 | + " source_location,\n", |
| 1390 | + " bounds={\n", |
| 1391 | + " 'flux': [-1000, 1000],\n", |
| 1392 | + " 'bkg': [0, 50],\n", |
| 1393 | + " },\n", |
| 1394 | + " fit_width=9,\n", |
| 1395 | + " fit_bkg=True,\n", |
| 1396 | + " fit_centroid=False,\n", |
| 1397 | + " fit_flux=True\n", |
| 1398 | + ")\n", |
1375 | 1399 | "\n",
|
1376 | 1400 | "jwst3_obs.plot_psf_fit()\n",
|
1377 | 1401 | "plt.show()\n",
|
|
1746 | 1770 | " xys = [jwst_obs.wcs_list[i].world_to_pixel(source_location) for i in range(jwst_obs.n_exposures)]\n",
|
1747 | 1771 | " bkg = [localbkg_estimator(jwst_obs.data_arr_pam[i], xys[i][0], xys[i][0]) for i in range(jwst_obs.n_exposures)]\n",
|
1748 | 1772 | " print(bkg)\n",
|
1749 |
| - " jwst_obs.psf_photometry(psfs, source_location, bounds={'flux' :[-100000, 100000],\n", |
1750 |
| - " 'centroid' :[-2., 2.]},\n", |
1751 |
| - " fit_width=5,\n", |
1752 |
| - " fit_bkg=False,\n", |
1753 |
| - " fit_centroid='wcs',\n", |
1754 |
| - " background=bkg,\n", |
1755 |
| - " fit_flux='single',\n", |
1756 |
| - " maxiter=None)\n", |
| 1773 | + " jwst_obs.psf_photometry(\n", |
| 1774 | + " psfs,\n", |
| 1775 | + " source_location,\n", |
| 1776 | + " bounds={\n", |
| 1777 | + " 'flux': [-100000, 100000],\n", |
| 1778 | + " 'centroid': [-2.0, 2.0],\n", |
| 1779 | + " },\n", |
| 1780 | + " fit_width=5,\n", |
| 1781 | + " fit_bkg=False,\n", |
| 1782 | + " fit_centroid='wcs',\n", |
| 1783 | + " background=bkg,\n", |
| 1784 | + " fit_flux='single',\n", |
| 1785 | + " maxiter=None\n", |
| 1786 | + " )\n", |
1757 | 1787 | " \n",
|
1758 | 1788 | " jwst_obs.plot_psf_fit()\n",
|
1759 | 1789 | " plt.show()\n",
|
|
1762 | 1792 | "\n",
|
1763 | 1793 | " fit_location = SkyCoord(ra, dec, unit=u.deg)\n",
|
1764 | 1794 | " \n",
|
1765 |
| - " jwst_obs.psf_photometry(psfs, fit_location, bounds={'flux' :[-100000, 100000],\n", |
1766 |
| - " 'centroid' :[-2., 2.]},\n", |
1767 |
| - " fit_width=5,\n", |
1768 |
| - " fit_bkg=False,\n", |
1769 |
| - " background=bkg,\n", |
1770 |
| - " fit_centroid='fixed',\n", |
1771 |
| - " fit_flux='single',\n", |
1772 |
| - " maxiter=None)\n", |
| 1795 | + " jwst_obs.psf_photometry(\n", |
| 1796 | + " psfs,\n", |
| 1797 | + " fit_location,\n", |
| 1798 | + " bounds={\n", |
| 1799 | + " 'flux': [-100000, 100000],\n", |
| 1800 | + " 'centroid': [-2.0, 2.0],\n", |
| 1801 | + " },\n", |
| 1802 | + " fit_width=5,\n", |
| 1803 | + " fit_bkg=False,\n", |
| 1804 | + " background=bkg,\n", |
| 1805 | + " fit_centroid='fixed',\n", |
| 1806 | + " fit_flux='single',\n", |
| 1807 | + " maxiter=None\n", |
| 1808 | + " )\n", |
| 1809 | + "\n", |
1773 | 1810 | "\n",
|
1774 | 1811 | " jwst_obs.plot_psf_fit()\n",
|
1775 | 1812 | " plt.show()\n",
|
|
1925 | 1962 | " xys = [jwst3_obs.wcs.world_to_pixel(source_location)]\n",
|
1926 | 1963 | " bkg = [localbkg_estimator(jwst3_obs.data, xys[0][0], xys[0][1])]\n",
|
1927 | 1964 | " print(bkg)\n",
|
1928 |
| - " jwst3_obs.psf_photometry(psf3,source_location, bounds={'flux' :[-100000, 100000],\n", |
1929 |
| - " 'centroid' :[-2., 2.]},\n", |
1930 |
| - " fit_width=5,\n", |
1931 |
| - " fit_bkg=False,\n", |
1932 |
| - " background=bkg,\n", |
1933 |
| - " fit_flux=True)\n", |
| 1965 | + " jwst3_obs.psf_photometry(\n", |
| 1966 | + " psf3,\n", |
| 1967 | + " source_location,\n", |
| 1968 | + " bounds={\n", |
| 1969 | + " 'flux': [-100000, 100000],\n", |
| 1970 | + " 'centroid': [-2.0, 2.0],\n", |
| 1971 | + " },\n", |
| 1972 | + " fit_width=5,\n", |
| 1973 | + " fit_bkg=False,\n", |
| 1974 | + " background=bkg,\n", |
| 1975 | + " fit_flux=True\n", |
| 1976 | + " )\n", |
1934 | 1977 | "\n",
|
1935 | 1978 | " ra = jwst3_obs.psf_result.phot_cal_table['ra'][0]\n",
|
1936 | 1979 | " dec = jwst3_obs.psf_result.phot_cal_table['dec'][0]\n",
|
1937 | 1980 | " fit_location = SkyCoord(ra, dec, unit=u.deg)\n",
|
1938 | 1981 | " jwst3_obs.aperture_photometry(fit_location, encircled_energy=70)\n",
|
1939 | 1982 | " print(jwst3_obs.aperture_result.phot_cal_table['mag'])\n",
|
1940 | 1983 | " \n",
|
1941 |
| - " jwst3_obs.psf_photometry(psf3, fit_location, bounds={'flux' :[-100000, 100000],\n", |
1942 |
| - " 'centroid' :[-2., 2.]},\n", |
1943 |
| - " fit_width=5,\n", |
1944 |
| - " fit_bkg=False,\n", |
1945 |
| - " fit_centroid=False,\n", |
1946 |
| - " background=bkg,\n", |
1947 |
| - " fit_flux=True)\n", |
| 1984 | + " jwst3_obs.psf_photometry(\n", |
| 1985 | + " psf3,\n", |
| 1986 | + " fit_location,\n", |
| 1987 | + " bounds={\n", |
| 1988 | + " 'flux': [-100000, 100000],\n", |
| 1989 | + " 'centroid': [-2.0, 2.0],\n", |
| 1990 | + " },\n", |
| 1991 | + " fit_width=5,\n", |
| 1992 | + " fit_bkg=False,\n", |
| 1993 | + " fit_centroid=False,\n", |
| 1994 | + " background=bkg,\n", |
| 1995 | + " fit_flux=True\n", |
| 1996 | + " )\n", |
| 1997 | + "\n", |
1948 | 1998 | "\n",
|
1949 | 1999 | " jwst3_obs.plot_psf_fit()\n",
|
1950 | 2000 | " plt.show()\n",
|
|
0 commit comments