Commit ce1c4174 authored by Lukas Riedel's avatar Lukas Riedel

pfg script can now read the randomfield file. fixed bug where Python raw_input did not work

parent 21d7f64b
......@@ -27,7 +27,7 @@ class FFTH5Converter(BaseConverter):
"""
# read HDF5 file
with h5py.File(h5_path, 'r') as f:
y_data = np.array(f.get("/YField"), dtype=np.float64)
y_data = np.array(f.get("/stochastic"), dtype=np.float64)
parField = {"raw_field": y_data}
......
......@@ -32,7 +32,7 @@ def write_parameter_file(group,data_dict,out_path,attrs=None,overwrite=False):
"""
if os.path.isfile(out_path) and not overwrite:
ow = raw_input("The output file {} already exists. Overwrite? [y/N] ".format(out_path))
ow = input("The output file {} already exists. Overwrite? [y/N] ".format(out_path))
if not ow.lower() in ["y","yes"]:
raise RuntimeError("Aborting")
......
......@@ -69,7 +69,7 @@ if __name__ == "__main__":
print("FFT Field generator failed")
sys.exit(1)
out_path = cp.get("generator.fft","outputPath")
FFTH5Converter(args["param"], out_path + "/YField.h5")
FFTH5Converter(args["param"], out_path + "/YField.stoch.h5")
elif params["generator"] == "hdf5":
H5Converter(args["param"])
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment