Skip to content

Commit

Permalink
Add try except statements for when CI does second run of cal pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
srosagomez committed Jul 26, 2024
1 parent 0ef9ff4 commit fa559b7
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions notebooks/HASP/WavelengthAdjustment/WavelengthAdjustment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1397,10 +1397,13 @@
"metadata": {},
"outputs": [],
"source": [
"calcos.calcos(\n",
" f\"{cos_data}/le2701010_asn.fits\",\n",
" outdir=str(cos_shifted),\n",
" shift_file=f\"{cos_data}/shifts.txt\")"
"try:\n",
" calcos.calcos(f\"{cos_data}/le2701010_asn.fits\",\n",
" outdir=str(cos_shifted),\n",
" shift_file=f\"{cos_data}/shifts.txt\")\n",
" \n",
"except RuntimeError as e:\n",
" print('An error occured', e)"
]
},
{
Expand Down Expand Up @@ -2229,8 +2232,12 @@
"metadata": {},
"outputs": [],
"source": [
"stistools.calstis.calstis(str(raw_file),\n",
" outroot=str(stis_shifted))"
"try:\n",
" stistools.calstis.calstis(str(raw_file),\n",
" outroot=str(stis_shifted))\n",
" \n",
"except RuntimeError as e:\n",
" print('An error occured', e)"
]
},
{
Expand Down Expand Up @@ -2377,7 +2384,10 @@
"outputs": [],
"source": [
"width = 7\n",
"shift_stis(ref_file, e1_pos[1], width, plot=False, run_calstis=True)"
"try:\n",
" shift_stis(ref_file, e1_pos[1], width, plot=False, run_calstis=True)\n",
"except RuntimeError as e:\n",
" print('An error occured', e)"
]
},
{
Expand All @@ -2396,7 +2406,10 @@
"outputs": [],
"source": [
"width = 9\n",
"shift_stis(ref_file, e1_pos[2], width, plot=False, run_calstis=True)"
"try:\n",
" shift_stis(ref_file, e1_pos[2], width, plot=False, run_calstis=True)\n",
"except RuntimeError as e:\n",
" print('An error occured', e)"
]
},
{
Expand All @@ -2415,7 +2428,10 @@
"outputs": [],
"source": [
"width = 7\n",
"shift_stis(ref_file, e1_pos[3], width, plot=False, run_calstis=True)"
"try:\n",
" shift_stis(ref_file, e1_pos[3], width, plot=False, run_calstis=True)\n",
"except RuntimeError as e:\n",
" print('An error occured', e)"
]
},
{
Expand All @@ -2436,7 +2452,10 @@
"width = 15\n",
"filepath = stis_unshifted / \"od1am10b0_sx1.fits\"\n",
"\n",
"shift_stis(ref_file, filepath, width, plot=False, run_calstis=True)"
"try:\n",
" shift_stis(ref_file, filepath, width, plot=False, run_calstis=True)\n",
"except RuntimeError as e:\n",
" print('An error occured', e)"
]
},
{
Expand Down

0 comments on commit fa559b7

Please sign in to comment.