Skip to content

Commit 2f0e6c6

Browse files
committed
ensure pipeline steps have access to necessary reference files
1 parent 9a81d76 commit 2f0e6c6

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

notebooks/NIRCam/NIRCam_WFSS_Box_extraction/BoxExtraction_using_Grismconf_CRDS.ipynb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"import requests\n",
7070
"from scipy.stats import sigmaclip\n",
7171
"\n",
72+
"from crds import client\n",
7273
"import grismconf\n",
7374
"from jwst.assign_wcs import AssignWcsStep\n",
7475
"from jwst.flatfield import FlatFieldStep\n",
@@ -198,7 +199,7 @@
198199
"id": "41068262-9a54-46c5-a9d2-ca2217ad1fee",
199200
"metadata": {},
200201
"source": [
201-
"## Download Data"
202+
"## Download Data and Ensure CRDS Configuration"
202203
]
203204
},
204205
{
@@ -223,6 +224,28 @@
223224
"get_jwst_file(wfss_file)"
224225
]
225226
},
227+
{
228+
"cell_type": "markdown",
229+
"id": "faa27c94",
230+
"metadata": {},
231+
"source": [
232+
"If CRDS is not configured, set the CRDS server URL and define a local cache path \n",
233+
"to ensure the pipeline steps can access reference files as needed."
234+
]
235+
},
236+
{
237+
"cell_type": "code",
238+
"execution_count": null,
239+
"id": "af7a4057",
240+
"metadata": {},
241+
"outputs": [],
242+
"source": [
243+
"if os.environ.get(\"CRDS_PATH\") is None:\n",
244+
" client.set_crds_server('https://jwst-crds.stsci.edu')\n",
245+
" os.environ[\"CRDS_SERVER_URL\"] = \"https://jwst-crds.stsci.edu\"\n",
246+
" os.environ[\"CRDS_PATH\"] = \"\""
247+
]
248+
},
226249
{
227250
"cell_type": "markdown",
228251
"id": "ab5f3c78-258f-49c4-99c4-87e26f0972cf",

notebooks/NIRCam/NIRCam_WFSS_Box_extraction/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ jwst >= 1.16.0
55
matplotlib >= 3.9.2
66
numpy == 1.26.4
77
requests >= 2.32.3
8-
scipy >= 1.14.1
8+
scipy >= 1.14.1
9+
crds >= 12.0.4

0 commit comments

Comments
 (0)