grav pot output

This commit is contained in:
Mayeul Aubin 2025-03-17 11:38:30 +01:00
parent 78e1b4cacf
commit 1ca9b4fb09

View file

@ -48,12 +48,14 @@ def register_arguments_card(parser:ArgumentParser):
parser.add_argument("--OutputFCsSnapshot", type=str, default=None, help="Output FCs snapshot file.")
parser.add_argument("--OutputRngStateLPT", type=str, default=None, help="Output RNG state file.")
## Tests with phiBCs and density
parser.add_argument("--WriteGravPot", type=bool, default=True, help="Write gravitational potential.")
parser.add_argument("--WriteGravPot", type=bool, default=False, help="Write gravitational potential.")
parser.add_argument("--OutputGravitationalPotentialBase", type=str, default=None, help="Output gravitational potential base.")
parser.add_argument("--MeshGravPot", type=int, default=None, help="Mesh for gravitational potential.")
parser.add_argument("--WriteDensity", type=bool, default=False, help="Write density.")
parser.add_argument("--OutputDensityBase", type=str, default=None, help="Output density base.")
parser.add_argument("--MeshDensity", type=int, default=None, help="Mesh for density.")
parser.add_argument("--LoadPhiBCs", type=bool, default=False, help="Load phiBCs.")
parser.add_argument("--InputPhiBCsBase", type=str, default=None, help="Input phiBCs file base.")
def register_arguments_card_for_ICs(parser:ArgumentParser):
@ -132,6 +134,8 @@ def parse_arguments_card(parsed_args):
WriteDensity=parsed_args.WriteDensity,
OutputDensityBase=parsed_args.OutputDensityBase,
MeshDensity=parsed_args.MeshDensity,
LoadPhiBCs=parsed_args.LoadPhiBCs,
InputPhiBCsBase=parsed_args.InputPhiBCsBase,
## Cosmological parameters
h=cosmo_dict["h"],
Omega_m=cosmo_dict["Omega_m"],
@ -207,7 +211,7 @@ def parse_arguments_card(parsed_args):
if card_dict["OutputFinalDensity"] is None:
card_dict["OutputFinalDensity"] = main_dict["resultdir"]+ligthcone_prefix+"final_density_"+main_dict["simname"]+".h5"
if card_dict["OutputTilesBase"] is None:
card_dict["OutputTilesBase"] = main_dict["workdir"]+"sCOLA_tile"
card_dict["OutputTilesBase"] = main_dict["workdir"]+main_dict["simname"]+"_tile"
if card_dict["OutputLPTPotential1"] is None:
card_dict["OutputLPTPotential1"] = main_dict["workdir"]+"initial_conditions_DM_phi.h5"
if card_dict["OutputLPTPotential2"] is None:
@ -227,6 +231,8 @@ def parse_arguments_card(parsed_args):
card_dict["OutputDensityBase"] = main_dict["workdir"]+"density_"+main_dict["simname"]
if card_dict["MeshDensity"] is None:
card_dict["MeshDensity"] = card_dict["N_PM_mesh"]
if card_dict["InputPhiBCsBase"] is None:
card_dict["InputPhiBCsBase"] = main_dict["workdir"]+"gravpot_tCOLA"
return card_dict
@ -352,6 +358,8 @@ def create_parameter_card_dict(
WriteDensity:bool = False,
OutputDensityBase:str = 'density.h5',
MeshDensity:int = 128,
LoadPhiBCs:bool = False,
InputPhiBCsBase:str = 'gravitational_potential.h5',
## Cosmological parameters
h:float = 0.6732,
@ -421,6 +429,8 @@ def create_parameter_card_dict(
WriteDensity=int(WriteDensity),
OutputDensityBase=OutputDensityBase,
MeshDensity=MeshDensity,
LoadPhiBCs=int(LoadPhiBCs),
InputPhiBCsBase=InputPhiBCsBase,
h=h,
Omega_m=Omega_m,