improvements
This commit is contained in:
parent
3dc03cec4f
commit
e488275523
11 changed files with 640 additions and 125 deletions
27
ICs.py
27
ICs.py
|
@ -4,12 +4,12 @@ def main_ICs(parsed_args):
|
|||
Main function for the initial conditions generator.
|
||||
"""
|
||||
from args_main import parse_arguments_main
|
||||
from parameters_card import parse_arguments_card
|
||||
from parameters_card import parse_arguments_card_for_ICs
|
||||
from low_level import print_starting_module, print_message, print_ending_module
|
||||
from os.path import isfile
|
||||
|
||||
main_dict = parse_arguments_main(parsed_args)
|
||||
card_dict, _ = parse_arguments_card(parsed_args)
|
||||
card_dict = parse_arguments_card_for_ICs(parsed_args)
|
||||
|
||||
print_starting_module("ICs", verbose=parsed_args.verbose)
|
||||
|
||||
|
@ -35,7 +35,7 @@ def main_ICs(parsed_args):
|
|||
|
||||
case "monofonic":
|
||||
if card_dict["ICsMode"] == 1 or card_dict["ICsMode"] == 0:
|
||||
raise ValueError("ICsMode is 1 or 2 but ICs_gen is monofonic.")
|
||||
raise ValueError("ICsMode is 1 or 0 but ICs_gen is monofonic.")
|
||||
elif card_dict["ICsMode"] == 2:
|
||||
print_message("ICsMode is 2 so the initial conditions will be generated using the monofonic ICs generator.", 1, "ICs", verbose=parsed_args.verbose)
|
||||
ICs_monofonic(parsed_args)
|
||||
|
@ -53,18 +53,27 @@ def main_ICs(parsed_args):
|
|||
|
||||
def ICs_monofonic(parsed_args):
|
||||
from monofonic import main_monofonic
|
||||
main_monofonic(parsed_args)
|
||||
from os.path import isfile
|
||||
from low_level import print_message
|
||||
from parameters_monofonic import parse_arguments_monofonic
|
||||
|
||||
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
||||
|
||||
if not isfile(monofonic_dict["output"]+"DM_delta.h5") or not isfile(monofonic_dict["output"]+"DM_phi2.h5") or not isfile(monofonic_dict["output"]+"DM_phi.h5") or parsed_args.force:
|
||||
main_monofonic(parsed_args)
|
||||
else:
|
||||
print_message(f"Monofonic output files found in {monofonic_dict['output']}. Use -F to overwrite.", 1, "monofonic", verbose=parsed_args.verbose)
|
||||
|
||||
|
||||
|
||||
def ICs_sbmy(parsed_args):
|
||||
from pysbmy.power import PowerSpectrum
|
||||
from low_level import print_starting_module, print_message
|
||||
from os.path import isfile
|
||||
from parameters_card import parse_arguments_card
|
||||
from parameters_card import parse_arguments_card_for_ICs
|
||||
|
||||
print_starting_module("sbmy IC", verbose=parsed_args.verbose)
|
||||
|
||||
card_dict, _ = parse_arguments_card(parsed_args)
|
||||
card_dict = parse_arguments_card_for_ICs(parsed_args)
|
||||
|
||||
power_spectrum_file = card_dict["InputPowerSpectrum"]
|
||||
|
||||
|
@ -167,7 +176,7 @@ def create_sbmy_white_noise_field(parsed_args, card_dict, white_noise_field_file
|
|||
if __name__ == "__main__":
|
||||
from argparse import ArgumentParser
|
||||
from args_main import register_arguments_main
|
||||
from parameters_card import register_arguments_card
|
||||
from parameters_card import register_arguments_card_for_ICs
|
||||
from cosmo_params import register_arguments_cosmo
|
||||
from parameters_monofonic import register_arguments_monofonic
|
||||
from slurm_submission import register_arguments_slurm
|
||||
|
@ -177,7 +186,7 @@ if __name__ == "__main__":
|
|||
register_arguments_main(parser)
|
||||
register_arguments_monofonic(parser)
|
||||
register_arguments_slurm(parser)
|
||||
register_arguments_card(parser)
|
||||
register_arguments_card_for_ICs(parser)
|
||||
register_arguments_cosmo(parser)
|
||||
parsed_args = parser.parse_args()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue