예제 #1
0
# Currently 3 satellite particles per halo

x_sat = x_sat[::num_sat_parts]
y_sat = y_sat[::num_sat_parts]
z_sat = z_sat[::num_sat_parts]
Mvir_sat = Mvir_sat[::num_sat_parts]

import multiprocessing

num_threads = multiprocessing.cpu_count()
print("CPUS total ", num_threads)
print("total particles ", len(x))

start_time = time.time()

samples_sat = fasthod.mass_mask(x_sat, y_sat, z_sat, Mvir_sat, mass_bin_edges)

samples_sat = fasthod.subsample(samples_sat, subsample_array)

end_time_1 = time.time()
print('starting pair counting')
npairs_test = fasthod.create_npairs_corrfunc(samples_sat, samples_sat,
                                             r_bin_edges, boxsize, num_threads)
npairs_mass_r_bins_test = fasthod.npairs_conversion(samples_sat, samples_sat,
                                                    npairs_test, r_bin_edges)
print('pair counting done')
end_time_2 = time.time()
np.save(run_label + "_satsat.npy", npairs_mass_r_bins_test)

print(run_label)
print(path)
예제 #2
0
x_t, y_t, z_t, Mvir_t = fasthod.read_hdf5_more_files_unresolved(path)

x = np.append(x, x_t)
y = np.append(y, y_t)
z = np.append(z, z_t)
Mvir = np.append(Mvir, Mvir_t)

import multiprocessing

num_threads = multiprocessing.cpu_count()
print("CPUS total ", num_threads)
print("total particles ", len(x))

start_time = time.time()
samples_test = fasthod.mass_mask(x, y, z, Mvir, mass_bin_edges)

samples_test = fasthod.subsample(samples_test, subsample_array)

end_time_1 = time.time()
print('starting pair counting')
npairs_test = fasthod.create_npairs_corrfunc(samples_test, samples_test,
                                             r_bin_edges, boxsize, num_threads)
npairs_mass_r_bins_test = fasthod.npairs_conversion(samples_test, samples_test,
                                                    npairs_test, r_bin_edges)
print('pair counting done')
end_time_2 = time.time()
np.save(run_label + "_cencen.npy", npairs_mass_r_bins_test)

print(run_label)
print(path)
예제 #3
0
mass_bin_edges = config.mass_bin_edges
num_sat_parts = int(config.num_sat_parts)
run_label = config.run_label
subsample_array = config.subsample_array
# In this case we have an hdf5 file so read in using h5py

x, y, z, Mvir, is_central, halo_id = fasthod.read_hdf5_more_files(path)

x, y, z, Mvir, x_sat, y_sat, z_sat, Mvir_sat = fasthod.split_cen_sat(
    x, y, z, Mvir, is_central, halo_id)

x_sat = x_sat[::num_sat_parts]
y_sat = y_sat[::num_sat_parts]
z_sat = z_sat[::num_sat_parts]
Mvir_sat = Mvir_sat[::num_sat_parts]
samples_sat = fasthod.mass_mask(x_sat, y_sat, z_sat, Mvir_sat, mass_bin_edges)
samples_sat = fasthod.subsample(samples_sat, subsample_array)
del x_sat
del y_sat
del z_sat
del Mvir_sat
del halo_id
del is_central

x_t, y_t, z_t, Mvir_t = fasthod.read_hdf5_more_files_unresolved(path)

x = np.append(x, x_t)
y = np.append(y, y_t)
z = np.append(z, z_t)
Mvir = np.append(Mvir, Mvir_t)