Skip to content

Commit

Permalink
switch to using symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
eteq committed Apr 28, 2021
1 parent 56afeb9 commit 5cd3ce0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 31 deletions.
10 changes: 4 additions & 6 deletions pipeline_products_session/jwst-data-products-part1-live.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,10 @@
"exercise_obs = \"example_exercise_uncal.fits\"\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
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,10 @@
"exercise_obs = \"example_exercise_uncal.fits\"\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
5 changes: 2 additions & 3 deletions pipeline_products_session/jwst-data-products-part2-live.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@
"for file in all_files:\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
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@
"for file in all_files:\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
10 changes: 4 additions & 6 deletions pipeline_products_session/jwst-data-products-part3-live.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,10 @@
"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
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,12 @@
"# 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, cache=True)\n",
"final_c1d_file = \"example_nircam_wfss_c1d.fits\"\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

0 comments on commit 5cd3ce0

Please sign in to comment.