In [1]:
%pylab inline
%load_ext autoreload
%autoreload 2

from __future__ import division
from __future__ import print_function

import os
import copy
import argparse
import fnmatch
import numpy as np

import scipy
from scipy.interpolate import interp1d

# Astropy
from astropy.io import fits
from astropy    import units as u
from astropy.stats import sigma_clip
# AstroML
from astroML.plotting import hist

# Matplotlib related
# Matplotlib default settings
rcdef = plt.rcParams.copy()
pylab.rcParams['figure.figsize'] = 12, 10
pylab.rcParams['xtick.major.size'] = 8.0
pylab.rcParams['xtick.major.width'] = 2.5
pylab.rcParams['xtick.minor.size'] = 4.0
pylab.rcParams['xtick.minor.width'] = 2.5
pylab.rcParams['ytick.major.size'] = 8.0
pylab.rcParams['ytick.major.width'] = 2.5
pylab.rcParams['ytick.minor.size'] = 4.0
pylab.rcParams['ytick.minor.width'] = 2.5
pylab.rcParams['legend.numpoints'] = 1

import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from matplotlib.ticker import NullFormatter
from matplotlib.ticker import MaxNLocator


Populating the interactive namespace from numpy and matplotlib
/usr/local/lib/python2.7/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)

In [7]:
sed_model = 'a_fsps_miles_chab'
#sed_model = 'b_bc03_stelib_chab'

In [8]:
z1Fits = 'sed/hsc_sed_z1' + sed_model + '_match.fits'
z2Fits = 'sed/hsc_sed_z2' + sed_model + '_match.fits'
z3Fits = 'sed/hsc_sed_z3' + sed_model + '_match.fits'

In [9]:
z1 = fits.open(z1Fits)[1].data
z2 = fits.open(z2Fits)[1].data
z3 = fits.open(z3Fits)[1].data

In [10]:
z1.columns


Out[10]:
ColDefs(
    name = 'ISEDFIT_ID'; format = 'J'
    name = 'RA'; format = 'D'
    name = 'DEC'; format = 'D'
    name = 'Z'; format = 'E'
    name = 'MAGGIES'; format = '5E'
    name = 'IVARMAGGIES'; format = '5E'
    name = 'BESTMAGGIES'; format = '5E'
    name = 'CHUNKINDX'; format = 'I'
    name = 'MODELINDX'; format = 'I'
    name = 'DELAYED'; format = 'J'
    name = 'BURSTTYPE'; format = 'J'
    name = 'CHI2'; format = 'E'
    name = 'TOTALMASS'; format = 'E'
    name = 'TOTALMASS_ERR'; format = 'E'
    name = 'MSTAR'; format = 'E'
    name = 'AGE'; format = 'E'
    name = 'SFRAGE'; format = 'E'
    name = 'TAU'; format = 'E'
    name = 'ZMETAL'; format = 'E'
    name = 'AV'; format = 'E'
    name = 'MU'; format = 'E'
    name = 'OIIIHB'; format = 'E'
    name = 'NLYC'; format = 'E'
    name = 'SFR'; format = 'E'
    name = 'SFR100'; format = 'E'
    name = 'B100'; format = 'E'
    name = 'B1000'; format = 'E'
    name = 'EWOII'; format = 'E'
    name = 'EWOIIIHB'; format = 'E'
    name = 'EWNIIHA'; format = 'E'
    name = 'NBURST'; format = 'I'
    name = 'TRUNCTAU'; format = 'E'
    name = 'TBURST'; format = '5E'
    name = 'DTBURST'; format = '5E'
    name = 'FBURST'; format = '5E'
    name = 'MSTAR_50'; format = 'E'
    name = 'AGE_50'; format = 'E'
    name = 'SFRAGE_50'; format = 'E'
    name = 'TAU_50'; format = 'E'
    name = 'ZMETAL_50'; format = 'E'
    name = 'AV_50'; format = 'E'
    name = 'MU_50'; format = 'E'
    name = 'OIIIHB_50'; format = 'E'
    name = 'SFR_50'; format = 'E'
    name = 'SFR100_50'; format = 'E'
    name = 'B100_50'; format = 'E'
    name = 'B1000_50'; format = 'E'
    name = 'EWOII_50'; format = 'E'
    name = 'EWOIIIHB_50'; format = 'E'
    name = 'EWNIIHA_50'; format = 'E'
    name = 'MSTAR_AVG'; format = 'E'
    name = 'AGE_AVG'; format = 'E'
    name = 'SFRAGE_AVG'; format = 'E'
    name = 'TAU_AVG'; format = 'E'
    name = 'ZMETAL_AVG'; format = 'E'
    name = 'AV_AVG'; format = 'E'
    name = 'MU_AVG'; format = 'E'
    name = 'OIIIHB_AVG'; format = 'E'
    name = 'SFR_AVG'; format = 'E'
    name = 'SFR100_AVG'; format = 'E'
    name = 'B100_AVG'; format = 'E'
    name = 'B1000_AVG'; format = 'E'
    name = 'EWOII_AVG'; format = 'E'
    name = 'EWOIIIHB_AVG'; format = 'E'
    name = 'EWNIIHA_AVG'; format = 'E'
    name = 'MSTAR_ERR'; format = 'E'
    name = 'AGE_ERR'; format = 'E'
    name = 'SFRAGE_ERR'; format = 'E'
    name = 'TAU_ERR'; format = 'E'
    name = 'ZMETAL_ERR'; format = 'E'
    name = 'AV_ERR'; format = 'E'
    name = 'MU_ERR'; format = 'E'
    name = 'OIIIHB_ERR'; format = 'E'
    name = 'SFR_ERR'; format = 'E'
    name = 'SFR100_ERR'; format = 'E'
    name = 'B100_ERR'; format = 'E'
    name = 'B1000_ERR'; format = 'E'
    name = 'EWOII_ERR'; format = 'E'
    name = 'EWOIIIHB_ERR'; format = 'E'
    name = 'EWNIIHA_ERR'; format = 'E'
    name = 'ra_hsc'; format = 'D'
    name = 'dec_hsc'; format = 'D'
    name = 'tract'; format = 'I'; null = -32768
    name = 'patch'; format = '3A'
    name = 'id'; format = 'K'; null = -9223372036854775808
    name = 'parent'; format = 'K'; null = -9223372036854775808
    name = 'a_g'; format = 'D'
    name = 'a_r'; format = 'D'
    name = 'a_i'; format = 'D'
    name = 'a_z'; format = 'D'
    name = 'a_y'; format = 'D'
    name = 'imag_aperture01'; format = 'D'
    name = 'imag_aperture02'; format = 'D'
    name = 'imag_aperture03'; format = 'D'
    name = 'imag_aperture04'; format = 'D'
    name = 'imag_aperture05'; format = 'D'
    name = 'imag_aperture06'; format = 'D'
    name = 'imag_aperture07'; format = 'D'
    name = 'imag_aperture08'; format = 'D'
    name = 'imag_aperture09'; format = 'D'
    name = 'gmag_psf'; format = 'D'
    name = 'gmag_psf_err'; format = 'D'
    name = 'rmag_psf'; format = 'D'
    name = 'rmag_psf_err'; format = 'D'
    name = 'imag_psf'; format = 'D'
    name = 'imag_psf_err'; format = 'D'
    name = 'zmag_psf'; format = 'D'
    name = 'zmag_psf_err'; format = 'D'
    name = 'ymag_psf'; format = 'D'
    name = 'ymag_psf_err'; format = 'D'
    name = 'gmag_kron'; format = 'D'
    name = 'gmag_kron_err'; format = 'D'
    name = 'rmag_kron'; format = 'D'
    name = 'rmag_kron_err'; format = 'D'
    name = 'imag_kron'; format = 'D'
    name = 'imag_kron_err'; format = 'D'
    name = 'zmag_kron'; format = 'D'
    name = 'zmag_kron_err'; format = 'D'
    name = 'ymag_kron'; format = 'D'
    name = 'ymag_kron_err'; format = 'D'
    name = 'gmag_cmodel'; format = 'D'
    name = 'gmag_cmodel_err'; format = 'D'
    name = 'gmag_cmodel_exp'; format = 'D'
    name = 'gmag_cmodel_exp_err'; format = 'D'
    name = 'gmag_cmodel_dev'; format = 'D'
    name = 'gmag_cmodel_dev_err'; format = 'D'
    name = 'rmag_cmodel'; format = 'D'
    name = 'rmag_cmodel_err'; format = 'D'
    name = 'rmag_cmodel_exp'; format = 'D'
    name = 'rmag_cmodel_exp_err'; format = 'D'
    name = 'rmag_cmodel_dev'; format = 'D'
    name = 'rmag_cmodel_dev_err'; format = 'D'
    name = 'imag_cmodel'; format = 'D'
    name = 'imag_cmodel_err'; format = 'D'
    name = 'imag_cmodel_exp'; format = 'D'
    name = 'imag_cmodel_exp_err'; format = 'D'
    name = 'imag_cmodel_dev'; format = 'D'
    name = 'imag_cmodel_dev_err'; format = 'D'
    name = 'zmag_cmodel'; format = 'D'
    name = 'zmag_cmodel_err'; format = 'D'
    name = 'zmag_cmodel_exp'; format = 'D'
    name = 'zmag_cmodel_exp_err'; format = 'D'
    name = 'zmag_cmodel_dev'; format = 'D'
    name = 'zmag_cmodel_dev_err'; format = 'D'
    name = 'ymag_cmodel'; format = 'D'
    name = 'ymag_cmodel_err'; format = 'D'
    name = 'ymag_cmodel_exp'; format = 'D'
    name = 'ymag_cmodel_exp_err'; format = 'D'
    name = 'ymag_cmodel_dev'; format = 'D'
    name = 'ymag_cmodel_dev_err'; format = 'D'
    name = 'if_classification_extendedness'; format = 'E'
    name = 'if_flags_pixel_edge'; format = 'L'
    name = 'if_flags_pixel_interpolated_center'; format = 'L'
    name = 'if_flags_pixel_saturated_center'; format = 'L'
    name = 'if_centroid_naive_flags'; format = 'L'
    name = 'if_centroid_sdss_flags'; format = 'L'
    name = 'if_flux_aperture_flags'; format = 'L'
    name = 'if_flux_kron_flags'; format = 'L'
    name = 'if_cmodel_flux_flags'; format = 'L'
    name = 'if_shape_sdss_flags'; format = 'L'
    name = 'if_countinputs'; format = 'I'; null = -32768
    name = 'if_cmodel_fracdev'; format = 'D'
    name = 'if_cmodel_objective'; format = 'D'
    name = 'im_mag_kron_1'; format = 'D'
    name = 'im_mag_kron_1a'; format = 'D'
    name = 'im_mag_cmodel'; format = 'D'
    name = 'im_mag_cmodel_err'; format = 'D'
    name = 'im_mag_cmodel_exp'; format = 'D'
    name = 'im_mag_cmodel_dev'; format = 'D'
    name = 'im_cmodel_flux'; format = 'D'
    name = 'im_cmodel_flux_err'; format = 'D'
    name = 'im_cmodel_exp_flux'; format = 'D'
    name = 'im_cmodel_exp_flux_err'; format = 'D'
    name = 'im_cmodel_dev_flux'; format = 'D'
    name = 'im_cmodel_dev_flux_err'; format = 'D'
    name = 'im_deblend_blendedness'; format = 'D'
    name = 'im_cmodel_exp_ixx'; format = 'D'
    name = 'im_cmodel_exp_iyy'; format = 'D'
    name = 'im_cmodel_exp_ixy'; format = 'D'
    name = 'im_cmodel_dev_ixx'; format = 'D'
    name = 'im_cmodel_dev_iyy'; format = 'D'
    name = 'im_cmodel_dev_ixy'; format = 'D'
    name = 'im_cmodel_fracdev'; format = 'D'
    name = 'im_cmodel_objective'; format = 'D'
    name = 'im_classification_extendedness'; format = 'E'
    name = 'im_flux_kron_flags'; format = 'L'
    name = 'im_cmodel_flux_flags'; format = 'L'
    name = 'im_shape_sdss_flags'; format = 'L'
    name = 'im_detect_is_patch_inner'; format = 'L'
    name = 'im_detect_is_tract_inner'; format = 'L'
    name = 'im_detect_is_primary'; format = 'L'
    name = 'im_merge_peak_g'; format = 'L'
    name = 'im_merge_peak_r'; format = 'L'
    name = 'im_merge_peak_i'; format = 'L'
    name = 'im_merge_peak_z'; format = 'L'
    name = 'im_merge_peak_y'; format = 'L'
    name = 'im_merge_footprint_g'; format = 'L'
    name = 'im_merge_footprint_r'; format = 'L'
    name = 'im_merge_footprint_i'; format = 'L'
    name = 'im_merge_footprint_z'; format = 'L'
    name = 'im_merge_footprint_y'; format = 'L'
    name = 'ir_deblend_blendedness'; format = 'D'
    name = 'ir_deblend_has_stray_flux'; format = 'L'
    name = 'ir_deblend_masked'; format = 'L'
    name = 'ir_deblend_parent_too_big'; format = 'L'
    name = 'ir_deblend_skipped'; format = 'L'
    name = 'ir_deblend_too_many_peaks'; format = 'L'
    name = 'ir_deblend_as_psf'; format = 'L'
    name = 'ir_detect_is_patch_inner'; format = 'L'
    name = 'ir_detect_is_tract_inner'; format = 'L'
    name = 'ir_detect_is_primary'; format = 'L'
    name = 'ir_merge_measurement_g'; format = 'L'
    name = 'ir_merge_measurement_r'; format = 'L'
    name = 'ir_merge_measurement_i'; format = 'L'
    name = 'ir_merge_measurement_z'; format = 'L'
    name = 'ir_merge_measurement_y'; format = 'L'
    name = 'ra_gama'; format = 'D'; unit = 'deg'
    name = 'dec_gama'; format = 'E'; unit = 'deg'
    name = 'gama_id'; format = 'J'; null = -2147483648
    name = 'gama_name'; format = '23A'
    name = 'n_spec'; format = 'I'; null = -32768
    name = 'n_gama_spec'; format = 'I'; null = -32768
    name = 'gama_specid'; format = '33A'
    name = 'survey'; format = '9A'
    name = 'survey_code'; format = 'I'; null = -32768
    name = 'z_gama'; format = 'E'
    name = 'z_use'; format = 'E'
    name = 'zquality_gama'; format = 'I'; null = -32768
    name = 'z_tonry_gama'; format = 'D'
    name = 'zprob_gama'; format = 'E'
    name = 'objid_dr6'; format = 'K'; null = -9223372036854775808
    name = 'nbands'; format = 'I'; null = -32768
    name = 'logms_gama'; format = 'D'; unit = 'dex'
    name = 'logms_err_gama'; format = 'D'; unit = 'dex'
    name = 'logm2l_i_gama'; format = 'D'; unit = 'dex'
    name = 'logm2l_i_err_gama'; format = 'D'; unit = 'dex'
    name = 'fluxscale_gama'; format = 'D'
    name = 'gi_rest_sed'; format = 'D'; unit = 'mag'
    name = 'gi_rest_sed_err'; format = 'D'; unit = 'mag'
    name = 'ur_rest_sed'; format = 'D'; unit = 'mag'
    name = 'ur_rest_sed_err'; format = 'D'; unit = 'mag'
    name = 'gi_rest_star'; format = 'D'; unit = 'mag'
    name = 'ur_rest_star'; format = 'D'; unit = 'mag'
    name = 'GAL_MAG_R'; format = 'E'; unit = 'mag'
    name = 'GAL_RE_R'; format = 'D'; unit = 'arcsec'
    name = 'GAL_INDEX_R'; format = 'E'
    name = 'GAL_ELLIP_R'; format = 'D'
    name = 'GAL_PA_R'; format = 'D'; unit = 'deg'
    name = 'GAL_MAG_ERR_R'; format = 'E'; unit = 'mag'
    name = 'GAL_RE_ERR_R'; format = 'D'; unit = 'arcsec'
    name = 'GAL_ELLIP_ERR_R'; format = 'D'
    name = 'GAL_PA_ERR_R'; format = 'D'; unit = 'deg'
    name = 'GAL_MAG_I'; format = 'E'; unit = 'mag'
    name = 'GAL_RE_I'; format = 'D'; unit = 'arcsec'
    name = 'GAL_INDEX_I'; format = 'E'
    name = 'GAL_ELLIP_I'; format = 'D'
    name = 'GAL_PA_I'; format = 'D'; unit = 'deg'
    name = 'GAL_MAG_ERR_I'; format = 'E'; unit = 'mag'
    name = 'GAL_RE_ERR_I'; format = 'D'; unit = 'arcsec'
    name = 'GAL_INDEX_ERR_I'; format = 'D'
    name = 'GAL_ELLIP_ERR_I'; format = 'D'
    name = 'GAL_PA_ERR_I'; format = 'D'; unit = 'deg'
    name = 'ra_sdss'; format = 'D'
    name = 'dec_sdss'; format = 'D'
    name = 'objid_dr12'; format = 'K'; null = -9223372036854775808
    name = 'specobjid_dr12'; format = 'K'; null = -9223372036854775808
    name = 'plate'; format = 'I'; null = -32768
    name = 'mjd'; format = 'J'; null = -2147483648
    name = 'fiberid'; format = 'I'; null = -32768
    name = 'ra_fib'; format = 'D'
    name = 'dec_fib'; format = 'D'
    name = 'ra_err_sdss'; format = 'D'
    name = 'dec_err_sdss'; format = 'D'
    name = 'z_sdss'; format = 'E'
    name = 'z_err_sdss'; format = 'E'
    name = 'veldisp'; format = 'E'
    name = 'veldisp_err'; format = 'E'
    name = 'cmodelMag_u'; format = 'E'
    name = 'cmodelMagErr_u'; format = 'E'
    name = 'cmodelMag_g'; format = 'E'
    name = 'cmodelMagErr_g'; format = 'E'
    name = 'cmodelMag_r'; format = 'E'
    name = 'cmodelMagErr_r'; format = 'E'
    name = 'cmodelMag_i'; format = 'E'
    name = 'cmodelMagErr_i'; format = 'E'
    name = 'cmodelMag_z'; format = 'E'
    name = 'cmodelMagErr_z'; format = 'E'
    name = 'modelMag_u'; format = 'E'
    name = 'modelMagErr_u'; format = 'E'
    name = 'modelMag_g'; format = 'E'
    name = 'modelMagErr_g'; format = 'E'
    name = 'modelMag_r'; format = 'E'
    name = 'modelMagErr_r'; format = 'E'
    name = 'modelMag_i'; format = 'E'
    name = 'modelMagErr_i'; format = 'E'
    name = 'modelMag_z'; format = 'E'
    name = 'modelMagErr_z'; format = 'E'
    name = 'petroMag_u'; format = 'E'
    name = 'petroMagErr_u'; format = 'E'
    name = 'petroMag_g'; format = 'E'
    name = 'petroMagErr_g'; format = 'E'
    name = 'petroMag_r'; format = 'E'
    name = 'petroMagErr_r'; format = 'E'
    name = 'petroMag_i'; format = 'E'
    name = 'petroMagErr_i'; format = 'E'
    name = 'petroMag_z'; format = 'E'
    name = 'petroMagErr_z'; format = 'E'
    name = 'model_gr'; format = 'E'
    name = 'model_gi'; format = 'E'
    name = 'fracDev_r'; format = 'E'
    name = 'fracDev_i'; format = 'E'
    name = 'devRad_r'; format = 'E'
    name = 'devRad_i'; format = 'E'
    name = 'devAB_r'; format = 'E'
    name = 'devAB_i'; format = 'E'
    name = 'devRadErr_r'; format = 'E'
    name = 'devABErr_r'; format = 'E'
    name = 'expRad_r'; format = 'E'
    name = 'expRad_i'; format = 'E'
    name = 'expAB_r'; format = 'E'
    name = 'expAB_i'; format = 'E'
    name = 'expRadErr_r'; format = 'E'
    name = 'expABErr_r'; format = 'E'
    name = 'petroR50_r'; format = 'E'
    name = 'petroR90_r'; format = 'E'
    name = 'petroR50Err_r'; format = 'E'
    name = 'petroR90Err_r'; format = 'E'
    name = 'petroR50_i'; format = 'E'
    name = 'petroR90_i'; format = 'E'
    name = 'petroR50Err_i'; format = 'E'
    name = 'petroR90Err_i'; format = 'E'
    name = 'mE1_r'; format = 'E'
    name = 'mE1_i'; format = 'E'
    name = 'mE2_r'; format = 'E'
    name = 'mE2_i'; format = 'E'
    name = 'nchild'; format = 'I'; null = -32768
    name = 'extinction_u'; format = 'E'
    name = 'extinction_g'; format = 'E'
    name = 'extinction_r'; format = 'E'
    name = 'extinction_i'; format = 'E'
    name = 'extinction_z'; format = 'E'
    name = 'deVFlux_u'; format = 'E'
    name = 'deVFlux_g'; format = 'E'
    name = 'deVFlux_r'; format = 'E'
    name = 'deVFlux_i'; format = 'E'
    name = 'deVFlux_z'; format = 'E'
    name = 'deVFluxIvar_u'; format = 'E'
    name = 'deVFluxIvar_g'; format = 'E'
    name = 'deVFluxIvar_r'; format = 'E'
    name = 'deVFluxIvar_i'; format = 'E'
    name = 'deVFluxIvar_z'; format = 'E'
    name = 'expFlux_u'; format = 'E'
    name = 'expFlux_g'; format = 'E'
    name = 'expFlux_r'; format = 'E'
    name = 'expFlux_i'; format = 'E'
    name = 'expFlux_z'; format = 'E'
    name = 'expFluxIvar_u'; format = 'E'
    name = 'expFluxIvar_g'; format = 'E'
    name = 'expFluxIvar_r'; format = 'E'
    name = 'expFluxIvar_i'; format = 'E'
    name = 'expFluxIvar_z'; format = 'E'
    name = 'modelFlux_u'; format = 'E'
    name = 'modelFlux_g'; format = 'E'
    name = 'modelFlux_r'; format = 'E'
    name = 'modelFlux_i'; format = 'E'
    name = 'modelFlux_z'; format = 'E'
    name = 'modelFluxIvar_u'; format = 'E'
    name = 'modelFluxIvar_g'; format = 'E'
    name = 'modelFluxIvar_r'; format = 'E'
    name = 'modelFluxIvar_i'; format = 'E'
    name = 'modelFluxIvar_z'; format = 'E'
    name = 'cmodelFlux_u'; format = 'E'
    name = 'cmodelFlux_g'; format = 'E'
    name = 'cmodelFlux_r'; format = 'E'
    name = 'cmodelFlux_i'; format = 'E'
    name = 'cmodelFlux_z'; format = 'E'
    name = 'cmodelFluxIvar_u'; format = 'E'
    name = 'cmodelFluxIvar_g'; format = 'E'
    name = 'cmodelFluxIvar_r'; format = 'E'
    name = 'cmodelFluxIvar_i'; format = 'E'
    name = 'cmodelFluxIvar_z'; format = 'E'
    name = 'logms_pca'; format = 'D'
    name = 'logms_err_pca'; format = 'D'
    name = 'cModelAbsMag_u'; format = 'D'
    name = 'cModelAbsMag_g'; format = 'D'
    name = 'cModelAbsMag_r'; format = 'D'
    name = 'cModelAbsMag_i'; format = 'D'
    name = 'cModelAbsMag_z'; format = 'D'
    name = 'logms_gran'; format = 'D'
    name = 'logms_err_gran'; format = 'D'
    name = 'm2l_u'; format = 'D'
    name = 'm2l_g'; format = 'D'
    name = 'm2l_r'; format = 'D'
    name = 'm2l_i'; format = 'D'
    name = 'm2l_z'; format = 'D'
    name = 'age_gama'; format = 'D'; unit = 'dex'
    name = 'ageerr_gama'; format = 'D'; unit = 'dex'
    name = 'Separation'; format = 'D'; unit = 'arcsec'
)

In [11]:
z1Use = z1[(np.isfinite(z1['MSTAR'])) & 
           (z1['MSTAR'] >= 5.0) & 
           (z1['MSTAR'] <= 13.0)]
print("# Number of useful stellar mass / total number of galaxies in z1: %5d / %5d" % (len(z1Use), len(z1)))

z2Use = z2[(np.isfinite(z2['MSTAR'])) & 
           (z2['MSTAR'] >= 5.0) & 
           (z2['MSTAR'] <= 13.0)]
print("# Number of useful stellar mass / total number of galaxies in z2: %5d / %5d" % (len(z2Use), len(z2)))

z3Use = z3[(np.isfinite(z3['MSTAR'])) & 
           (z3['MSTAR'] >= 5.0) & 
           (z3['MSTAR'] <= 13.0)]
print("# Number of useful stellar mass / total number of galaxies in z3: %5d / %5d" % (len(z3Use), len(z3)))


# Number of useful stellar mass / total number of galaxies in z1: 20030 / 20255
# Number of useful stellar mass / total number of galaxies in z2: 12869 / 12869
# Number of useful stellar mass / total number of galaxies in z3:  6417 /  6417

In [12]:
print("# Mean error for logMstar of z1: %5.3f" % np.nanmean(z1['MSTAR_ERR']))
print("# Mean error for logMstar of z2: %5.3f" % np.nanmean(z2['MSTAR_ERR']))
print("# Mean error for logMstar of z3: %5.3f" % np.nanmean(z3['MSTAR_ERR']))


# Mean error for logMstar of z1: 0.027
# Mean error for logMstar of z2: 0.033
# Mean error for logMstar of z3: 0.043

In [13]:
fig = plt.figure(figsize=(12, 12))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

# ---------------------------------------------------------------------------
# Scatter plot

# Matched ones 
ax1.scatter(z1['z_use'], z1['MSTAR'], s=20.0, 
            alpha=0.15, c='c', label='z1')

ax1.scatter(z2['z_use'], z2['MSTAR'], s=20.0, 
            alpha=0.15, c='g', label='z2')

ax1.scatter(z3['z_use'], z3['MSTAR'], s=20.0, 
            alpha=0.15, c='r', label='z3')

ax1.axhline(11.0, linewidth=4.0, linestyle='--')

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()
#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

# Label
ax1.set_xlabel('Redshift',  size=40)
ax1.set_ylabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)', size=40)
# Axis limits
ax1.set_xlim(0.0, 0.72)
ax1.set_ylim(8.0, 12.6)

ax1.legend(fontsize=25.0, loc=(0.8, 0.10), numpoints=1, 
           scatterpoints=1, markerscale=2.5)

ax1.text(0.10, 12.25, sed_model, fontweight='bold', fontsize=30)

fig.savefig('hsc_gama_sed_mass_redshift.png', dpi=90)


Compare Stellar Mass


In [14]:
# definitions for the axes
left, width    = 0.1, 0.71
right          = left + width 
bottom, height = 0.1, 0.88
bottom_h = left_h = left + width + 0.02
recScat = [left,   bottom, width, height]
recHist = [right,  bottom,  0.18, height]

In [15]:
z1Color = z1['gmag_cmodel'] - z1['rmag_cmodel']
z1Age = z1['AGE']
z1MsHSC  = z1['MSTAR']
z1MsHSCErr = z1['MSTAR_ERR']
z1MsSDSS = z1['logms_gran']
z1MsGAMA = z1['logms_gama']

fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = plt.axes(recScat)
ax2 = plt.axes(recHist)

# ---------------------------------------------------------------------------
# Scatter plot

# SDSS v.s. HSC
p = ax1.scatter(z1MsSDSS, (z1MsHSC - z1MsSDSS), 
                c=z1Color, s=z1Age * 10.0, alpha=0.4, 
                label='z1/SDSS', vmin=-0.5, vmax=1.5)

# Color bar 
cax = fig.add_axes([0.46, 0.88, 0.3, 0.05]) 
cb = plt.colorbar(p, orientation="horizontal", cax=cax)
cb.ax.set_xlabel(r'$(g-r)_{cmodel}$ (mag)', fontsize=20)

ax1.text(0.67, 0.75, 'Size: iSEDFit Age', fontsize=20, 
         transform = ax1.transAxes)

# Zero line
ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax1.axhline(np.nanmean(z1MsHSCErr), linestyle='dashed', linewidth=3.5)
ax1.axhline(-1.0 * np.nanmean(z1MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax1.axhline(np.nanmedian((z1MsHSC - z1MsSDSS)), color='k',
            alpha=0.65, linewidth=3.0)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()
#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (SDSS/Granada)',  size=30)
ax1.set_ylabel('$\Delta\ [\log\ (M_{\star}/M_{\odot})]$ (HSC-SDSS)', size=30)
# Axis limits
ax1.set_xlim(6.5, 12.8)
ax1.set_ylim(-1.8, 2.0)

ax1.text(7.0, 1.7, '$0.0 < z < 0.2$', fontsize=30)
ax1.text(7.0, 1.5, sed_model, fontsize=22, fontweight='bold')

# ---------------------------------------------------------------------------
# Histogram 
n, bins, patches=ax2.hist((z1MsHSC - z1MsSDSS), bins=60, range=[-1.8, 2.0], 
                             orientation='horizontal', histtype='stepfilled', 
                             color='g', alpha=0.4, normed=1)
#n, bins, patches=ax2.hist((yuse-xuse), bins=50, range=[-1.2, 4.2], 
#                             orientation='horizontal', histtype='step', 
#                             color='k', alpha=0.8, normed=1, linewidth=3.5)

ax2.set_ylim(ax1.get_ylim())

#ax2.legend(fontsize=15)

# Axes setup
#  Minor Ticks on 
ax2.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax2.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax2.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax2.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax2.tick_params('both', length=10, width=3.0, which='major')
ax2.tick_params('both', length=6, width=2.5, which='minor')


ax2.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax2.axhline(np.nanmean(z1MsHSCErr), linestyle='dashed', linewidth=3.5)
ax2.axhline(-1.0 * np.nanmean(z1MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax2.axhline(np.nanmedian((z1MsHSC - z1MsSDSS)), color='k',
            alpha=0.65, linewidth=3.0)

ax2.yaxis.set_major_formatter(NullFormatter())
ax2.xaxis.set_major_formatter(NullFormatter())

#fig.savefig('hsc_gama_cmodelmag_i_1.png', dpi=90)



In [16]:
z1Color = z1['gmag_cmodel'] - z1['rmag_cmodel']
z1Age = z1['AGE']
z1MsHSC  = z1['MSTAR']
z1MsHSCErr = z1['MSTAR_ERR']
z1MsSDSS = z1['logms_gran']
z1MsGAMA = z1['logms_gama'] + np.log10(z1['fluxscale_gama'])

fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = plt.axes(recScat)
ax2 = plt.axes(recHist)

# ---------------------------------------------------------------------------
# Scatter plot

# GAMA v.s. HSC
p = ax1.scatter(z1MsGAMA, (z1MsHSC - z1MsGAMA), 
                c=z1Color, s=z1Age * 10.0, alpha=0.4, 
                label='z1/GAMA', vmin=-0.5, vmax=1.5)

# Color bar 
cax = fig.add_axes([0.46, 0.88, 0.3, 0.05]) 
cb = plt.colorbar(p, orientation="horizontal", cax=cax)
cb.ax.set_xlabel(r'$(g-r)_{cmodel}$ (mag)', fontsize=20)

ax1.text(0.67, 0.75, 'Size: iSEDFit Age', fontsize=20, 
         transform = ax1.transAxes)

# Zero line
ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax1.axhline(np.nanmean(z1MsHSCErr), linestyle='dashed', linewidth=3.5)
ax1.axhline(-1.0 * np.nanmean(z1MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax1.axhline(np.nanmedian((z1MsHSC - z1MsGAMA)), color='k',
            alpha=0.65, linewidth=3.0)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()
#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (GAMA)',  size=30)
ax1.set_ylabel('$\Delta\ [\log\ (M_{\star}/M_{\odot})]$ (HSC-GAMA)', size=30)
# Axis limits
ax1.set_xlim(6.5, 12.8)
ax1.set_ylim(-1.8, 2.0)

ax1.text(7.0, 1.7, '$0.0 < z < 0.2$', fontsize=30)
ax1.text(7.0, 1.5, sed_model, fontsize=22, fontweight='bold')

# ---------------------------------------------------------------------------
# Histogram 
n, bins, patches=ax2.hist((z1MsHSC - z1MsGAMA), bins=60, range=[-1.8, 2.0], 
                             orientation='horizontal', histtype='stepfilled', 
                             color='g', alpha=0.4, normed=1)
#n, bins, patches=ax2.hist((yuse-xuse), bins=50, range=[-1.2, 4.2], 
#                             orientation='horizontal', histtype='step', 
#                             color='k', alpha=0.8, normed=1, linewidth=3.5)

ax2.set_ylim(ax1.get_ylim())

#ax2.legend(fontsize=15)

# Axes setup
#  Minor Ticks on 
ax2.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax2.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax2.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax2.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax2.tick_params('both', length=10, width=3.0, which='major')
ax2.tick_params('both', length=6, width=2.5, which='minor')


ax2.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax2.axhline(np.nanmean(z1MsHSCErr), linestyle='dashed', linewidth=3.5)
ax2.axhline(-1.0 * np.nanmean(z1MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax2.axhline(np.nanmedian((z1MsHSC - z1MsGAMA)), color='k',
            alpha=0.65, linewidth=3.0)

ax2.yaxis.set_major_formatter(NullFormatter())
ax2.xaxis.set_major_formatter(NullFormatter())

#fig.savefig('hsc_gama_cmodelmag_i_1.png', dpi=90)



In [17]:
z2Color = z2['gmag_cmodel'] - z2['rmag_cmodel']
z2Age = z2['AGE']
z2MsHSC  = z2['MSTAR']
z2MsHSCErr = z2['MSTAR_ERR']
z2MsSDSS = z2['logms_gran']
z2MsGAMA = z2['logms_gama']

fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = plt.axes(recScat)
ax2 = plt.axes(recHist)

# ---------------------------------------------------------------------------
# Scatter plot

# SDSS v.s. HSC
p = ax1.scatter(z2MsSDSS, (z2MsHSC - z2MsSDSS), 
                c=z2Color, s=z2Age * 10.0, alpha=0.4, 
                label='z2/SDSS', vmin=0.6, vmax=1.8)

# Color bar 
cax = fig.add_axes([0.46, 0.88, 0.3, 0.05]) 
cb = plt.colorbar(p, orientation="horizontal", cax=cax)
cb.ax.set_xlabel(r'$(g-r)_{cmodel}$ (mag)', fontsize=20)

ax1.text(0.67, 0.75, 'Size: iSEDFit Age', fontsize=20, 
         transform = ax1.transAxes)

# Zero line
ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax1.axhline(np.nanmean(z2MsHSCErr), linestyle='dashed', linewidth=3.5)
ax1.axhline(-1.0 * np.nanmean(z2MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax1.axhline(np.nanmedian((z2MsHSC - z2MsSDSS)), color='k',
            alpha=0.65, linewidth=3.0)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()
#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (SDSS/Granada)',  size=30)
ax1.set_ylabel('$\Delta\ [\log\ (M_{\star}/M_{\odot})]$ (HSC-SDSS)', size=30)
# Axis limits
ax1.set_xlim(9.0, 12.6)
ax1.set_ylim(-1.8, 1.5)

ax1.text(9.3, 1.2, '$0.2 < z < 0.4$', fontsize=30)
ax1.text(9.3, 1.0, sed_model, fontsize=22, fontweight='bold')

# ---------------------------------------------------------------------------
# Histogram 
n, bins, patches=ax2.hist((z2MsHSC - z2MsSDSS), bins=60, range=[-1.8, 1.5], 
                             orientation='horizontal', histtype='stepfilled', 
                             color='g', alpha=0.4, normed=1)
#n, bins, patches=ax2.hist((yuse-xuse), bins=50, range=[-1.2, 4.2], 
#                             orientation='horizontal', histtype='step', 
#                             color='k', alpha=0.8, normed=1, linewidth=3.5)

ax2.set_ylim(ax1.get_ylim())

#ax2.legend(fontsize=15)

# Axes setup
#  Minor Ticks on 
ax2.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax2.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax2.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax2.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax2.tick_params('both', length=10, width=3.0, which='major')
ax2.tick_params('both', length=6, width=2.5, which='minor')


ax2.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax2.axhline(np.nanmean(z2MsHSCErr), linestyle='dashed', linewidth=3.5)
ax2.axhline(-1.0 * np.nanmean(z2MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax2.axhline(np.nanmedian((z2MsHSC - z2MsSDSS)), color='k',
            alpha=0.65, linewidth=3.0)

ax2.yaxis.set_major_formatter(NullFormatter())
ax2.xaxis.set_major_formatter(NullFormatter())

#fig.savefig('hsc_gama_cmodelmag_i_1.png', dpi=90)



In [18]:
z2Color = z2['gmag_cmodel'] - z2['rmag_cmodel']
z2Age = z2['AGE']
z2MsHSC  = z2['MSTAR']
z2MsHSCErr = z2['MSTAR_ERR']
z2MsSDSS = z2['logms_gran']
z1MsGAMA = z1['logms_gama'] + np.log10(z1['fluxscale_gama'])

fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = plt.axes(recScat)
ax2 = plt.axes(recHist)

# ---------------------------------------------------------------------------
# Scatter plot

# GAMA v.s. HSC
p = ax1.scatter(z2MsSDSS, (z2MsHSC - z2MsGAMA), 
                c=z2Color, s=z2Age * 10.0, alpha=0.4, 
                label='z2/GAMA', vmin=0.6, vmax=1.8)

# Color bar 
cax = fig.add_axes([0.46, 0.88, 0.3, 0.05]) 
cb = plt.colorbar(p, orientation="horizontal", cax=cax)
cb.ax.set_xlabel(r'$(g-r)_{cmodel}$ (mag)', fontsize=20)

ax1.text(0.67, 0.75, 'Size: iSEDFit Age', fontsize=20, 
         transform = ax1.transAxes)

# Zero line
ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax1.axhline(np.nanmean(z2MsHSCErr), linestyle='dashed', linewidth=3.5)
ax1.axhline(-1.0 * np.nanmean(z2MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax1.axhline(np.nanmedian((z2MsHSC - z2MsGAMA)), color='k',
            alpha=0.65, linewidth=3.0)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()
#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (GAMA)',  size=30)
ax1.set_ylabel('$\Delta\ [\log\ (M_{\star}/M_{\odot})]$ (HSC-GAMA)', size=30)
# Axis limits
ax1.set_xlim(9.0, 12.6)
ax1.set_ylim(-1.8, 1.5)

ax1.text(9.3, 1.2, '$0.2 < z < 0.4$', fontsize=30)
ax1.text(9.3, 1.0, sed_model, fontsize=22, fontweight='bold')

# ---------------------------------------------------------------------------
# Histogram 
n, bins, patches=ax2.hist((z2MsHSC - z2MsGAMA), bins=60, range=[-1.8, 1.5], 
                             orientation='horizontal', histtype='stepfilled', 
                             color='g', alpha=0.4, normed=1)
#n, bins, patches=ax2.hist((yuse-xuse), bins=50, range=[-1.2, 4.2], 
#                             orientation='horizontal', histtype='step', 
#                             color='k', alpha=0.8, normed=1, linewidth=3.5)

ax2.set_ylim(ax1.get_ylim())

#ax2.legend(fontsize=15)

# Axes setup
#  Minor Ticks on 
ax2.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax2.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax2.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax2.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax2.tick_params('both', length=10, width=3.0, which='major')
ax2.tick_params('both', length=6, width=2.5, which='minor')


ax2.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax2.axhline(np.nanmean(z2MsHSCErr), linestyle='dashed', linewidth=3.5)
ax2.axhline(-1.0 * np.nanmean(z2MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax2.axhline(np.nanmedian((z2MsHSC - z2MsGAMA)), color='k',
            alpha=0.65, linewidth=3.0)

ax2.yaxis.set_major_formatter(NullFormatter())
ax2.xaxis.set_major_formatter(NullFormatter())

#fig.savefig('hsc_gama_cmodelmag_i_1.png', dpi=90)



In [19]:
z3Color = z3['gmag_cmodel'] - z3['rmag_cmodel']
z3Age = z3['AGE']
z3MsHSC  = z3['MSTAR']
z3MsHSCErr = z3['MSTAR_ERR']
z3MsSDSS = z3['logms_gran']
z3MsGAMA = z3['logms_gama']

fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
ax1 = plt.axes(recScat)
ax2 = plt.axes(recHist)

# ---------------------------------------------------------------------------
# Scatter plot

# SDSS v.s. HSC
p = ax1.scatter(z3MsSDSS, (z3MsHSC - z3MsSDSS), 
                c=z3Color, s=z3Age * 10.0, alpha=0.4, 
                label='z2/SDSS', vmin=0.6, vmax=2.2)

# Color bar 
cax = fig.add_axes([0.46, 0.88, 0.3, 0.05]) 
cb = plt.colorbar(p, orientation="horizontal", cax=cax)
cb.ax.set_xlabel(r'$(g-r)_{cmodel}$ (mag)', fontsize=20)

ax1.text(0.67, 0.75, 'Size: iSEDFit Age', fontsize=20, 
         transform = ax1.transAxes)

# Zero line
ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax1.axhline(np.nanmean(z3MsHSCErr), linestyle='dashed', linewidth=3.5)
ax1.axhline(-1.0 * np.nanmean(z3MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax1.axhline(np.nanmedian((z3MsHSC - z3MsSDSS)), color='k',
            alpha=0.65, linewidth=3.0)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()
#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (SDSS/Granada)',  size=30)
ax1.set_ylabel('$\Delta\ [\log\ (M_{\star}/M_{\odot})]$ (HSC-SDSS)', size=30)
# Axis limits
ax1.set_xlim(10.0, 12.6)
ax1.set_ylim(-1.8, 1.5)

ax1.text(10.2, 1.2, '$0.4 < z < 0.7$', fontsize=30)
ax1.text(10.2, 1.0, sed_model, fontsize=22, fontweight='bold')

# ---------------------------------------------------------------------------
# Histogram 
n, bins, patches=ax2.hist((z3MsHSC - z3MsSDSS), bins=60, range=[-1.8, 1.5], 
                             orientation='horizontal', histtype='stepfilled', 
                             color='g', alpha=0.4, normed=1)
#n, bins, patches=ax2.hist((yuse-xuse), bins=50, range=[-1.2, 4.2], 
#                             orientation='horizontal', histtype='step', 
#                             color='k', alpha=0.8, normed=1, linewidth=3.5)

ax2.set_ylim(ax1.get_ylim())

#ax2.legend(fontsize=15)

# Axes setup
#  Minor Ticks on 
ax2.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax2.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax2.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax2.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax2.tick_params('both', length=10, width=3.0, which='major')
ax2.tick_params('both', length=6, width=2.5, which='minor')


ax2.axhline(0.0, alpha=0.7, linewidth=2.0)

# Horizontal line 
ax2.axhline(np.nanmean(z3MsHSCErr), linestyle='dashed', linewidth=3.5)
ax2.axhline(-1.0 * np.nanmean(z3MsHSCErr), linestyle='dashed', 
            linewidth=3.5)

ax2.axhline(np.nanmedian((z3MsHSC - z3MsSDSS)), color='k',
            alpha=0.65, linewidth=3.0)

ax2.yaxis.set_major_formatter(NullFormatter())
ax2.xaxis.set_major_formatter(NullFormatter())

#fig.savefig('hsc_gama_cmodelmag_i_1.png', dpi=90)


HSC Stellar Mass Histogram


In [66]:
z1a = z1[(z1['z_use'] <= 0.10)]
z1b = z1[(z1['z_use'] > 0.10) & (z1['z_use'] <= 0.20)]
z2a = z2[(z2['z_use'] > 0.20) & (z2['z_use'] <= 0.30)]
z2b = z2[(z2['z_use'] > 0.30) & (z2['z_use'] <= 0.40)]
z3a = z3[(z3['z_use'] > 0.40) & (z3['z_use'] <= 0.50)]
z3b = z3[(z3['z_use'] > 0.50) & (z3['z_use'] <= 0.60)]
z3c = z3[(z3['z_use'] > 0.60) & (z3['z_use'] <= 0.70)]

fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

ax1.axvline(11.4, linewidth=8.0, color='k', alpha=0.4)

# ---------------------------------------------------------------------------
# Histogram 
n1n, bins1, patches1=ax1.hist(z1a['MSTAR'], bins=27, range=[9.5, 12.2], 
                              orientation='vertical', histtype='stepfilled', 
                              color='g', alpha=0.5, normed=1, label='$0.0<z<0.1$')

n2n, bins2, patches2=ax1.hist(z1b['MSTAR'], bins=27, range=[9.5, 12.2], 
                              orientation='vertical', histtype='stepfilled', 
                              color='c', alpha=0.7, normed=1, label='$0.1<z<0.2$')

n3n, bins3, patches3=ax1.hist(z2a['MSTAR'], bins=27, range=[9.5, 12.2], 
                              orientation='vertical', histtype='step', 
                              color='k', alpha=0.9, normed=1, label='$0.2<z<0.3$',
                              linewidth=3.5)

n4n, bins4, patches4=ax1.hist(z2b['MSTAR'], bins=27, range=[9.5, 12.2], 
                              orientation='vertical', histtype='step', 
                              color='k', alpha=0.9, normed=1, label='$0.3<z<0.4$',
                              linestyle='dashed', linewidth=3.5)

n5n, bins5, patches5=ax1.hist(z3a['MSTAR'], bins=27, range=[9.5, 12.2], 
                              orientation='vertical', histtype='step', 
                              color='r', alpha=0.9, normed=1, label='$0.4<z<0.5$',
                              linewidth=3.5)

n6n, bins6, patches6=ax1.hist(z3b['MSTAR'], bins=27, range=[9.5, 12.2], 
                              orientation='vertical', histtype='step', 
                              color='r', alpha=0.9, normed=1, label='$0.5<z<0.6$',
                              linestyle='dashed', linewidth=3.5)

ax1.legend(fontsize=20)

ax1.set_xlim(9.65, 12.30)
ax1.set_ylim(0.001, 2.30)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)',  size=30)
ax1.set_ylabel('Normalized #', size=30)

ax1.text(0.05, 0.92, sed_model, fontsize=30, fontweight='bold', 
         transform=ax1.transAxes)


Out[66]:
<matplotlib.text.Text at 0x114893f90>

In [108]:
fig = plt.figure(figsize=(13, 9))
#fig.subplots_adjust(left=0.1, right=0.95, bottom=0.15)
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

ax1.axvline(11.4, linewidth=8.0, color='k', alpha=0.4)

# ---------------------------------------------------------------------------
# Histogram 
n1, bins1, patches1=ax1.hist(z1a['MSTAR'], bins=27, range=[9.5, 12.2], 
                             orientation='vertical', histtype='stepfilled', 
                             color='g', alpha=0.5, normed=0, label='$0.0<z<0.1$')

n2, bins2, patches2=ax1.hist(z1b['MSTAR'], bins=27, range=[9.5, 12.2], 
                             orientation='vertical', histtype='stepfilled', 
                             color='c', alpha=0.7, normed=0, label='$0.1<z<0.2$')

n3, bins3, patches3=ax1.hist(z2a['MSTAR'], bins=27, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='k', alpha=0.9, normed=0, label='$0.2<z<0.3$',
                             linewidth=3.5)

n4, bins4, patches4=ax1.hist(z2b['MSTAR'], bins=27, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='k', alpha=0.9, normed=0, label='$0.3<z<0.4$',
                             linestyle='dashed', linewidth=3.5)

n5, bins5, patches5=ax1.hist(z3a['MSTAR'], bins=27, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='r', alpha=0.9, normed=0, label='$0.4<z<0.5$',
                             linewidth=3.5)

n6, bins6, patches6=ax1.hist(z3b['MSTAR'], bins=27, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='r', alpha=0.9, normed=0, label='$0.5<z<0.6$',
                             linestyle='dashed', linewidth=3.5)

ax1.legend(fontsize=20)

ax1.set_xlim(9.65, 12.30)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)',  size=30)
ax1.set_ylabel('#', size=30)

ax1.text(0.05, 0.92, sed_model, fontsize=30, fontweight='bold', 
         transform=ax1.transAxes)


Out[108]:
<matplotlib.text.Text at 0x12b1993d0>

Histogram of Number Density


In [90]:
import cosmology
c=cosmology.Cosmo(H0=70.0, omega_m=0.3, omega_l=0.7, flat=1)

In [91]:
binSize = 0.1
area = 54.0

In [92]:
d1 = (c.V(np.nanmin(z1a['z_use']), np.nanmax(z1a['z_use'])) / ((360.0 ** 2.0) / np.pi)) * area
d2 = (c.V(np.nanmin(z1b['z_use']), np.nanmax(z1b['z_use'])) / ((360.0 ** 2.0) / np.pi)) * area
d3 = (c.V(np.nanmin(z2a['z_use']), np.nanmax(z2a['z_use'])) / ((360.0 ** 2.0) / np.pi)) * area
d4 = (c.V(np.nanmin(z2b['z_use']), np.nanmax(z2b['z_use'])) / ((360.0 ** 2.0) / np.pi)) * area
d5 = (c.V(np.nanmin(z3a['z_use']), np.nanmax(z3a['z_use'])) / ((360.0 ** 2.0) / np.pi)) * area
d6 = (c.V(np.nanmin(z3b['z_use']), np.nanmax(z3b['z_use'])) / ((360.0 ** 2.0) / np.pi)) * area

In [101]:
print(d1, d2, d3, d4, d5, d6)


401529.537603 2584807.22556 6354314.08676 11115862.3631 16447651.427 21949200.0003

In [93]:
dn1 = np.log10(n1 / (d1 * binSize))
dn2 = np.log10(n2 / (d2 * binSize))
dn3 = np.log10(n3 / (d3 * binSize))
dn4 = np.log10(n4 / (d4 * binSize))
dn5 = np.log10(n5 / (d5 * binSize))
dn6 = np.log10(n6 / (d6 * binSize))


/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:1: RuntimeWarning: divide by zero encountered in log10
  if __name__ == '__main__':
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:2: RuntimeWarning: divide by zero encountered in log10
  from ipykernel import kernelapp as app
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:3: RuntimeWarning: divide by zero encountered in log10
  app.launch_new_instance()
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:4: RuntimeWarning: divide by zero encountered in log10
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:5: RuntimeWarning: divide by zero encountered in log10
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:6: RuntimeWarning: divide by zero encountered in log10

In [98]:
fig = plt.figure(figsize=(12, 12))
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

ax1.axvline(11.4, color='k', linewidth=8.0, alpha=0.4)

ax1.plot((bins1[1:] + bins1[0:-1])/2.0, dn1, c='g', 
         linewidth=4.0, label='$0.0 < z < 0.1$')
ax1.plot((bins2[1:] + bins2[0:-1])/2.0, dn2, c='b', 
         linewidth=3.5, label='$0.1 < z < 0.2$')
ax1.plot((bins3[1:] + bins3[0:-1])/2.0, dn3, c='k', 
         linewidth=3.5, label='$0.2 < z < 0.3$')
ax1.plot((bins4[1:] + bins4[0:-1])/2.0, dn4, c='k', 
         linewidth=3.5, linestyle='dashed', label='$0.3 < z < 0.4$')
ax1.plot((bins5[1:] + bins5[0:-1])/2.0, dn5, c='r', 
         linewidth=3.0, label='$0.4 < z < 0.5$')
ax1.plot((bins6[1:] + bins6[0:-1])/2.0, dn6, c='r', 
         linewidth=3.0, linestyle='dashed', label='$0.5 < z < 0.6$')

ax1.legend(fontsize=25)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

ax1.set_ylim(-6.99, -1.001)

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)',  size=30)
ax1.set_ylabel('$dN/d\logM_{\star}\ [{\mathrm{Mpc}^{-3}}{\mathrm{dex}^{-1}}]$', size=30)


Out[98]:
<matplotlib.text.Text at 0x1115a4a90>

Compare with redMapper matched cluster


In [102]:
red = fits.open('redmapper/hsc_redmapper_cluster_gama_hscmass_1509.fits')[1].data
red1 = red[red['Z_LAMBDA'] <= 0.1]
red2 = red[(red['Z_LAMBDA'] > 0.1) & (red['Z_LAMBDA'] <= 0.2)]
red3 = red[(red['Z_LAMBDA'] > 0.2) & (red['Z_LAMBDA'] <= 0.3)]
red4 = red[(red['Z_LAMBDA'] > 0.3) & (red['Z_LAMBDA'] <= 0.4)]
red5 = red[(red['Z_LAMBDA'] > 0.4) & (red['Z_LAMBDA'] <= 0.5)]

In [115]:
len(red)


Out[115]:
159

In [107]:
fig = plt.figure(figsize=(13, 9))
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

# ---------------------------------------------------------------------------
# Histogram 
n1, bins1, patches1=ax1.hist(z1b['MSTAR'], bins=30, range=[9.5, 12.2], 
                             orientation='vertical', histtype='stepfilled', 
                             color='g', alpha=0.15, normed=1, label='All $0.1<z<0.2$',
                             linewidth=3.5)
n1, bins1, patches1=ax1.hist(red2['MSTAR'], bins=15, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='g', alpha=1.0, normed=1, label='BCG $0.1<z<0.2$',
                             linewidth=3.5, linestyle='solid')

n3, bins3, patches3=ax1.hist(z2a['MSTAR'], bins=30, range=[9.5, 12.2], 
                             orientation='vertical', histtype='stepfilled', 
                             color='b', alpha=0.15, normed=1, label='All $0.2<z<0.3$',
                             linewidth=3.5)
n1, bins1, patches1=ax1.hist(red3['MSTAR'], bins=25, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='b', alpha=0.9, normed=1, label='BCG $0.2<z<0.3$',
                             linewidth=3.5, linestyle='dashed')

n4, bins4, patches4=ax1.hist(z2b['MSTAR'], bins=30, range=[9.5, 12.2], 
                             orientation='vertical', histtype='stepfilled', 
                             color='k', alpha=0.15, normed=1, label='All $0.3<z<0.4$',
                             linewidth=3.5)
n1, bins1, patches1=ax1.hist(red4['MSTAR'], bins=20, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='k', alpha=0.7, normed=1, label='BCG $0.3<z<0.4$',
                             linewidth=4.0, linestyle='solid')

n5, bins5, patches5=ax1.hist(z3a['MSTAR'], bins=30, range=[9.5, 12.2], 
                             orientation='vertical', histtype='stepfilled', 
                             color='r', alpha=0.15, normed=1, label='All $0.4<z<0.5$',
                             linewidth=3.5)
n1, bins1, patches1=ax1.hist(red5['MSTAR'], bins=15, range=[9.5, 12.2], 
                             orientation='vertical', histtype='step', 
                             color='r', alpha=0.5, normed=1, label='BCG $0.4<z<0.5$',
                             linewidth=5.0, linestyle='dashed')

ax1.legend(fontsize=20, loc=(0.05, 0.55))

ax1.set_xlim(10.25, 12.2)
ax1.set_ylim(-0.001, 3.2)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)',  size=30)
ax1.set_ylabel('Normalized #', size=30)

ax1.text(0.66, 0.93, sed_model, fontsize=26, fontweight='bold', 
         transform=ax1.transAxes)


Out[107]:
<matplotlib.text.Text at 0x122609e10>

In [111]:
fig = plt.figure(figsize=(13, 9))
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

# ---------------------------------------------------------------------------
# Histogram 
r2, rb2, patches2=ax1.hist(red2['MSTAR'], bins=9, range=[10.6, 12.4], 
                             orientation='vertical', histtype='step', 
                             color='g', alpha=1.0, normed=0, label='BCG $0.1<z<0.2$',
                             linewidth=3.5, linestyle='solid')

r3, rb3, patches3=ax1.hist(red3['MSTAR'], bins=9, range=[10.6, 12.4], 
                             orientation='vertical', histtype='step', 
                             color='b', alpha=0.9, normed=0, label='BCG $0.2<z<0.3$',
                             linewidth=3.5, linestyle='dashed')

r4, rb4, patches4=ax1.hist(red4['MSTAR'], bins=9, range=[10.6, 12.4], 
                             orientation='vertical', histtype='step', 
                             color='k', alpha=0.7, normed=0, label='BCG $0.3<z<0.4$',
                             linewidth=4.0, linestyle='solid')

r5, rb5, patches5=ax1.hist(red5['MSTAR'], bins=9, range=[10.6, 12.4], 
                             orientation='vertical', histtype='step', 
                             color='r', alpha=0.5, normed=0, label='BCG $0.4<z<0.5$',
                             linewidth=5.0, linestyle='dashed')

ax1.legend(fontsize=22, loc=(0.05, 0.70))

ax1.set_xlim(10.25, 12.2)
#ax1.set_ylim(-0.001, 3.2)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)',  size=30)
ax1.set_ylabel('#', size=30)

ax1.text(0.66, 0.93, sed_model, fontsize=26, fontweight='bold', 
         transform=ax1.transAxes)


Out[111]:
<matplotlib.text.Text at 0x12b9a73d0>

In [112]:
dr2 = np.log10(r2 / (d2 * binSize))
dr3 = np.log10(r3 / (d3 * binSize))
dr4 = np.log10(r4 / (d4 * binSize))
dr5 = np.log10(r5 / (d5 * binSize))


/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:1: RuntimeWarning: divide by zero encountered in log10
  if __name__ == '__main__':
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:2: RuntimeWarning: divide by zero encountered in log10
  from ipykernel import kernelapp as app
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:3: RuntimeWarning: divide by zero encountered in log10
  app.launch_new_instance()
/usr/local/lib/python2.7/site-packages/ipykernel/__main__.py:4: RuntimeWarning: divide by zero encountered in log10

In [114]:
fig = plt.figure(figsize=(12, 12))
rec = [0.10, 0.10, 0.89, 0.89]
ax1 = plt.axes(rec)

ax1.axvline(11.4, color='k', linewidth=8.0, alpha=0.4)

#ax1.plot((bins1[1:] + bins1[0:-1])/2.0, dn1, c='g', 
#         linewidth=4.0, label='$0.0 < z < 0.1$')
ax1.plot((bins2[1:] + bins2[0:-1])/2.0, dn2, c='b', 
         linewidth=3.5, label='$0.1 < z < 0.2$', alpha=0.7)
ax1.plot((bins3[1:] + bins3[0:-1])/2.0, dn3, c='g', 
         linewidth=3.5, label='$0.2 < z < 0.3$', alpha=0.7)
ax1.plot((bins4[1:] + bins4[0:-1])/2.0, dn4, c='k', 
         linewidth=3.5, label='$0.3 < z < 0.4$', alpha=0.7)
ax1.plot((bins5[1:] + bins5[0:-1])/2.0, dn5, c='r', 
         linewidth=3.0, label='$0.4 < z < 0.5$', alpha=0.7)
#ax1.plot((bins6[1:] + bins6[0:-1])/2.0, dn6, c='r', 
#         linewidth=3.0, linestyle='dashed', label='$0.5 < z < 0.6$')

ax1.plot((rb2[1:] + rb2[0:-1])/2.0, dr2, c='b', 
         linewidth=4.0, label='BCG $0.1 < z < 0.2$', 
         linestyle='dashed')
ax1.plot((rb3[1:] + rb3[0:-1])/2.0, dr3, c='g', 
         linewidth=4.0, label='BCG $0.2 < z < 0.3$', 
         linestyle='dashed')
ax1.plot((rb4[1:] + rb4[0:-1])/2.0, dr4, c='k', 
         linewidth=4.0, label='BCG $0.3 < z < 0.4$', 
         linestyle='dashed')
ax1.plot((rb5[1:] + rb5[0:-1])/2.0, dr5, c='r', 
         linewidth=4.0, label='BCG $0.5 < z < 0.5$', 
         linestyle='dashed')

ax1.legend(fontsize=20)

# Axes setup
#  Minor Ticks on 
ax1.minorticks_on()

#  Axes Thickness
for axis in ['top','bottom','left','right']:
  ax1.spines[axis].set_linewidth(3.5)
#  Tick Label Size 
for tick in ax1.xaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
for tick in ax1.yaxis.get_major_ticks():
    tick.label.set_fontsize(24) 
#  Tick Length and Width
ax1.tick_params('both', length=10, width=3.0, which='major')
ax1.tick_params('both', length=6, width=2.5, which='minor')

ax1.axhline(0.0, alpha=0.7, linewidth=2.0)

ax1.set_ylim(-6.99, -1.001)

# Label
ax1.set_xlabel('$\log\ (M_{\star}/M_{\odot})$ (HSC)',  size=30)
ax1.set_ylabel('$dN/d\logM_{\star}\ [{\mathrm{Mpc}^{-3}}{\mathrm{dex}^{-1}}]$', size=30)


Out[114]:
<matplotlib.text.Text at 0x12c2c7a50>

In [ ]: