print(dMlist)

    lensDc = utils.calc_Dc(lensZ, cosmo)
lensDa = lensDc / (1. + lensZ)

# Remove all galaxies with logmstar=NAN or Z<0
logmstarcat = logmstar
nanmask = np.isfinite(logmstar) & (0. < lensZ) & (lensZ < 0.5)
lensRA, lensDEC, lensDa, logmstar = [
    lensRA[nanmask], lensDEC[nanmask], lensDa[nanmask], logmstar[nanmask]
]

# Import the faint MICE catalogue
if 'faint' in cat:
    faintID, faintRA, faintDEC, faintZ, faintDc, faint_rmag, faint_rmag_abs, faint_e1, faint_e2, faint_logmstar =\
    utils.import_micecat('/data/users/brouwer/LensCatalogues', 'mice2_faint_catalog_1000deg2.fits', h)

    faintmask = (faint_rmag < 22.5)
    faintRA, faintDEC, faintZ, faintDc, faint_logmstar = \
        [faintRA[faintmask], faintDEC[faintmask], faintZ[faintmask], faintDc[faintmask], faint_logmstar[faintmask]]
    faintDa = faintDc / (1. + faintZ)

# Creating lens and satellite coordinates
lenscoords = SkyCoord(ra=lensRA * u.deg, dec=lensDEC * u.deg, distance=lensDa)
if 'faint' in cat:
    satcoords = SkyCoord(ra=faintRA * u.deg,
                         dec=faintDEC * u.deg,
                         distance=faintDa)
    logmstar_sat = faint_logmstar
else:
    satcoords = lenscoords
Пример #2
0
# Boundaries of the field
#fieldRAs, fieldDECs = [[i*20.+5.,(i+1)*20.+5.], [j*20.+5.,(j+1)*20.+5.]]
fieldRAs, fieldDECs = [[5., 25.], [5., 25.]]

# Selecting the galaxies lying within this field
fieldmask_lens = (fieldRAs[0] < lensRA)&(lensRA < fieldRAs[1]) & (fieldDECs[0] < lensDEC)&(lensDEC < fieldDECs[1])


# Importing the sources
path_srccat = '/data2/brouwer/KidsCatalogues'
if 'mice' in cat:
    #srccatname = 'mice_source_catalog_dc.fits'
    srccatname = 'mice2_source_catalog_big.fits'
    srcRA, srcDEC, srcZ, srcDc, rmag_src, rmag_abs_src, e1, e2, logmstar_src =\
    utils.import_micecat(path_srccat, srccatname, h)
else:
    srccatname = 'KiDS-450_mask_%s.fits'%fields[f]
    srcRA, srcDEC, srcZ, rmag, e1, e2, weight =\
    utils.import_srccat(path_srccat, srccatname)
    
print(srcRA, srcDEC, srcDc, e1, e2)
print(lensRA, lensDEC, lensDc)

# Creating the source mask
srcmask = (srcZmin < srcZ) & (srcZ < srcZmax) & (rmag_src > 20.) & (rmag_abs_src > -19.3)
fieldmask_src = (fieldRAs[0]-1. < srcRA)&(srcRA < fieldRAs[1]+1.) & (fieldDECs[0]-1. < srcDEC)&(srcDEC < fieldDECs[1]+1.)
srcmask = srcmask * fieldmask_src

# Masking the sources
srcRA, srcDEC, srcZ, srcDc, e1, e2  = \