Skip to content

Instantly share code, notes, and snippets.

@zkbt
Created April 1, 2022 16:50
Show Gist options
  • Save zkbt/ec890817811750e9a85cfd1a6cb84e23 to your computer and use it in GitHub Desktop.
Save zkbt/ec890817811750e9a85cfd1a6cb84e23 to your computer and use it in GitHub Desktop.
reading lots of different ers-transit time-series extracted spectra
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "5f255272",
"metadata": {},
"source": [
"# Reading Lots of `ers-transit` Time-series Spectra ⏰🌈\n",
"\n",
"This notebook tries to read every file of time-series extracted spectra that was submitted for the [ers-transit Spring 2022 Data Challenge with Simulated Data](https://ers-transit.github.io/data-challenge-with-simulated-data.html). It then saves them all out in a few uniform formats, to help other folks be able to compare between them."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "95a0a24b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'0.0.17'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from chromatic import *\n",
"version()"
]
},
{
"cell_type": "markdown",
"id": "533825e9",
"metadata": {},
"source": [
"Let's create a dictionary in which we'll store everything we load."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "ebb3d077",
"metadata": {},
"outputs": [],
"source": [
"rainbows = {}"
]
},
{
"cell_type": "markdown",
"id": "55fa5ee5",
"metadata": {},
"source": [
"Let's define a base directory, in which all the data can be found."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2fcc1092",
"metadata": {},
"outputs": [],
"source": [
"directory = '/Users/zach/Data/JWST/Spring2022DataChallenge/submissions/C-time-series-extracted-1D-spectra/'"
]
},
{
"cell_type": "markdown",
"id": "7cb005ca",
"metadata": {},
"source": [
"# NIRISS"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2ddb73ce",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: \n",
"The times are totally made up!\n",
"🌈 Warning: \n",
"Loading NIRISS order '1'. If you want the other order,\n",
"trying `r = Rainbow(..., format='radica', order=2)`\n",
"\n",
"🌈 Warning: \n",
"Uncertainties were all 0, replacing them with 1!\n",
"🌈 Warning: \n",
"Loading NIRISS order '2'. If you want the other order,\n",
"trying `r = Rainbow(..., format='radica', order=2)`\n"
]
}
],
"source": [
"# Michael Radica\n",
"for order in [1,2]:\n",
" rainbows[f'NIRISS-Radica-order{order}-atoca'] = Rainbow(directory + 'NIRISS-SOSS/Michael Radica/ers_atocaspectra.fits', \n",
" format='radica', \n",
" order=order)\n",
" rainbows[f'NIRISS-Radica-order{order}-extract'] = Rainbow(directory + 'NIRISS-SOSS/Michael Radica/ers_extract1d.fits', \n",
" format='radica', \n",
" order=order)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "f3390344",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4/4 [00:03<00:00, 1.05it/s]\n",
"\n",
"🌈 Warning: \n",
"Loading NIRISS order '1'. If you want the other order,\n",
"trying `r = Rainbow(..., format='coloumbe', order=2)`\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4/4 [00:03<00:00, 1.13it/s]\n",
"\n",
"🌈 Warning: \n",
"Loading NIRISS order '2'. If you want the other order,\n",
"trying `r = Rainbow(..., format='coloumbe', order=3)`\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4/4 [00:03<00:00, 1.27it/s]\n",
"\n",
"🌈 Warning: \n",
"Loading NIRISS order '3'. If you want the other order,\n",
"trying `r = Rainbow(..., format='coloumbe', order=0)`\n"
]
}
],
"source": [
"# Louis-Philippe Coulombe\n",
"for order in [1,2,3]:\n",
" rainbows[f'NIRISS-Coulombe-order{order}'] = Rainbow(directory + '/NIRISS-SOSS/Louis-Philippe Coulombe/WASP39_NIS_SOSS-seg*_CLEAR_x1dints.fits', \n",
" format='coloumbe', \n",
" order=order)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "dacaca29",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: The times are totally made up!\n",
"🌈 Warning: divide by zero encountered in log\n",
"🌈 Warning: invalid value encountered in subtract"
]
}
],
"source": [
"# Adina Feinstein\n",
"for order in [1,2]:\n",
" rainbows[f'NIRISS-Feinstein-order{order}'] = Rainbow(directory + f'NIRISS-SOSS/Adina Feinstein/box_extracted_order{order}.npy', \n",
" format='feinstein')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "f5399848",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: The times are totally made up!"
]
}
],
"source": [
"# Leo Dos Santos\n",
"for order in [1,2]:\n",
" rainbows[f'NIRISS-dosSantos-order{order}'] = Rainbow(directory + 'NIRISS-SOSS/Leonardo Dos Santos/spectra.pkl', \n",
" format='dossantos')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "281ee4f0",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: The times are totally made up!"
]
}
],
"source": [
"# the spectra that were made available with the simulated data\n",
"for order in [1,2]:\n",
" rainbows[f'NIRISS-with-simulations-order{order}'] = Rainbow(directory + f'NIRISS-SOSS/with-simulations/*order{order}.npy', \n",
" format='espinoza')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "16649029",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'NIRISS-Radica-order1-atoca': <🌈(2034w, 537t)>,\n",
" 'NIRISS-Radica-order1-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Radica-order2-atoca': <🌈(1795w, 537t)>,\n",
" 'NIRISS-Radica-order2-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Coulombe-order1': <🌈(2041w, 537t)>,\n",
" 'NIRISS-Coulombe-order2': <🌈(1834w, 537t)>,\n",
" 'NIRISS-Coulombe-order3': <🌈(839w, 537t)>,\n",
" 'NIRISS-Feinstein-order1': <🌈(2048w, 142t)>,\n",
" 'NIRISS-Feinstein-order2': <🌈(2048w, 142t)>,\n",
" 'NIRISS-dosSantos-order1': <🌈(2040w, 142t)>,\n",
" 'NIRISS-dosSantos-order2': <🌈(2040w, 142t)>,\n",
" 'NIRISS-with-simulations-order1': <🌈(2040w, 537t)>,\n",
" 'NIRISS-with-simulations-order2': <🌈(1237w, 537t)>}"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rainbows"
]
},
{
"cell_type": "markdown",
"id": "39970baf",
"metadata": {},
"source": [
"# NIRSpec"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "888cd611",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: No times found! Making up imaginary ones!\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:44<00:00, 44.60s/it]\n"
]
}
],
"source": [
"# David Sing\n",
"rainbows['NIRSpec-Sing'] = Rainbow(directory + 'NIRSpec-PRISM/David_Sing/enmasse_extract1dstep_aligned_X1D.fits', \n",
" format='x1dints')"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "e5f2b661",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 350/350 [00:00<00:00, 20027.37it/s]\n"
]
}
],
"source": [
"# Caroline Piaulet\n",
"rainbows['NIRSpec-Piaulet'] = Rainbow(directory + 'NIRSpec-PRISM/CarolinePiaulet/S3_nirspec_prism_withAC_ap8_bg10_Table_Save.txt',\n",
" format='eureka')"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "5b523aa7",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 380/380 [00:00<00:00, 2815.15it/s]\n"
]
}
],
"source": [
"# Aayrnn Carter\n",
"rainbows['NIRSpec-Carter'] = Rainbow(directory + 'NIRSpec-PRISM/AarynnCarter/S3_nirspec_fs_template_ap8_bg10_Table_Save.txt', \n",
" format='eureka')"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "8ac5542d",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:44<00:00, 44.39s/it]\n"
]
}
],
"source": [
"# the spectra that were made available with the simulated data\n",
"rainbows['NIRSpec-with-simulations'] = Rainbow(directory + 'NIRSpec-PRISM/with-simulations/*x1dints.fits', \n",
" format='x1dints')"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "dcf7eba2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'NIRISS-Radica-order1-atoca': <🌈(2034w, 537t)>,\n",
" 'NIRISS-Radica-order1-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Radica-order2-atoca': <🌈(1795w, 537t)>,\n",
" 'NIRISS-Radica-order2-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Coulombe-order1': <🌈(2041w, 537t)>,\n",
" 'NIRISS-Coulombe-order2': <🌈(1834w, 537t)>,\n",
" 'NIRISS-Coulombe-order3': <🌈(839w, 537t)>,\n",
" 'NIRISS-Feinstein-order1': <🌈(2048w, 142t)>,\n",
" 'NIRISS-Feinstein-order2': <🌈(2048w, 142t)>,\n",
" 'NIRISS-dosSantos-order1': <🌈(2040w, 142t)>,\n",
" 'NIRISS-dosSantos-order2': <🌈(2040w, 142t)>,\n",
" 'NIRISS-with-simulations-order1': <🌈(2040w, 537t)>,\n",
" 'NIRISS-with-simulations-order2': <🌈(1237w, 537t)>,\n",
" 'NIRSpec-Sing': <🌈(432w, 8192t)>,\n",
" 'NIRSpec-Piaulet': <🌈(350w, 32t)>,\n",
" 'NIRSpec-Carter': <🌈(380w, 8192t)>,\n",
" 'NIRSpec-with-simulations': <🌈(432w, 8192t)>}"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rainbows"
]
},
{
"cell_type": "markdown",
"id": "795cafb9",
"metadata": {},
"source": [
"# MIRI\n"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "374c2f3e",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 43/43 [00:03<00:00, 13.19it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 43/43 [00:03<00:00, 14.10it/s]\n"
]
}
],
"source": [
"# Michael Zhang\n",
"for d in ['drift', 'nodrift']:\n",
" rainbows[f'MIRI-Zhang-{d}'] = Rainbow(directory + f'MIRI-LRS/MichaelZhang/{d}/x1d*.fits', \n",
" format='x1dints')"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "e7a3197d",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 230/230 [00:00<00:00, 10088.58it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 230/230 [00:00<00:00, 10356.64it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 230/230 [00:00<00:00, 10428.52it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 230/230 [00:00<00:00, 10341.65it/s]\n"
]
}
],
"source": [
"for d in ['Drift', 'No Drift']:\n",
" for a in ['ap2bg3', 'ap4bg10']:\n",
" filepath = glob.glob(directory + f'MIRI-LRS/TaylorJBell/{d}/{a}/S3_miri_lrs_*_Table_Save.txt')[0]\n",
" rainbows[f'MIRI-Bell-{d.lower().replace(\" \", \"\")}-{a}'] = Rainbow(filepath) "
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "6003bad8",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 42/42 [00:05<00:00, 7.13it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 42/42 [00:05<00:00, 7.45it/s]\n"
]
}
],
"source": [
"# the spectra that were made available with the simulated data\n",
"for d in ['drift', 'nodrift']:\n",
" rainbows[f'MIRI-with-simulations-{d}'] = Rainbow(directory + f'MIRI-LRS/with-simulations/{d}/*x1dints.fits', \n",
" format='x1dints')"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "8775d091",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'NIRISS-Radica-order1-atoca': <🌈(2034w, 537t)>,\n",
" 'NIRISS-Radica-order1-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Radica-order2-atoca': <🌈(1795w, 537t)>,\n",
" 'NIRISS-Radica-order2-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Coulombe-order1': <🌈(2041w, 537t)>,\n",
" 'NIRISS-Coulombe-order2': <🌈(1834w, 537t)>,\n",
" 'NIRISS-Coulombe-order3': <🌈(839w, 537t)>,\n",
" 'NIRISS-Feinstein-order1': <🌈(2048w, 142t)>,\n",
" 'NIRISS-Feinstein-order2': <🌈(2048w, 142t)>,\n",
" 'NIRISS-dosSantos-order1': <🌈(2040w, 142t)>,\n",
" 'NIRISS-dosSantos-order2': <🌈(2040w, 142t)>,\n",
" 'NIRISS-with-simulations-order1': <🌈(2040w, 537t)>,\n",
" 'NIRISS-with-simulations-order2': <🌈(1237w, 537t)>,\n",
" 'NIRSpec-Sing': <🌈(432w, 8192t)>,\n",
" 'NIRSpec-Piaulet': <🌈(350w, 32t)>,\n",
" 'NIRSpec-Carter': <🌈(380w, 8192t)>,\n",
" 'NIRSpec-with-simulations': <🌈(432w, 8192t)>,\n",
" 'MIRI-Zhang-drift': <🌈(416w, 1849t)>,\n",
" 'MIRI-Zhang-nodrift': <🌈(416w, 1849t)>,\n",
" 'MIRI-Bell-drift-ap2bg3': <🌈(230w, 1848t)>,\n",
" 'MIRI-Bell-drift-ap4bg10': <🌈(230w, 1848t)>,\n",
" 'MIRI-Bell-nodrift-ap2bg3': <🌈(230w, 1848t)>,\n",
" 'MIRI-Bell-nodrift-ap4bg10': <🌈(230w, 1848t)>,\n",
" 'MIRI-with-simulations-drift': <🌈(387w, 1848t)>,\n",
" 'MIRI-with-simulations-nodrift': <🌈(387w, 1848t)>}"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rainbows"
]
},
{
"cell_type": "markdown",
"id": "15272956",
"metadata": {},
"source": [
"# NIRCam"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "872358b5",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 774144/774144 [01:21<00:00, 9490.97it/s]\n",
"\n",
"🌈 Warning: \n",
"Hmmm...it's not clear which column corresponds to the\n",
"flux uncertainties for this Rainbow object. The\n",
"available `fluxlike` columns are:\n",
" dict_keys(['flux', 'error'])\n",
"A long-term solution might be to fix the `from_x1dints`\n",
"reader, but a short-term solution would be to pick one\n",
"of the columns listed above and say something like\n",
"\n",
"x.fluxlike['uncertainty'] = x.fluxlike['some-other-relevant-error-column']\n",
"\n",
"where `x` is the Rainbow you just created.\n"
]
}
],
"source": [
"# DominiquePetit\n",
"rainbows['NIRCam-Petit-systematics'] = Rainbow(directory + 'NIRCam-F322W2/DominiquePetit/Spectra.txt',\n",
" format='text')"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "b3ae6e60",
"metadata": {},
"outputs": [],
"source": [
"# Everett Schlawin\n",
"rainbows['NIRCam-Schlawin-astrophysical'] = Rainbow(directory + 'NIRCam-F322W2/EverettSchlawin-Astrophysical/spec_wasp39b_p001_mirage_040_wasp39b_astroph.fits', \n",
" format='schlawin')\n",
"rainbows['NIRCam-Schlawin-systematics'] = Rainbow(directory + 'NIRCam-F322W2/EverettSchlawin-Systematics/spec_wasp39b_p001_mirage_041_wasp39b_sys.fits', \n",
" format='schlawin')"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "eac66cde",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 14364/14364 [00:00<00:00, 31345.20it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 14364/14364 [00:00<00:00, 31741.88it/s]\n"
]
}
],
"source": [
"# Kevin Stevenson\n",
"rainbows['NIRCam-Stevenson-astrophysical'] = Rainbow(directory + 'NIRCam-F322W2/KevinStevenson-Astrophysical/Stevenson-NIRCam-Astro-S4.txt',\n",
" format='text')\n",
"rainbows['NIRCam-Stevenson-systematics'] = Rainbow(directory + 'NIRCam-F322W2/KevinStevenson-Systematics/Stevenson-NIRCam-Systematics-S4.txt', \n",
" format='text')"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "1d7dab06",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1503/1503 [00:00<00:00, 15092.77it/s]\n"
]
}
],
"source": [
"# Megan Mansfield\n",
"rainbows['NIRCam-Mansfield-astrophysical'] = Rainbow(directory + 'NIRCam-F322W2/MeganMansfield/S3_nircam_wfss_template_ap8_bg16_Table_Save.txt', \n",
" format='eureka')"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "f49083ce",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1450/1450 [00:00<00:00, 16894.10it/s]\n"
]
}
],
"source": [
"# Zoe de Beurs\n",
"rainbows['NIRCam-deBeurs'] = Rainbow(directory + 'NIRCam-F322W2/ZoedeBeurs/S3_wasp39b_Table_Save.txt',\n",
" format='eureka')"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "2978901c",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4/4 [00:02<00:00, 1.63it/s]\n",
"100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4/4 [00:02<00:00, 1.58it/s]\n"
]
}
],
"source": [
"# the spectra that were made available with the simulated data\n",
"# the spectra that were made available with the simulated data\n",
"for d in ['astrophysical-only', 'systematics-included']:\n",
" rainbows[f'NIRCam-with-simulations-{d}'] = Rainbow(directory + f'NIRCam-F322W2/with-simulations/{d}/*x1dints.fits', \n",
" format='x1dints')"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "ce7ca404",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'NIRISS-Radica-order1-atoca': <🌈(2034w, 537t)>,\n",
" 'NIRISS-Radica-order1-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Radica-order2-atoca': <🌈(1795w, 537t)>,\n",
" 'NIRISS-Radica-order2-extract': <🌈(2048w, 537t)>,\n",
" 'NIRISS-Coulombe-order1': <🌈(2041w, 537t)>,\n",
" 'NIRISS-Coulombe-order2': <🌈(1834w, 537t)>,\n",
" 'NIRISS-Coulombe-order3': <🌈(839w, 537t)>,\n",
" 'NIRISS-Feinstein-order1': <🌈(2048w, 142t)>,\n",
" 'NIRISS-Feinstein-order2': <🌈(2048w, 142t)>,\n",
" 'NIRISS-dosSantos-order1': <🌈(2040w, 142t)>,\n",
" 'NIRISS-dosSantos-order2': <🌈(2040w, 142t)>,\n",
" 'NIRISS-with-simulations-order1': <🌈(2040w, 537t)>,\n",
" 'NIRISS-with-simulations-order2': <🌈(1237w, 537t)>,\n",
" 'NIRSpec-Sing': <🌈(432w, 8192t)>,\n",
" 'NIRSpec-Piaulet': <🌈(350w, 32t)>,\n",
" 'NIRSpec-Carter': <🌈(380w, 8192t)>,\n",
" 'NIRSpec-with-simulations': <🌈(432w, 8192t)>,\n",
" 'MIRI-Zhang-drift': <🌈(416w, 1849t)>,\n",
" 'MIRI-Zhang-nodrift': <🌈(416w, 1849t)>,\n",
" 'MIRI-Bell-drift-ap2bg3': <🌈(230w, 1848t)>,\n",
" 'MIRI-Bell-drift-ap4bg10': <🌈(230w, 1848t)>,\n",
" 'MIRI-Bell-nodrift-ap2bg3': <🌈(230w, 1848t)>,\n",
" 'MIRI-Bell-nodrift-ap4bg10': <🌈(230w, 1848t)>,\n",
" 'MIRI-with-simulations-drift': <🌈(387w, 1848t)>,\n",
" 'MIRI-with-simulations-nodrift': <🌈(387w, 1848t)>,\n",
" 'NIRCam-Petit-systematics': <🌈(2048w, 378t)>,\n",
" 'NIRCam-Schlawin-astrophysical': <🌈(2048w, 378t)>,\n",
" 'NIRCam-Schlawin-systematics': <🌈(2048w, 378t)>,\n",
" 'NIRCam-Stevenson-astrophysical': <🌈(38w, 378t)>,\n",
" 'NIRCam-Stevenson-systematics': <🌈(38w, 378t)>,\n",
" 'NIRCam-Mansfield-astrophysical': <🌈(1503w, 378t)>,\n",
" 'NIRCam-deBeurs': <🌈(1450w, 378t)>,\n",
" 'NIRCam-with-simulations-astrophysical-only': <🌈(2048w, 378t)>,\n",
" 'NIRCam-with-simulations-systematics-included': <🌈(2048w, 378t)>}"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rainbows"
]
},
{
"cell_type": "markdown",
"id": "59c545f2",
"metadata": {},
"source": [
"# Save + Plot Everything"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "a4f2a924",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mkdir: submitted-rainbows: File exists\r\n"
]
}
],
"source": [
"!mkdir submitted-rainbows\n",
"!open submitted-rainbows"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "e181cc00",
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: divide by zero encountered in log\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Something didn't work with 'NIRISS-Feinstein-order2'\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n",
"\n",
"🌈 Warning: \n",
"Uncertainties and/or data quality flags might\n",
"not be handled absolutely perfectly yet...\n"
]
},
{
"data": {
"text/plain": [
"<Figure size 432x288 with 0 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for k in rainbows:\n",
" try:\n",
" rainbows[k].bin(R=100).normalize().imshow(vmin=0.97, vmax=1.02)\n",
" plt.title(k)\n",
" plt.savefig(f'submitted-rainbows/{k}.png', dpi=300)\n",
" except ValueError:\n",
" print(f\"Something didn't work with '{k}'\")\n",
"plt.clf();"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment