Skip to content

Commit

Permalink
add cell to allow creation of output variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Nov 22, 2024
1 parent c0207a9 commit 695871e
Showing 1 changed file with 70 additions and 28 deletions.
98 changes: 70 additions & 28 deletions notebooks/HASP/DataDiagnostic/DataDiagnostics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,17 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from astropy.io import fits\n",
"from astropy.table import vstack\n",
"from astroquery.mast import Observations\n",
"import glob\n",
"\n",
"import os\n",
"import glob\n",
"import shutil\n",
"import numpy as np\n",
"from pathlib import Path\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib widget\n",
"import io\n",
"\n",
"plt.rcParams['figure.figsize'] = 10, 6\n",
"plt.style.use('seaborn-v0_8-colorblind')\n",
Expand Down Expand Up @@ -292,7 +292,7 @@
},
"outputs": [],
"source": [
"output = io.StringIO()\n",
"%%capture output\n",
"\n",
"# Querying and downloading calibrated products\n",
"query_ex1 = Observations.query_criteria(\n",
Expand Down Expand Up @@ -336,10 +336,17 @@
")\n",
"\n",
"# Organizing the files \n",
"consolidate_files(datadir_ex1)\n",
"\n",
"consolidate_files(datadir_ex1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('output.txt', 'a') as file:\n",
" file.write(output.getvalue())"
" file.write(output.stdout)"
]
},
{
Expand Down Expand Up @@ -753,12 +760,19 @@
"metadata": {},
"outputs": [],
"source": [
"output = io.StringIO()\n",
"!swrapper -i ./12715/newcoadddata -o ./12715/newcoadddata/products -k\n",
"%%capture output\n",
"\n",
"# Write the captured output to a file\n",
"!swrapper -i ./12715/newcoadddata -o ./12715/newcoadddata/products -k"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('output.txt', 'a') as file:\n",
" file.write(output.getvalue())"
" file.write(output.stdout)"
]
},
{
Expand Down Expand Up @@ -911,7 +925,7 @@
"metadata": {},
"outputs": [],
"source": [
"output = io.StringIO()\n",
"%%capture output\n",
"\n",
"# Querying and downloading calibrated products\n",
"query_ex2 = Observations.query_criteria(\n",
Expand Down Expand Up @@ -959,10 +973,17 @@
")\n",
"\n",
"# Organizing the files \n",
"consolidate_files(datadir_ex2)\n",
"\n",
"consolidate_files(datadir_ex2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('output.txt', 'a') as file:\n",
" file.write(output.getvalue())"
" file.write(output.stdout)"
]
},
{
Expand Down Expand Up @@ -1143,16 +1164,23 @@
"metadata": {},
"outputs": [],
"source": [
"output = io.StringIO()\n",
"%%capture output\n",
"\n",
"!swrapper -i ./16655/newcoadddata_p-0.05 -o ./16655/newcoadddata_p-0.05/products -k -t -999\n",
"!swrapper -i ./16655/newcoadddata_p-0.025 -o ./16655/newcoadddata_p-0.025/products -k -t -999\n",
"!swrapper -i ./16655/newcoadddata_p0.0 -o ./16655/newcoadddata_p0.0/products -k -t -999\n",
"!swrapper -i ./16655/newcoadddata_p0.025 -o ./16655/newcoadddata_p0.025/products -k -t -999\n",
"!swrapper -i ./16655/newcoadddata_p0.05 -o ./16655/newcoadddata_p0.05/products -k -t -999\n",
"\n",
"!swrapper -i ./16655/newcoadddata_p0.05 -o ./16655/newcoadddata_p0.05/products -k -t -999"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('output.txt', 'a') as file:\n",
" file.write(output.getvalue())"
" file.write(output.stdout)"
]
},
{
Expand Down Expand Up @@ -1296,7 +1324,7 @@
},
"outputs": [],
"source": [
"output = io.StringIO()\n",
"%%capture output\n",
"\n",
"# Querying and downloading calibrated products\n",
"query_ex3 = Observations.query_criteria(\n",
Expand Down Expand Up @@ -1342,10 +1370,17 @@
")\n",
"\n",
"# Organizing the files \n",
"consolidate_files(datadir_ex3)\n",
"\n",
"consolidate_files(datadir_ex3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('output.txt', 'a') as file:\n",
" file.write(output.getvalue())"
" file.write(output.stdout)"
]
},
{
Expand Down Expand Up @@ -1481,12 +1516,19 @@
},
"outputs": [],
"source": [
"output = io.StringIO()\n",
"\n",
"!swrapper -i ./16196/ -o ./16196/products_nofluxfilter -t -999\n",
"%%capture output\n",
"\n",
"!swrapper -i ./16196/ -o ./16196/products_nofluxfilter -t -999"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('output.txt', 'a') as file:\n",
" file.write(output.getvalue())"
" file.write(output.stdout)"
]
},
{
Expand Down

0 comments on commit 695871e

Please sign in to comment.