Skip to content

Commit

Permalink
Brute force hack to make DECaLS run on laptop and Vulcain
Browse files Browse the repository at this point in the history
We take psf with and without a space to define a star just to get the code running across both machines #2 #3 #4 #7 #8 #15 #16
  • Loading branch information
raphaelshirley committed Dec 5, 2017
1 parent 31533e9 commit 50d677f
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 48 deletions.
94 changes: 71 additions & 23 deletions dmu1/dmu1_ml_COSMOS/1.3_DECaLS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from herschelhelp_internal import git_version\n",
Expand All @@ -32,7 +34,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand Down Expand Up @@ -108,7 +112,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"bands = [\"u\", \"g\", \"r\", \"i\", \"z\", \"y\"]\n",
Expand All @@ -133,6 +139,7 @@
" \n",
" stellarities[band] = np.full(len(orig_decals),0., dtype='float32')\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF \" ] = 1.\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF\" ] = 1.\n",
" \n",
" # Some sources have an infinite magnitude\n",
" mask = np.isinf(magnitudes[band])\n",
Expand All @@ -155,7 +162,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_ap_evol(magnitudes['u'], stellarities['u'], labels=apertures)"
Expand All @@ -171,7 +180,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_vs_apcor(magnitudes['u'][4], \n",
Expand Down Expand Up @@ -209,7 +220,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_ap_evol(magnitudes['g'], stellarities['g'], labels=apertures)"
Expand All @@ -225,7 +238,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_vs_apcor(magnitudes['g'][4], \n",
Expand All @@ -243,7 +258,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Aperture correction\n",
Expand All @@ -268,7 +285,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_ap_evol(magnitudes['r'], stellarities['r'], labels=apertures)"
Expand All @@ -284,7 +303,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_vs_apcor(magnitudes['r'][4], \n",
Expand All @@ -302,7 +323,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Aperture correction\n",
Expand All @@ -326,7 +349,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_ap_evol(magnitudes['i'], stellarities['i'], labels=apertures)"
Expand All @@ -335,7 +360,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_vs_apcor(magnitudes['i'][4], \n",
Expand Down Expand Up @@ -373,7 +400,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_ap_evol(magnitudes['z'], stellarities['z'], labels=apertures)"
Expand All @@ -389,7 +418,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_vs_apcor(magnitudes['z'][4], \n",
Expand Down Expand Up @@ -434,7 +465,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_ap_evol(magnitudes['y'], stellarities['y'], labels=apertures)"
Expand All @@ -443,7 +476,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_plot_mag_vs_apcor(magnitudes['y'][4], \n",
Expand Down Expand Up @@ -582,7 +617,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"flux_to_mag_vect = np.vectorize(flux_to_mag)\n",
Expand Down Expand Up @@ -632,6 +669,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"scrolled": true
},
"outputs": [],
Expand All @@ -656,7 +694,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"SORT_COLS = [#'merr_ap_decam_u',\n",
Expand Down Expand Up @@ -706,7 +746,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_astcor_diag_plot(catalogue[RA_COL], catalogue[DEC_COL], \n",
Expand All @@ -716,7 +758,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"delta_ra, delta_dec = astrometric_correction(\n",
Expand Down Expand Up @@ -745,7 +789,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nb_astcor_diag_plot(catalogue[RA_COL], catalogue[DEC_COL], \n",
Expand Down Expand Up @@ -775,7 +821,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"GAIA_FLAG_NAME = \"decals_flag_gaia\"\n",
Expand Down
1 change: 1 addition & 0 deletions dmu1/dmu1_ml_GAMA-09/1.3_DECaLS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
" \n",
" stellarities[band] = np.full(len(orig_decals),0., dtype='float32')\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF \" ] = 1.\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF\" ] = 1.\n",
" \n",
" # Some sources have an infinite magnitude\n",
" mask = np.isinf(magnitudes[band])\n",
Expand Down
51 changes: 26 additions & 25 deletions dmu1/dmu1_ml_GAMA-12/1.1_DECaLS.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dmu1/dmu1_ml_GAMA-15/1.1_DECaLS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
" \n",
" stellarities[band] = np.full(len(orig_decals),0., dtype='float32')\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF \" ] = 1.\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF\" ] = 1.\n",
" \n",
" # Some sources have an infinite magnitude\n",
" mask = np.isinf(magnitudes[band])\n",
Expand Down
1 change: 1 addition & 0 deletions dmu1/dmu1_ml_Herschel-Stripe-82/1.8_DECaLS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
" \n",
" stellarities[band] = np.full(len(orig_decals),0., dtype='float32')\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF \" ] = 1.\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF\" ] = 1.\n",
" \n",
" # Some sources have an infinite magnitude\n",
" mask = np.isinf(magnitudes[band])\n",
Expand Down
1 change: 1 addition & 0 deletions dmu1/dmu1_ml_NGP/1.1_DECaLS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
" \n",
" stellarities[band] = np.full(len(orig_decals),0., dtype='float32')\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF \" ] = 1.\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF\" ] = 1.\n",
" \n",
" # Some sources have an infinite magnitude\n",
" mask = np.isinf(magnitudes[band])\n",
Expand Down
1 change: 1 addition & 0 deletions dmu1/dmu1_ml_XMM-LSS/1.6_DECaLS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
" \n",
" stellarities[band] = np.full(len(orig_decals),0., dtype='float32')\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF \" ] = 1.\n",
" stellarities[band][np.array( orig_decals[\"type\"]) == \"PSF\" ] = 1.\n",
" \n",
" # Some sources have an infinite magnitude\n",
" mask = np.isinf(magnitudes[band])\n",
Expand Down

0 comments on commit 50d677f

Please sign in to comment.