Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Y3 plot notebooks that were located at NERSC #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
375 changes: 375 additions & 0 deletions notebooks/y3/Untitled.ipynb

Large diffs are not rendered by default.

224 changes: 224 additions & 0 deletions notebooks/y3/add-star-det-col.ipynb

Large diffs are not rendered by default.

569 changes: 569 additions & 0 deletions notebooks/y3/ambiguous-matches.ipynb

Large diffs are not rendered by default.

185 changes: 185 additions & 0 deletions notebooks/y3/appendix-tables.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import fitsio\n",
"from astropy.table import Table\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
"gal_mag_file = 'tables/galaxy-response-deredden.csv'\n",
"gal_col_file = 'tables/galaxy-color-response-deredden.csv'\n",
"str_mag_file = 'tables/star-mag-response-deredden.csv'\n",
"str_col_file = 'tables/star-color-response-deredden.csv'\n",
"\n",
"gal_mag = Table(np.round(pd.read_csv(gal_mag_file).values, 3))\n",
"gal_col = Table(np.round(pd.read_csv(gal_col_file).values, 3))\n",
"str_mag = Table(np.round(pd.read_csv(str_mag_file).values, 3))\n",
"str_col = Table(np.round(pd.read_csv(str_col_file).values, 3))\n",
"\n",
"gal_mag.write(gal_mag_file.replace('.csv', '-rounded.csv'), overwrite=True)\n",
"gal_col.write(gal_col_file.replace('.csv', '-rounded.csv'), overwrite=True)\n",
"str_mag.write(str_mag_file.replace('.csv', '-rounded.csv'), overwrite=True)\n",
"str_col.write(str_col_file.replace('.csv', '-rounded.csv'), overwrite=True)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<i>Table length=22</i>\n",
"<table id=\"table140115370245200\" class=\"table-striped table-bordered table-condensed\">\n",
"<thead><tr><th>col0</th><th>col1</th><th>col2</th><th>col3</th><th>col4</th><th>col5</th><th>col6</th><th>col7</th><th>col8</th><th>col9</th></tr></thead>\n",
"<thead><tr><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th><th>float64</th></tr></thead>\n",
"<tr><td>-0.2</td><td>0.081</td><td>0.053</td><td>0.211</td><td>0.079</td><td>0.043</td><td>0.216</td><td>0.092</td><td>0.047</td><td>0.239</td></tr>\n",
"<tr><td>-0.1</td><td>0.047</td><td>0.03</td><td>0.192</td><td>0.053</td><td>0.032</td><td>0.201</td><td>0.062</td><td>0.03</td><td>0.213</td></tr>\n",
"<tr><td>0.0</td><td>0.026</td><td>0.016</td><td>0.182</td><td>0.028</td><td>0.013</td><td>0.182</td><td>0.03</td><td>0.009</td><td>0.177</td></tr>\n",
"<tr><td>0.1</td><td>0.012</td><td>0.006</td><td>0.179</td><td>0.011</td><td>0.002</td><td>0.155</td><td>0.019</td><td>0.004</td><td>0.163</td></tr>\n",
"<tr><td>0.2</td><td>0.002</td><td>-0.002</td><td>0.178</td><td>0.004</td><td>-0.0</td><td>0.14</td><td>0.011</td><td>0.001</td><td>0.145</td></tr>\n",
"<tr><td>0.3</td><td>-0.009</td><td>-0.006</td><td>0.169</td><td>0.001</td><td>-0.001</td><td>0.14</td><td>0.007</td><td>0.0</td><td>0.134</td></tr>\n",
"<tr><td>0.4</td><td>-0.015</td><td>-0.008</td><td>0.161</td><td>-0.003</td><td>-0.001</td><td>0.139</td><td>0.004</td><td>-0.0</td><td>0.141</td></tr>\n",
"<tr><td>0.5</td><td>-0.019</td><td>-0.009</td><td>0.158</td><td>-0.007</td><td>-0.003</td><td>0.14</td><td>0.001</td><td>-0.001</td><td>0.16</td></tr>\n",
"<tr><td>0.6</td><td>-0.024</td><td>-0.01</td><td>0.157</td><td>-0.012</td><td>-0.005</td><td>0.146</td><td>-0.004</td><td>-0.003</td><td>0.161</td></tr>\n",
"<tr><td>0.7</td><td>-0.028</td><td>-0.011</td><td>0.158</td><td>-0.015</td><td>-0.007</td><td>0.147</td><td>-0.009</td><td>-0.005</td><td>0.159</td></tr>\n",
"<tr><td>0.8</td><td>-0.031</td><td>-0.011</td><td>0.159</td><td>-0.018</td><td>-0.007</td><td>0.146</td><td>-0.012</td><td>-0.007</td><td>0.161</td></tr>\n",
"<tr><td>0.9</td><td>-0.036</td><td>-0.011</td><td>0.162</td><td>-0.022</td><td>-0.008</td><td>0.152</td><td>-0.016</td><td>-0.009</td><td>0.171</td></tr>\n",
"<tr><td>1.0</td><td>-0.041</td><td>-0.011</td><td>0.167</td><td>-0.026</td><td>-0.01</td><td>0.161</td><td>-0.019</td><td>-0.011</td><td>0.176</td></tr>\n",
"<tr><td>1.1</td><td>-0.046</td><td>-0.011</td><td>0.173</td><td>-0.029</td><td>-0.012</td><td>0.17</td><td>-0.031</td><td>-0.016</td><td>0.193</td></tr>\n",
"<tr><td>1.2</td><td>-0.051</td><td>-0.01</td><td>0.184</td><td>-0.035</td><td>-0.013</td><td>0.178</td><td>-0.053</td><td>-0.024</td><td>0.21</td></tr>\n",
"<tr><td>1.3</td><td>-0.059</td><td>-0.011</td><td>0.194</td><td>-0.071</td><td>-0.03</td><td>0.221</td><td>-0.049</td><td>-0.024</td><td>0.215</td></tr>\n",
"<tr><td>1.4</td><td>-0.069</td><td>-0.013</td><td>0.21</td><td>-0.149</td><td>-0.091</td><td>0.276</td><td>-0.054</td><td>-0.018</td><td>0.223</td></tr>\n",
"<tr><td>1.5</td><td>-0.074</td><td>-0.015</td><td>0.222</td><td>-0.171</td><td>-0.105</td><td>0.288</td><td>-0.076</td><td>-0.028</td><td>0.236</td></tr>\n",
"<tr><td>1.6</td><td>-0.07</td><td>-0.016</td><td>0.224</td><td>-0.183</td><td>-0.112</td><td>0.3</td><td>-0.075</td><td>-0.015</td><td>0.22</td></tr>\n",
"<tr><td>1.7</td><td>-0.066</td><td>-0.016</td><td>0.224</td><td>-0.206</td><td>-0.126</td><td>0.314</td><td>-0.05</td><td>-0.007</td><td>0.24</td></tr>\n",
"<tr><td>1.8</td><td>-0.096</td><td>-0.028</td><td>0.265</td><td>-0.206</td><td>-0.127</td><td>0.334</td><td>-0.063</td><td>-0.017</td><td>0.255</td></tr>\n",
"<tr><td>1.9</td><td>-0.193</td><td>-0.092</td><td>0.358</td><td>-0.221</td><td>-0.112</td><td>0.363</td><td>-0.061</td><td>-0.003</td><td>0.22</td></tr>\n",
"</table>"
],
"text/plain": [
"<Table length=22>\n",
" col0 col1 col2 col3 col4 col5 col6 col7 col8 col9 \n",
"float64 float64 float64 float64 float64 float64 float64 float64 float64 float64\n",
"------- ------- ------- ------- ------- ------- ------- ------- ------- -------\n",
" -0.2 0.081 0.053 0.211 0.079 0.043 0.216 0.092 0.047 0.239\n",
" -0.1 0.047 0.03 0.192 0.053 0.032 0.201 0.062 0.03 0.213\n",
" 0.0 0.026 0.016 0.182 0.028 0.013 0.182 0.03 0.009 0.177\n",
" 0.1 0.012 0.006 0.179 0.011 0.002 0.155 0.019 0.004 0.163\n",
" 0.2 0.002 -0.002 0.178 0.004 -0.0 0.14 0.011 0.001 0.145\n",
" 0.3 -0.009 -0.006 0.169 0.001 -0.001 0.14 0.007 0.0 0.134\n",
" 0.4 -0.015 -0.008 0.161 -0.003 -0.001 0.139 0.004 -0.0 0.141\n",
" 0.5 -0.019 -0.009 0.158 -0.007 -0.003 0.14 0.001 -0.001 0.16\n",
" 0.6 -0.024 -0.01 0.157 -0.012 -0.005 0.146 -0.004 -0.003 0.161\n",
" 0.7 -0.028 -0.011 0.158 -0.015 -0.007 0.147 -0.009 -0.005 0.159\n",
" 0.8 -0.031 -0.011 0.159 -0.018 -0.007 0.146 -0.012 -0.007 0.161\n",
" 0.9 -0.036 -0.011 0.162 -0.022 -0.008 0.152 -0.016 -0.009 0.171\n",
" 1.0 -0.041 -0.011 0.167 -0.026 -0.01 0.161 -0.019 -0.011 0.176\n",
" 1.1 -0.046 -0.011 0.173 -0.029 -0.012 0.17 -0.031 -0.016 0.193\n",
" 1.2 -0.051 -0.01 0.184 -0.035 -0.013 0.178 -0.053 -0.024 0.21\n",
" 1.3 -0.059 -0.011 0.194 -0.071 -0.03 0.221 -0.049 -0.024 0.215\n",
" 1.4 -0.069 -0.013 0.21 -0.149 -0.091 0.276 -0.054 -0.018 0.223\n",
" 1.5 -0.074 -0.015 0.222 -0.171 -0.105 0.288 -0.076 -0.028 0.236\n",
" 1.6 -0.07 -0.016 0.224 -0.183 -0.112 0.3 -0.075 -0.015 0.22\n",
" 1.7 -0.066 -0.016 0.224 -0.206 -0.126 0.314 -0.05 -0.007 0.24\n",
" 1.8 -0.096 -0.028 0.265 -0.206 -0.127 0.334 -0.063 -0.017 0.255\n",
" 1.9 -0.193 -0.092 0.358 -0.221 -0.112 0.363 -0.061 -0.003 0.22"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gal_col"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"gal-scatter-color-stats-deredden.fits\n",
"gal-scatter-mag-stats-deredden-by-meas-mag.fits\n",
"gal-scatter-mag-stats-deredden-s2n.fits\n",
"gal-scatter-mag-stats-deredden.fits\n",
"gal-scatter-mag-stats-uncorrected.fits\n",
"gal-scatter-mag-stats.fits\n",
"galaxy-color-response-deredden-rounded.csv\n",
"galaxy-color-response-deredden.csv\n",
"galaxy-response-deredden-rounded.csv\n",
"galaxy-response-deredden.csv\n",
"grid-gal-scatter-color-stats-deredden.fits\n",
"grid-gal-scatter-mag-stats-deredden-s2n.fits\n",
"grid-gal-scatter-mag-stats-deredden.fits\n",
"grid-gal-scatter-mag-stats-deredden_dt.fits\n",
"star-color-response-deredden-rounded.csv\n",
"star-color-response-deredden.csv\n",
"star-mag-response-deredden-rounded.csv\n",
"star-mag-response-deredden.csv\n",
"star-scatter-color-stats-deredden.fits\n",
"star-scatter-mag-stats-deredden.fits\n",
"star-scatter-mag-stats-meas_cm_mag_deredden.fits\n",
"star-scatter-mag-stats-meas_cm_magderedden.csv\n",
"star-scatter-mag-stats-meas_cm_magderedden.fits\n",
"star-scatter-mag-stats-meas_psf_magderedden.fits\n",
"star-scatter-mag-stats-uncorrected.fits\n",
"stars-scatter-mag-stats-deredden-s2n.fits\n"
]
}
],
"source": [
"!ls tables"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "balrog-plots",
"language": "python",
"name": "balrog-plots"
},
"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.7.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
375 changes: 375 additions & 0 deletions notebooks/y3/balrog-paper-plots/Untitled.ipynb

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions notebooks/y3/balrog-paper-plots/check-df-cat.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import fitsio\n",
"import numpy as np\n",
"from astropy.table import Table\n",
"import matplotlib.pyplot as plt\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"sof_file = '/project/projectdirs/des/severett/Balrog/paper-plots/cats/balrog_sof_gold_phot_scatter.fits'\n",
"sof = Table.read(sof_file)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['true_id', 'true_bdf_T', 'true_bdf_flux_err', 'true_bdf_mag', 'true_bdf_g', 'true_bdf_fracdev', 'true_bdf_flux_deredden', 'true_bdf_mag_deredden', 'true_gap_flux_fwhm4asec', 'bal_id', 'meas_gapflux', 'meas_cm_T', 'meas_cm_flux_cov', 'meas_cm_flux_s2n', 'meas_cm_mag', 'meas_cm_s2n_r', 'meas_cm_fracdev', 'meas_cm_mag_deredden', 'flags_footprint', 'flags_foreground', 'flags_badregions', 'meas_FLAGS_GOLD_SOF_ONLY', 'meas_EXTENDED_CLASS_SOF', 'ext_mag', 'match_flag_1.5_asec', 'NearestNeighbors_class']\n"
]
}
],
"source": [
"print(sof.colnames)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"df_file = 'cats/ugriz-mof02-JHK-extcorr_27May20_kNN_class.fits'\n",
"df = Table.read(df_file)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['NearestNeighbors_class', 'id']\n"
]
}
],
"source": [
"print(df.colnames)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2826988\n",
"1567465\n",
"44.553531886233685\n"
]
}
],
"source": [
"print(len(df['NearestNeighbors_class']))\n",
"print(len(df[~np.isnan(df['NearestNeighbors_class'])]))\n",
"print(100. - (100. * len(df[~np.isnan(df['NearestNeighbors_class'])]) / len(df['NearestNeighbors_class'])))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "balrog-plots",
"language": "python",
"name": "balrog-plots"
},
"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.7.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading