Skip to content

Commit

Permalink
add mag histogram to examples plots
Browse files Browse the repository at this point in the history
  • Loading branch information
sschmidt23 committed Dec 11, 2024
1 parent e52f9dc commit 95c485e
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions examples/demo_SOMPZdegrader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@
"metadata": {},
"outputs": [],
"source": [
"fig, axs = plt.subplots(3,1, figsize=(8,18))\n",
"fig, axs = plt.subplots(4,1, figsize=(8,24))\n",
"xbins = np.linspace(-.005, 3.005,52)\n",
"magbins = np.linspace(14, 25.5, 52)\n",
"axs[0].hist(test_data()['redshift'], bins=xbins, alpha=0.15, color='orange', label='input sample');\n",
"axs[0].hist(ref_data()['redshift'], bins=xbins, alpha=0.5, color='k', label='specz sample');\n",
"axs[0].hist(trimdf()['redshift'], bins=xbins, alpha=0.15, color='r', label='degraded sample')\n",
Expand Down Expand Up @@ -260,7 +261,14 @@
" s=4, label='degraded data', alpha=0.3, color='r')\n",
"axs[2].legend(loc='upper right', fontsize=12)\n",
"axs[2].set_xlabel(\"g - r\", fontsize=14)\n",
"axs[2].set_ylabel(\"r - i\", fontsize=14)"
"axs[2].set_ylabel(\"r - i\", fontsize=14)\n",
"\n",
"axs[3].hist(test_data()['mag_i_lsst'], bins=magbins, alpha=0.15, color='orange', label='input sample');\n",
"axs[3].hist(ref_data()['mag_i_lsst'], bins=magbins, alpha=0.5, color='k', label='specz sample');\n",
"axs[3].hist(trimdf()['mag_i_lsst'], bins=magbins, alpha=0.15, color='r', label='degraded sample')\n",
"axs[3].set_xlabel('i-band magnitude', fontsize=14)\n",
"axs[3].legend(loc='upper left', fontsize=12)\n",
"axs[3].set_ylabel('number', fontsize=14);\n"
]
},
{
Expand Down Expand Up @@ -417,8 +425,9 @@
"metadata": {},
"outputs": [],
"source": [
"fig, axs = plt.subplots(3,1, figsize=(8,18))\n",
"fig, axs = plt.subplots(4,1, figsize=(8,24))\n",
"xbins = np.linspace(-.005, 3.005,52)\n",
"magbins = np.linspace(14, 25.5, 52)\n",
"axs[0].hist(big_test_data()['redshift'], bins=xbins, alpha=0.15, color='orange', label='input sample');\n",
"axs[0].hist(big_spec_data()['redshift'], bins=xbins, alpha=0.5, color='k', label='specz sample');\n",
"axs[0].hist(roman_trim()['redshift'], bins=xbins, alpha=0.15, color='r', label='degraded sample')\n",
Expand Down Expand Up @@ -446,15 +455,22 @@
" s=4, label='degraded data', alpha=0.3, color='r')\n",
"axs[2].legend(loc='upper right', fontsize=12)\n",
"axs[2].set_xlabel(\"g - r\", fontsize=14)\n",
"axs[2].set_ylabel(\"r - i\", fontsize=14)"
"axs[2].set_ylabel(\"r - i\", fontsize=14)\n",
"\n",
"axs[3].hist(big_test_data()['i'], bins=magbins, alpha=0.15, color='orange', label='input sample');\n",
"axs[3].hist(big_spec_data()['i'], bins=magbins, alpha=0.5, color='k', label='specz sample');\n",
"axs[3].hist(roman_trim()['i'], bins=magbins, alpha=0.15, color='r', label='degraded sample')\n",
"axs[3].set_xlabel('i-band magnitude', fontsize=14)\n",
"axs[3].legend(loc='upper left', fontsize=12)\n",
"axs[3].set_ylabel('number', fontsize=14);"
]
},
{
"cell_type": "markdown",
"id": "1c42ef91-1de7-4466-b0a9-e4ba31f8d117",
"metadata": {},
"source": [
"We again see good agreement on the redshift distribution, and good but not perfect agreement on magnitude and color distributions. So, it appears that our mock specz selection algorithm is working as expected."
"We again see good agreement on the redshift and i-band magnitude distributions, and good but not perfect agreement on magnitude-color and color-color distributions. So, it appears that our mock specz selection algorithm is working as expected."
]
},
{
Expand Down

0 comments on commit 95c485e

Please sign in to comment.