Skip to content

Commit

Permalink
Column renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelshirley committed Feb 2, 2018
1 parent a9c0e00 commit 7d3f328
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 22 deletions.
29 changes: 27 additions & 2 deletions dmu1/dmu1_ml_XMM-LSS/1.11_SXDS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand Down Expand Up @@ -1084,12 +1086,35 @@
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"catalogue.add_column(Column(data=np.arange(len(catalogue)), name=\"sxds_intid\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"for col in catalogue.colnames:\n",
" if '_sxds_b' in col:\n",
" catalogue.rename_column(col, col.replace('_sxds_b', '_subaru_b'))\n",
" elif '_sxds_v' in col:\n",
" catalogue.rename_column(col, col.replace('_sxds_v', '_subaru_v'))\n",
" elif '_sxds_r' in col:\n",
" catalogue.rename_column(col, col.replace('_sxds_r', '_subaru_r'))\n",
" elif '_sxds_i' in col:\n",
" catalogue.rename_column(col, col.replace('_sxds_i', '_subaru_ip'))\n",
" elif '_sxds_z' in col:\n",
" catalogue.rename_column(col, col.replace('_sxds_zp', '_subaru_zp'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
20 changes: 13 additions & 7 deletions dmu1/dmu1_ml_XMM-LSS/2.4_VIRCAM_merge.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand Down Expand Up @@ -173,7 +175,9 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Given the graph above, we use 0.8 arc-second radius\n",
Expand Down Expand Up @@ -213,7 +217,9 @@
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Given the graph above, we use 0.8 arc-second radius\n",
Expand Down Expand Up @@ -615,15 +621,15 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"for col in master_catalogue.colnames:\n",
" if 'vista' in col:\n",
" master_catalogue[col].name = col.replace('vista', 'vircam')"
"for col in catalogue.colnames:\n",
" if '_vista_k' in col:\n",
" catalogue.rename_column(col, col.replace('_vista_k', '_vista_ks'))"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions dmu1/dmu1_ml_XMM-LSS/2.7_Merging.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1583,11 +1583,11 @@
" 1 * ~np.isnan(sub_catalogue['f_ukidss_h']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_ukidss_k']) +\n",
" # VISTA\n",
" 1 * ~np.isnan(sub_catalogue['f_vircam_z']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vircam_y']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vircam_j']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vircam_h']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vircam_k'])\n",
" 1 * ~np.isnan(sub_catalogue['f_vista_z']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vista_y']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vista_j']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vista_h']) +\n",
" 1 * ~np.isnan(sub_catalogue['f_vista_ks'])\n",
" )\n",
"\n",
" nb_mir_flux = (\n",
Expand Down
18 changes: 10 additions & 8 deletions dmu1/dmu1_ml_XMM-LSS/3_Checks_and_diagnostics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand Down Expand Up @@ -405,11 +407,11 @@
"g_bands = [\"Megacam g\", \"SUPRIME g\", \"GPC1 g\", \"DECam g\"]\n",
"r_bands = [\"Megacam r\", \"SUPRIME r\", \"GPC1 r\", \"DECam r\"]\n",
"i_bands = [ \"SUPRIME i\", \"GPC1 i\", ]\n",
"z_bands = [\"Megacam z\", \"SUPRIME z\", \"GPC1 z\", \"DECam z\", \"VIRCAM z\"]\n",
"y_bands = [\"Megacam y\", \"SUPRIME y\", \"GPC1 y\", \"VIRCAM y\"]\n",
"j_bands = [ \"VIRCAM j\", \"UKIDSS j\"]\n",
"h_bands = [ \"VIRCAM h\", \"UKIDSS j\"]\n",
"k_bands = [ \"VIRCAM k\", \"UKIDSS j\"]"
"z_bands = [\"Megacam z\", \"SUPRIME z\", \"GPC1 z\", \"DECam z\", \"VISTA Z\"]\n",
"y_bands = [\"Megacam y\", \"SUPRIME y\", \"GPC1 y\", \"VISTA Y\"]\n",
"j_bands = [ \"VISTA J\", \"UKIDSS J\"]\n",
"h_bands = [ \"VISTA H\", \"UKIDSS J\"]\n",
"k_bands = [ \"VISTA Ks\", \"UKIDSS J\"]"
]
},
{
Expand Down Expand Up @@ -2641,9 +2643,9 @@
" labels=(\"SDSS {} (fiberMag)\".format(band[-1]), \"{} (aperture)\".format(band)))\n",
" \n",
" sdss_mag_tot = sdss[\"petroMag_{}\".format(band[-1])]\n",
" master_cat_mag_tot = master_catalogue[\"m_ap_{}\".format(band.replace(\" \", \"_\").lower())][ml_sdss_idx]\n",
" master_cat_mag_tot = master_catalogue[\"m_{}\".format(band.replace(\" \", \"_\").lower())][ml_sdss_idx]\n",
" \n",
" nb_compare_mags(sdss_mag_ap, master_cat_mag_ap,\n",
" nb_compare_mags(sdss_mag_tot, master_cat_mag_tot,\n",
" labels=(\"SDSS {} (petroMag)\".format(band[-1]), \"{} (total)\".format(band)))"
]
},
Expand Down

0 comments on commit 7d3f328

Please sign in to comment.