Skip to content

Commit

Permalink
update import
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Nov 21, 2024
1 parent 8f0bbfd commit adb1217
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 466 deletions.
94 changes: 3 additions & 91 deletions notebooks/MIRI/psf_photometry/miri_1028.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"outputs": [],
"source": [
"# Query the MAST (Mikulski Archive for Space Telescopes) database for observations\n",
"# with proposal ID 1171 and a specific filters 'F550W' and 'F770W'\n",
"# with proposal ID 1171 and a specific filters 'F560W' and 'F770W'\n",
"obs = Observations.query_criteria(proposal_id=1171, filters=['F560W', 'F770W'])\n",
"\n",
"# Get a list of products associated with the located observation\n",
Expand Down Expand Up @@ -541,38 +541,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "51fd4846-8cd6-4c60-8438-c6352488a3cc",
"metadata": {},
"source": [
"#### DEV NOTES: <br> \n",
"1. Add documentation to space_phot describing the get_jwst_psf wrapper.<br> \n",
"2. Add documentation on using webbpsf.calc_psf instead of space_phot.get_jwst_psf to have more control over your PSF.<br>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bd083573-528d-4f2a-a6b0-e6c762dcbb77",
"metadata": {},
"outputs": [],
"source": [
"# 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",
"# The source code for psfs = space_phot.get_jwst_psf(jwst_obs, source_location) is as follows:\n",
"# 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",
"# grid = c.create_grid()\n",
"\n",
"# In most cases, we assume the user wishes to simply grab the default WebbPSF. Advanced users should consider using webbpsf.\n",
"# In that case, you would use the code below.<br>\n",
"\n",
"# psf_model = inst.calc_psf(oversample=4, normalize='last') # creates a psf model in webbpsf\n",
"# psfs = photutils.psf.FittableImageModel(psf[0].data*16, normalize=False, oversampling=oversampling) # turns the psf into a fittableimage model to improve processing time\n",
"\n",
"# There are more advanced methods for generating your WebbPSF, but those are beyond the scope of this notebook.\n",
"# Useful reference: https://webbpsf.readthedocs.io/en/latest/api/webbpsf.JWInstrument.html#webbpsf.JWInstrument.calc_psf"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -607,18 +575,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "2f35f730-ce0f-450a-8606-dcc0eb8643ad",
"metadata": {},
"source": [
"#### DEV NOTES: <br> \n",
"\n",
"1. Add improved documentation on how the fitting is performed, including packages, background, parameters, and how a calibrated flux is calculated, etc.\n",
"1. Add improved documentation on reading the plots and metrics from psf_photometry. And details about the Table Columns.\n",
"2. Add improved documentation on the various parameters and how to optimize them based on the metrics."
]
},
{
"cell_type": "markdown",
"id": "bf53473e-9671-4f80-9d59-29c4ed8bab09",
Expand Down Expand Up @@ -891,9 +847,7 @@
"As noted above, improved documentation will be coming. For now, here are some important points to consider.\n",
"See detailed notes in Section 3.1 above about the fitting process and diagnostics\n",
"\n",
"In addition, consider here that jwst3_obs is generating a Level3 PSF by using the JWST pipeline to resample and combine multiple Level2 PSFs. The Level2 PSFs are generated at the precise location of the source in each Level2 file to account for detector level effects. The resampling uses default resampling paramters. However, users should be aware that if they performed customized resampling for their Level2 data products, they should use similar resampling steps for their PSF below. \n",
"\n",
"### DEV NOTE: Create a resampling step with more resampling paramaters."
"In addition, consider here that jwst3_obs is generating a Level3 PSF by using the JWST pipeline to resample and combine multiple Level2 PSFs. The Level2 PSFs are generated at the precise location of the source in each Level2 file to account for detector level effects. The resampling uses default resampling paramters. However, users should be aware that if they performed customized resampling for their Level2 data products, they should use similar resampling steps for their PSF below."
]
},
{
Expand Down Expand Up @@ -1683,40 +1637,6 @@
"t.write('skycoord.ecsv', overwrite=True)"
]
},
{
"cell_type": "markdown",
"id": "abe8c20c-087a-4b59-9f0c-26ccdb3dcbec",
"metadata": {},
"source": [
"#### DEV NOTE: allow space_phot to take pixel coordinates as input"
]
},
{
"cell_type": "markdown",
"id": "0199d630-d0e9-415b-a664-5725b45fa2c0",
"metadata": {},
"source": [
"#### DEV NOTE: Open WebbPSF ticket for webbpsf.gridded_library.CreatePSFLibrary, which is called in get_jwst_psf_from_grid below. The reason for this is that the output from that command currently prints: Position 2/4 centroid: (201.3017584451758, 201.31980818321827), but this is the lower corner of the array. We want a grid across the entire array. The notebook can currently be run as is."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ebc298b0-633b-4915-8f03-b510db3d81cc",
"metadata": {},
"outputs": [],
"source": [
"lvl2"
]
},
{
"cell_type": "markdown",
"id": "1953b4f4-4ec3-4322-abbd-d53a1954c1f5",
"metadata": {},
"source": [
"#### Dev Note: Need Grid Capability for Level3 Data for fater PSF Generation"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1821,14 +1741,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "b6489fb5-e99c-4204-aff6-49402842f5c0",
"metadata": {},
"source": [
"#### Dev Note: Need Grid Capability for Level3 Data for fater PSF Generation"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1973,7 +1885,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
},
"toc-showcode": false
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/MIRI/psf_photometry/miri_1028_photutils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
},
"toc-showcode": false
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/MIRI/psf_photometry/miri_photutils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
},
"toc-showcode": false
},
Expand Down
80 changes: 2 additions & 78 deletions notebooks/MIRI/psf_photometry/miri_spacephot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -547,16 +547,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "51fd4846-8cd6-4c60-8438-c6352488a3cc",
"metadata": {},
"source": [
"#### DEV NOTES: <br> \n",
"1. Add documentation to space_phot describing the get_jwst_psf wrapper.<br> \n",
"2. Add documentation on using webbpsf.calc_psf instead of space_phot.get_jwst_psf to have more control over your PSF.<br>"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -616,18 +606,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "2f35f730-ce0f-450a-8606-dcc0eb8643ad",
"metadata": {},
"source": [
"#### DEV NOTES: <br> \n",
"\n",
"1. Add improved documentation on how the fitting is performed, including packages, background, parameters, and how a calibrated flux is calculated, etc.\n",
"1. Add improved documentation on reading the plots and metrics from psf_photometry. And details about the Table Columns.\n",
"2. Add improved documentation on the various parameters and how to optimize them based on the metrics."
]
},
{
"cell_type": "markdown",
"id": "bf53473e-9671-4f80-9d59-29c4ed8bab09",
Expand Down Expand Up @@ -890,9 +868,7 @@
"As noted above, improved documentation will be coming. For now, here are some important points to consider.\n",
"See detailed notes in Section 3.1 above about the fitting process and diagnostics\n",
"\n",
"In addition, consider here that jwst3_obs is generating a Level3 PSF by using the JWST pipeline to resample and combine multiple Level2 PSFs. The Level2 PSFs are generated at the precise location of the source in each Level2 file to account for detector level effects. The resampling uses default resampling paramters. However, users should be aware that if they performed customized resampling for their Level2 data products, they should use similar resampling steps for their PSF below. \n",
"\n",
"### DEV NOTE: Create a resampling step with more resampling paramaters."
"In addition, consider here that jwst3_obs is generating a Level3 PSF by using the JWST pipeline to resample and combine multiple Level2 PSFs. The Level2 PSFs are generated at the precise location of the source in each Level2 file to account for detector level effects. The resampling uses default resampling paramters. However, users should be aware that if they performed customized resampling for their Level2 data products, they should use similar resampling steps for their PSF below."
]
},
{
Expand Down Expand Up @@ -1700,50 +1676,6 @@
"t.write('skycoord.ecsv', overwrite=True)"
]
},
{
"cell_type": "markdown",
"id": "abe8c20c-087a-4b59-9f0c-26ccdb3dcbec",
"metadata": {},
"source": [
"#### DEV NOTE: allow space_phot to take pixel coordinates as input"
]
},
{
"cell_type": "markdown",
"id": "0199d630-d0e9-415b-a664-5725b45fa2c0",
"metadata": {},
"source": [
"#### DEV NOTE: Open WebbPSF ticket for webbpsf.gridded_library.CreatePSFLibrary, which is called in get_jwst_psf_from_grid below. The reason for this is that the output from that command currently prints: Position 2/4 centroid: (201.3017584451758, 201.31980818321827), but this is the lower corner of the array. We want a grid across the entire array. The notebook can currently be run as is."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ebc298b0-633b-4915-8f03-b510db3d81cc",
"metadata": {},
"outputs": [],
"source": [
"lvl2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "562f9d50-0884-47c7-923b-9d4e019c247b",
"metadata": {},
"outputs": [],
"source": [
"!pip freeze | grep space_phot"
]
},
{
"cell_type": "markdown",
"id": "1953b4f4-4ec3-4322-abbd-d53a1954c1f5",
"metadata": {},
"source": [
"#### Dev Note: Need Grid Capability for Level3 Data for fater PSF Generation"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1891,14 +1823,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "b6489fb5-e99c-4204-aff6-49402842f5c0",
"metadata": {},
"source": [
"#### Dev Note: Need Grid Capability for Level3 Data for fater PSF Generation"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -2072,7 +1996,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.11.10"
},
"toc-showcode": false
},
Expand Down
Loading

0 comments on commit adb1217

Please sign in to comment.