Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workshop for Build 14 #31

Merged
merged 7 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions 05-Intro_Roman_Pipeline/05-Intro_Roman_Pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "875abca6",
"metadata": {},
"outputs": [],
"source": [
"from romancal.pipeline import ExposurePipeline"
"from romancal.pipeline import ExposurePipeline\n",
"import os\n",
"os.environ[\"WEBBPSF_PATH\"] = os.getcwd()+\"/../data/webbpsf-data\""
]
},
{
Expand Down Expand Up @@ -487,7 +489,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
21 changes: 15 additions & 6 deletions data/download.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import shutil
from pathlib import Path
import requests



from astropy.utils.data import download_file

REMOTE_URL = "https://data.science.stsci.edu/redirect/Roman/Roman_Data_Workshop/"
REMOTE_PATHS = [
"ExampleData/Build13/r0000101001001001001_01101_0001_WFI01_uncal.asdf",
"ExampleData/Build13/r0000101001001001001_01101_0001_WFI01_cal.asdf",
"ExampleData/Build13/r0000101001001001001_01101_0001_WFI16_uncal.asdf",
"ExampleData/Build13/r0000101001001001001_01101_0001_WFI16_cal.asdf",
"ExampleData/Build13/r0000201001001001001_01101_0001_WFI01_cal.asdf",
"ExampleData/Build14/r0000101001001001001_01101_0001_WFI01_uncal.asdf",
"ExampleData/Build14/r0000101001001001001_01101_0001_WFI01_cal.asdf",
"ExampleData/Build14/r0000101001001001001_01101_0001_WFI16_uncal.asdf",
"ExampleData/Build14/r0000101001001001001_01101_0001_WFI16_cal.asdf",
"ExampleData/Build14/r0000201001001001001_01101_0001_WFI01_cal.asdf",
"ExampleData/jw01448013001_02105_00001_nis_rate.fits",
"ExampleData/jw01448013001_02106_00001_nis_rate.fits",
"ExampleData/jw01448013001_02106_00001_nis_cat.ecsv",
Expand All @@ -19,6 +22,7 @@
"ExampleData/jwst_niriss_wavelengthrange_0002.asdf",
]
LOCAL_DIRECTORY = Path(__file__).parent
WEBBPSF_DATA = Path('./data')/'Webbpsf-data-LATEST.tar.gz'


def download_data(overwrite: bool = False):
Expand All @@ -29,8 +33,13 @@ def download_data(overwrite: bool = False):
filename = download_file(REMOTE_URL + remote_path)
shutil.move(filename, local_path)

print("Done downloading files")
response = requests.get('https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz')

with open(WEBBPSF_DATA, 'wb') as f:
f.write(response.content)

print("Done downloading files")

if __name__ == "__main__":
download_data()
shutil.unpack_archive(WEBBPSF_DATA, Path('./data'))
Loading