# Calculate the distance to the nearest satellite that is too heavy idx, sep2d, satdist3d = lenscoords_bin.match_to_catalog_3d( satcoords_bin, nthneighbor=2) satdistlist[massmask_lens] = satdist3d # Add the result to the catalogue (satdistcat[d])[nanmask] = satdistlist print('logmbins:', logmlims) print('dlogm:', dlogm) # Write the results to a fits table filename = '/data/users/brouwer/LensCatalogues/%s_isolated_galaxies_perc_h%i' % ( cat, h * 100.) if '-' in cat: name = cat.split('-')[-1] outputnames = np.append( ['ID', 'logmstar_%s' % name], ['dist%s%s_%s' % (n, rationame, name) for n in rationames]) else: outputnames = np.append(['ID', 'logmstar'], ['dist%s%s' % (n, rationame) for n in rationames]) formats = np.append(['D'] * 2, ['D'] * len(massratios)) output = np.append([lensID, logmstarcat], satdistcat, axis=0) print(outputnames, formats, output) utils.write_catalog('%s.fits' % filename, outputnames, formats, output)
# Import lens catalog fields, path_lenscat, lenscatname, lensID, lensRA, lensDEC, lensZ, lensDc, rmag, rmag_abs, logmstar =\ utils.import_lenscat(cat, h, cosmo) # Mean difference with the GAMA masses (log(M_ANN)-log(M_G)) if ('kids' in cat) or ('matched' in cat): #diff_GL = -0.10978165582547783 diff_GL = -0.056 else: diff_GL = 0. bias = 0.2 logmstar_GL = logmstar - diff_GL logmstar_min = logmstar_GL - bias logmstar_max = logmstar_GL + bias logmbar, logmbar_GL, logmbar_min, logmbar_max = \ [calc_logmbar(b) for b in [logmstar, logmstar_GL, logmstar_min, logmstar_max]] output = [lensID, logmstar, logmbar, logmstar_GL, logmbar_GL, \ logmstar_min, logmbar_min, logmstar_max, logmbar_max] outputnames = ['ID', 'logmstar', 'logmbar', 'logmstar_GL', 'logmbar_GL', \ 'logmstar_min', 'logmbar_min', 'logmstar_max', 'logmbar_max'] filename = '/data/users/brouwer/LensCatalogues/baryonic_mass_catalog_%s.fits' % cat formats = ['D'] * len(outputnames) utils.write_catalog(filename, outputnames, formats, output)