Beispiel #1
0
logging.info('Startup options:')
logging.info('  Dyn. vs. Lens Mass:            %s', args.dynlensmass)
logging.info('  M200 vs. theta_E:              %s', args.mvirtheta)
logging.info('  Delta T vs. Mu:                %s', args.timedelaymagnification)
logging.info('  Histograms of Lenses:          %s', args.histogramoflenses)
logging.info('  Histograms of Sources:         %s', args.histogramofsources)
#logging.info('  ML-based strategies available: %s', loaded_ml_strategies)

# Sanity checks
#assert args.histogramoflenses in ['mass', 'redshift']
#assert args.histogramofsources in ['mass', 'redshift']

############################################################################
# Load Simulation Specifications
LCSettings = '/cosma5/data/dp004/dc-beck3/StrongLensing/shell_script/LCSettings.txt'
sim_dir, sim_phy, sim_name, sim_col, dd, hf_name, lc_dir, dd, HQ_dir = rf.Simulation_Specs(LCSettings)

# Node = 16 CPUs
CPUs = 5 # Number of CPUs to use has to be the same as in LensingMap/LM_create.py

###########################################################################
# Start calculation

if args.dynlensmass:
    assert LA
    LA.dyn_vs_lensing_mass(CPUs, sim_dir, sim_phy, sim_name, hf_name, lc_dir, HQ_dir)

elif args.mvirtheta:
    assert LA
    LA.M200_Rein(CPUs, sim_dir, sim_phy, sim_name, lc_dir, HQ_dir)
Beispiel #2
0
            X[:, 1],
            bins=[Ncells, Ncells],
            #range=[[0, 5500],
            #       [-30, 30]],
            weights=M)
    dx, dy = xedges[1] - xedges[0], yedges[1] - yedges[0]
    Sigma = mass_in_cells / (dx * dy)
    xs = 0.5 * (xedges[1:] + xedges[:-1])
    ys = 0.5 * (yedges[1:] + yedges[:-1])
    return Sigma, xs, ys


###############################################################################
# Load Simulation Specifications
LCSettings = '/cosma5/data/dp004/dc-beck3/shell_script/LCSettings.txt'
dd, sim_phy, sim_name, dd, dd, lc_dir, dd, HQ_dir = rf.Simulation_Specs(
    LCSettings)

###############################################################################
# Load Simulated Lightcone with Subhalos and Supernovae
lc_file = lc_dir[0] + 'LC_' + sim_name[0] + '.h5'
# Load LightCone Contents
LC = h5py.File(lc_file, 'r')

lc_sn_file = lc_dir[0] + 'LC_SN_' + sim_name[0] + '.h5'
# Load LightCone Contents
LC_SN = h5py.File(lc_sn_file, 'r')

###############################################################################
# Select Subhalos and Supernovae
HaloPosLC = LC['position_lc'][::10]
M200 = LC['Mvir'][::10] * 0.6774 / 1e10
import h5py
sys.path.insert(0, '/cosma5/data/dp004/dc-beck3')
import readlensing as rf
import readsnap

rc('figure', figsize=(8, 6))
rc('font', size=18)
rc('lines', linewidth=3)
rc('axes', linewidth=2)
rc('xtick.major', width=2)
rc('ytick.major', width=2)

###############################################################################
# Load halo lensing properties
LCSettings = '/cosma5/data/dp004/dc-beck3/shell_script/LCSettings.txt'
sim_dir, sim_phy, sim_name, sim_col, hd_dir, lc_dir, glafic_dir, HQ_dir = rf.Simulation_Specs(
    LCSettings)
lens_dir = '/cosma5/data/dp004/dc-beck3/LensingMap/'

h = 0.6774
labels = ['FP_GR', 'FP_F6']
colour = ['r', 'b']
###############################################################################

for sim in range(len(sim_dir))[:]:
    print('Analyse lensing map for: ', sim_name[sim])
    # Simulation Snapshots
    snapfile = sim_dir[sim] + 'snapdir_%03d/snap_%03d'
    # LightCone file for lens & source properties
    lc_file = lc_dir[sim] + 'LC_SN_' + sim_name[sim] + '.h5'
    # LensingMap files
    lm_dir = HQ_dir + 'LensingMap/' + sim_phy[sim] + '/' + sim_name[sim] + '/'