示例#1
0
    n_H_comov = rho_H / M_p  # cm^-3
    n_He_comov = rho_He / (4 * M_p)  # cm^-3
    a_start = 1. / (z_start + 1)
    rho_cgs = rho_gas_mean * 1e3 / a_start**3

    H = cosmo.get_Hubble(a_start) * 1000 / Mpc  # 1/sec

    # Set photoheating and photoionization rates
    uvb_rates = Load_Grackle_UVB_File(uvb_rates_file)
    uvb_parameters = {
        'scale_H': 1.0,
        'scale_He': 1.0,
        'delta_z_H': 0.0,
        'delta_z_He': 0.0
    }
    uvb_rates = Modify_UVB_Rates(uvb_parameters, uvb_rates)
    solution = Integrate_Evolution(n_H_comov,
                                   n_He_comov,
                                   T_start,
                                   uvb_rates,
                                   cosmo,
                                   z_start,
                                   z_end,
                                   n_samples,
                                   output_to_file=None)
    output_file_name = output_dir + 'solution.h5'
    Write_Solution(solution, output_file_name)
    #
    # z      = solution['z']
    # nH     = solution['n_H']
    # nHII   = solution['n_HII']
示例#2
0
param_vals = {}
param_vals[0] = [0.33, 0.54]
param_vals[1] = [0.75, 0.79]
param_vals[2] = [0.21, 0.38]
param_vals[3] = [0.02, 0.17]

param_grid = Get_Parameters_Combination(param_vals)
n_models = len(param_grid)

# model_id = rank
model_id = 'HL'
# Load the Original Rates
grackle_file_name = 'data/CloudyData_UVB_Puchwein2019_cloudy.h5'
rates_P19 = Load_Grackle_UVB_File(grackle_file_name)

# p_vals = param_grid[model_id]
p_vals = [0.45, 0.77, 0.31, 0.1]
uvb_parameters = {
    'scale_He': p_vals[0],
    'scale_H': p_vals[1],
    'delta_z_He': p_vals[2],
    'delta_z_H': p_vals[3]
}
uvb_rates = Modify_UVB_Rates(uvb_parameters, rates_P19)

solution = Integrate_Evolution(n_H_comov, n_He_comov, T_start, uvb_rates,
                               cosmo, z_start, z_end, n_samples)

output_file_name = output_dir + f'solution_{model_id}.h5'
Write_Solution(solution, output_file_name)