Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change header replica0 #1342

Merged
merged 2 commits into from
Jul 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions validphys2/src/validphys/lhio.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ def generate_replica0(pdf, kin_grids=None, extra_fields=None):
if irep in loaded_grids:
grid = loaded_grids[irep]
else:
header, grid = load_replica(pdf, irep, kin_grids=kin_grids)
grid = load_replica(pdf, irep, kin_grids=kin_grids)[1]
RoyStegeman marked this conversation as resolved.
Show resolved Hide resolved
loaded_grids[irep] = grid
grids.append(grid)

# This takes care of failing if headers don't match
try:
M = rep_matrix(grids)
except ValueError as e:
raise ValueError("Null values found in replica grid matrix. "
"This may indicate that the headers don't match"
"If this is intentional try using use_rep0grid=True") from e
header = b'PdfType: central\nFormat: lhagrid1\n'
write_replica(0, set_root, header, M.mean(axis=1))

def new_pdf_from_indexes(
Expand Down