Skip to content

Commit 602fba8

Browse files
committed
move crds config to right below imports
1 parent bc8d377 commit 602fba8

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

notebooks/NIRCam/NIRCam_WFSS_Box_extraction/BoxExtraction_using_Grismconf_CRDS.ipynb

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,49 @@
7575
"from jwst.photom import PhotomStep"
7676
]
7777
},
78+
{
79+
"cell_type": "markdown",
80+
"id": "d6b0fc4b",
81+
"metadata": {},
82+
"source": [
83+
"## Set CRDS Path and Server"
84+
]
85+
},
86+
{
87+
"cell_type": "markdown",
88+
"id": "bb09075d-b0ba-4bee-b6c5-a2f27b767b6a",
89+
"metadata": {},
90+
"source": [
91+
"Before running the pipeline steps, we need to ensure our our CRDS environment is configured. This includes defining a CRDS cache directory in which to keep the reference files that will be used by the calibration pipeline.\n",
92+
"\n",
93+
"If the root directory for the local CRDS cache has not already been set, it will be created in the home directory."
94+
]
95+
},
96+
{
97+
"cell_type": "code",
98+
"execution_count": null,
99+
"id": "0ab935ab-a215-4fe3-8aad-b3dae5a017bb",
100+
"metadata": {},
101+
"outputs": [],
102+
"source": [
103+
"# Check whether the local CRDS cache directory has been set.\n",
104+
"# If not, set it to the user home directory\n",
105+
"if (os.getenv('CRDS_PATH') is None):\n",
106+
" os.environ['CRDS_PATH'] = os.path.join(os.path.expanduser('~'), 'crds')\n",
107+
"# Check whether the CRDS server URL has been set. If not, set it.\n",
108+
"if (os.getenv('CRDS_SERVER_URL') is None):\n",
109+
" os.environ['CRDS_SERVER_URL'] = 'https://jwst-crds.stsci.edu'\n",
110+
"\n",
111+
"# Echo CRDS path and context in use\n",
112+
"print('CRDS local filepath:', os.environ['CRDS_PATH'])\n",
113+
"print('CRDS file server:', os.environ['CRDS_SERVER_URL'])\n",
114+
"\n",
115+
"# import crds after setting up the required environment variables\n",
116+
"from crds import client\n",
117+
"if client.get_crds_server() != os.environ['CRDS_SERVER_URL']:\n",
118+
" client.set_crds_server('https://jwst-crds.stsci.edu')"
119+
]
120+
},
78121
{
79122
"cell_type": "markdown",
80123
"id": "117e4ec7-610c-4d11-82f4-756971dc23e0",
@@ -223,49 +266,6 @@
223266
"get_jwst_file(wfss_file)"
224267
]
225268
},
226-
{
227-
"cell_type": "markdown",
228-
"id": "d6b0fc4b",
229-
"metadata": {},
230-
"source": [
231-
"## Set CRDS Path and Server"
232-
]
233-
},
234-
{
235-
"cell_type": "markdown",
236-
"id": "faa27c94",
237-
"metadata": {},
238-
"source": [
239-
"Before running the pipeline steps, we need to ensure our our CRDS environment is configured. This includes defining a CRDS cache directory in which to keep the reference files that will be used by the calibration pipeline.\n",
240-
"\n",
241-
"If the root directory for the local CRDS cache has not already been set, it will be created in the home directory."
242-
]
243-
},
244-
{
245-
"cell_type": "code",
246-
"execution_count": null,
247-
"id": "da17a337",
248-
"metadata": {},
249-
"outputs": [],
250-
"source": [
251-
"# Check whether the local CRDS cache directory has been set.\n",
252-
"# If not, set it to the user home directory\n",
253-
"if (os.getenv('CRDS_PATH') is None):\n",
254-
" os.environ['CRDS_PATH'] = os.path.join(os.path.expanduser('~'), 'crds')\n",
255-
"# Check whether the CRDS server URL has been set. If not, set it.\n",
256-
"if (os.getenv('CRDS_SERVER_URL') is None):\n",
257-
" os.environ['CRDS_SERVER_URL'] = 'https://jwst-crds.stsci.edu'\n",
258-
"\n",
259-
"# Echo CRDS path and context in use\n",
260-
"print('CRDS local filepath:', os.environ['CRDS_PATH'])\n",
261-
"print('CRDS file server:', os.environ['CRDS_SERVER_URL'])\n",
262-
"\n",
263-
"# import crds after setting up the required environment variables\n",
264-
"from crds import client\n",
265-
"if client.get_crds_server() != os.environ['CRDS_SERVER_URL']:\n",
266-
" client.set_crds_server('https://jwst-crds.stsci.edu')"
267-
]
268-
},
269269
{
270270
"cell_type": "markdown",
271271
"id": "ab5f3c78-258f-49c4-99c4-87e26f0972cf",

0 commit comments

Comments
 (0)