Skip to content

Commit

Permalink
Merge remote-tracking branch 'st/main' into current_webbinar
Browse files Browse the repository at this point in the history
  • Loading branch information
eteq committed Apr 28, 2021
2 parents 8cc53c0 + fb62e0b commit 9ee3306
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 61 deletions.
16 changes: 7 additions & 9 deletions pipeline_products_session/jwst-data-products-part1-live.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,17 @@
"# Data for the notebook\n",
"uncal_obs_link = \"https://stsci.box.com/shared/static/mpbrc3lszdjif6kpcw1acol00e0mm2zh.fits\"\n",
"uncal_obs = \"example_nircam_imaging_uncal.fits\"\n",
"demo_file = download_file(uncal_obs_link+uncal_obs)\n",
"demo_file = download_file(uncal_obs_link+uncal_obs, cache=True)\n",
"\n",
"# Data for the exercise \n",
"exercise_obs_link = \"https://stsci.box.com/shared/static/l1aih8rmwbtzyupv8hsl0adfa36why30.fits\"\n",
"exercise_obs = \"example_exercise_uncal.fits\"\n",
"demo_ex_file = download_file(exercise_obs_link+exercise_obs)\n",
"demo_ex_file = download_file(exercise_obs_link+exercise_obs, cache=True)\n",
"\n",
"# Save the files so that we can use them later\n",
"with fits.open(demo_file, ignore_missing_end=True) as f:\n",
" f.writeto(uncal_obs, overwrite=True)\n",
" \n",
"with fits.open(demo_ex_file, ignore_missing_end=True) as f:\n",
" f.writeto(exercise_obs, overwrite=True) "
"# Create local links to the cached copy - this is not necessary - you can use the `demo_file`/`demo_ex_file` \n",
"# names directly. But this is a convenient to see what you've downloaded and remind yourself laiter\n",
"os.symlink(demo_file, uncal_obs)\n",
"os.symlink(demo_ex_file, exercise_obs) "
]
},
{
Expand Down Expand Up @@ -1120,7 +1118,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,17 @@
"# Data for the notebook\n",
"uncal_obs_link = \"https://stsci.box.com/shared/static/mpbrc3lszdjif6kpcw1acol00e0mm2zh.fits\"\n",
"uncal_obs = \"example_nircam_imaging_uncal.fits\"\n",
"demo_file = download_file(uncal_obs_link+uncal_obs)\n",
"demo_file = download_file(uncal_obs_link+uncal_obs, cache=True)\n",
"\n",
"# Data for the exercise \n",
"exercise_obs_link = \"https://stsci.box.com/shared/static/l1aih8rmwbtzyupv8hsl0adfa36why30.fits\"\n",
"exercise_obs = \"example_exercise_uncal.fits\"\n",
"demo_ex_file = download_file(exercise_obs_link+exercise_obs)\n",
"demo_ex_file = download_file(exercise_obs_link+exercise_obs, cache=True)\n",
"\n",
"# Save the files so that we can use them later\n",
"with fits.open(demo_file, ignore_missing_end=True) as f:\n",
" f.writeto(uncal_obs, overwrite=True)\n",
" \n",
"with fits.open(demo_ex_file, ignore_missing_end=True) as f:\n",
" f.writeto(exercise_obs, overwrite=True) "
"# Create local links to the cached copy - this is not necessary - you can use the `demo_file`/`demo_ex_file` \n",
"# names directly. But this is a convenient to see what you've downloaded and remind yourself laiter\n",
"os.symlink(demo_file, uncal_obs)\n",
"os.symlink(demo_ex_file, exercise_obs) "
]
},
{
Expand Down Expand Up @@ -1164,7 +1162,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.4"
}
},
"nbformat": 4,
Expand Down
19 changes: 9 additions & 10 deletions pipeline_products_session/jwst-data-products-part2-live.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,10 @@
" demo_ex_file]\n",
"\n",
"for file in all_files:\n",
" demo_file = download_file(file[0])\n",
" demo_file = download_file(file[0], cache=True)\n",
" \n",
" # Save the file so that we can use it later\n",
" with fits.open(demo_file) as f:\n",
" f.writeto(file[1], overwrite=True)"
" # Make a symbolic link using a local name for convenience\n",
" os.symlink(demo_file, file[1])"
]
},
{
Expand Down Expand Up @@ -482,7 +481,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the WFSS image into the appropriate model (hint: ImageModel)\n"
"# Load the WFSS image (`wfss_rate_file[1]`) into the appropriate model (hint: ImageModel)\n"
]
},
{
Expand Down Expand Up @@ -691,7 +690,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the calibrated WFSS data into a MultiSpecModel (use: cal_wfss) \n"
"# Load the calibrated WFSS data into a MultiSlitModel (use: cal_wfss) \n"
]
},
{
Expand Down Expand Up @@ -1106,7 +1105,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Do the detector to world transformormation for pixel (3, 500)\n"
"# Do the detector to world transformation for pixel (3, 500)\n"
]
},
{
Expand Down Expand Up @@ -1188,7 +1187,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the WFSS image into the appropriate model (hint: ImageModel)\n",
"# Load the WFSS image (`wfss_rate_file[1]`) into the appropriate model (hint: ImageModel)\n",
"wfss_image = datamodels.ImageModel(wfss_rate_file[1])"
]
},
Expand Down Expand Up @@ -1235,7 +1234,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Do the detector to world transformormation for pixel (3, 500)\n",
"# Do the detector to world transformation for pixel (3, 500)\n",
"ra, dec = d2w(3, 500)"
]
},
Expand Down Expand Up @@ -1283,7 +1282,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.4"
}
},
"nbformat": 4,
Expand Down
23 changes: 11 additions & 12 deletions pipeline_products_session/jwst-data-products-part2-solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,10 @@
" demo_ex_file]\n",
"\n",
"for file in all_files:\n",
" demo_file = download_file(file[0])\n",
" demo_file = download_file(file[0], cache=True)\n",
" \n",
" # Save the file so that we can use it later\n",
" with fits.open(demo_file) as f:\n",
" f.writeto(file[1], overwrite=True)"
" # Make a symbolic link using a local name for convenience\n",
" os.symlink(demo_file, file[1])"
]
},
{
Expand Down Expand Up @@ -492,7 +491,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the WFSS image into the appropriate model (hint: ImageModel)\n"
"# Load the WFSS image (`wfss_rate_file[1]`) into the appropriate model (hint: ImageModel)\n"
]
},
{
Expand Down Expand Up @@ -704,8 +703,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the calibrated WFSS data into a MultiSpecModel (use: cal_wfss) \n",
"cal_wfss = datamodels.MultiSpecModel(wfss_cal_file[1])"
"# Load the calibrated WFSS data into a MultiSlitModel (use: cal_wfss) \n",
"cal_wfss = datamodels.MultiSlitModel(wfss_cal_file[1])"
]
},
{
Expand Down Expand Up @@ -857,7 +856,7 @@
"outputs": [],
"source": [
"# Get the source ID and spectral order for slit 3 using the model \n",
"spec.spec[3].source_id, spec.spec[3].spectral_order"
"spec.spec[2].source_id, spec.spec[2].spectral_order"
]
},
{
Expand Down Expand Up @@ -1158,7 +1157,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Do the detector to world transformormation for pixel (3, 500)\n"
"# Do the detector to world transformation for pixel (3, 500)\n"
]
},
{
Expand Down Expand Up @@ -1240,7 +1239,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the WFSS image into the appropriate model (hint: ImageModel)\n",
"# Load the WFSS image (`wfss_rate_file[1]`) into the appropriate model (hint: ImageModel)\n",
"wfss_image = datamodels.ImageModel(wfss_rate_file[1])"
]
},
Expand Down Expand Up @@ -1287,7 +1286,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Do the detector to world transformormation for pixel (3, 500)\n",
"# Do the detector to world transformation for pixel (3, 500)\n",
"ra, dec = d2w(3, 500)"
]
},
Expand Down Expand Up @@ -1335,7 +1334,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.4"
}
},
"nbformat": 4,
Expand Down
18 changes: 8 additions & 10 deletions pipeline_products_session/jwst-data-products-part3-live.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -272,24 +272,22 @@
"source": [
"# For the catalog file:\n",
"catalog_file_link = 'https://stsci.box.com/shared/static/272qsdpoax1cchy0gox96mobjpol780n.ecsv'\n",
"output_catalog = download_file(catalog_file_link)\n",
"output_catalog = download_file(catalog_file_link, cache=True)\n",
"\n",
"# For the NIRCam combined 2D image:\n",
"combined_i2d_file_link = 'https://stsci.box.com/shared/static/1xjdi28u5o1lmkmau0wuojdyv8fnre5n.fits'\n",
"combined_i2d = download_file(combined_i2d_file_link)\n",
"combined_i2d = download_file(combined_i2d_file_link, cache=True)\n",
"combined_i2d_file = \"example_nircam_imaging_i2d.fits\"\n",
"\n",
"# For the NIRCam WFSS 1D file:\n",
"final_c1d_file_link = 'https://stsci.box.com/shared/static/ixfnu50ju78vs40dcec8i7w0u6kwtoli.fits'\n",
"final_c1d = download_file(final_c1d_file_link)\n",
"final_c1d = download_file(final_c1d_file_link, cache=True)\n",
"final_c1d_file = \"example_nircam_wfss_c1d.fits\"\n",
"\n",
"# Save the files so that we can use them later\n",
"with fits.open(combined_i2d, ignore_missing_end=True) as f:\n",
" f.writeto(combined_i2d_file, overwrite=True)\n",
" \n",
"with fits.open(final_c1d, ignore_missing_end=True) as f:\n",
" f.writeto(final_c1d_file, overwrite=True) "
"# Create local links to the cached copies of the fits file. This is not necessary - you can use \n",
"#`combined_i2d`/`final_c1d` directly. But this is convenient to remind yourself later what you downloaded\n",
"os.symlink(combined_i2d, combined_i2d_file)\n",
"os.symlink(final_c1d, final_c1d_file) "
]
},
{
Expand Down Expand Up @@ -1058,7 +1056,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.4"
}
},
"nbformat": 4,
Expand Down
20 changes: 9 additions & 11 deletions pipeline_products_session/jwst-data-products-part3-solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -272,24 +272,22 @@
"source": [
"# For the catalog file:\n",
"catalog_file_link = 'https://stsci.box.com/shared/static/272qsdpoax1cchy0gox96mobjpol780n.ecsv'\n",
"output_catalog = download_file(catalog_file_link)\n",
"output_catalog = download_file(catalog_file_link, cache=True)\n",
"\n",
"# For the NIRCam combined 2D image:\n",
"combined_i2d_file_link = 'https://stsci.box.com/shared/static/1xjdi28u5o1lmkmau0wuojdyv8fnre5n.fits'\n",
"combined_i2d = download_file(combined_i2d_file_link)\n",
"combined_i2d = download_file(combined_i2d_file_link, cache=True)\n",
"combined_i2d_file = \"example_nircam_imaging_i2d.fits\"\n",
"\n",
"# For the NIRCam WFSS 1D file:\n",
"final_c1d_file_link = 'https://stsci.box.com/shared/static/ixfnu50ju78vs40dcec8i7w0u6kwtoli.fits'\n",
"final_c1d = download_file(final_c1d_file_link)\n",
"final_c1d_file = \"example_nircam_wfss_c1d.fits\"\n",
"final_c1d = download_file(final_c1d_file_link, cache=True)\n",
"final_c1d_file = \"example_nircam_wfss_c1d.fits\" \n",
"\n",
"# Save the files so that we can use them later\n",
"with fits.open(combined_i2d, ignore_missing_end=True) as f:\n",
" f.writeto(combined_i2d_file, overwrite=True)\n",
" \n",
"with fits.open(final_c1d, ignore_missing_end=True) as f:\n",
" f.writeto(final_c1d_file, overwrite=True) "
"# Create local links to the cached copies of the fits file. This is not necessary - you can use \n",
"#`combined_i2d`/`final_c1d` directly. But this is convenient to remind yourself later what you downloaded\n",
"os.symlink(combined_i2d, combined_i2d_file)\n",
"os.symlink(final_c1d, final_c1d_file) "
]
},
{
Expand Down Expand Up @@ -1076,7 +1074,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 9ee3306

Please sign in to comment.