pynbody.plot.stars.hudson

Contents

pynbody.plot.stars.hudson#

pynbody.plot.stars.hudson(xmasses, z)[source]#

Based on Hudson+ (2014), returns what stellar mass corresponds to the halo mass passed in. This is the only SMHMR function that is not based on abundance matching, but instead uses date from CFHTLenS galaxy lensing data.

>>> from pynbody.plot.stars import hudson
>>> xmasses = np.logspace(np.log10(min(totmasshalos)),1+np.log10(max(totmasshalos)),20)
>>> ystarmasses, errors = hudson(xmasses,halo_catalog._halos[1].properties['z'])
>>> plt.fill_between(xmasses,np.array(ystarmasses)/np.array(errors),
                  y2=np.array(ystarmasses)*np.array(errors),
                  facecolor='#BBBBBB',color='#BBBBBB')