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

[WIP] Fill Invalid Regions w/ Zero #419

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Mar 13, 2024

Filling unwritten/invalid regions, e.g., access outside of written ADIOS blocks, with not-a-number (NaN) created some confusion: ECP-WarpX/WarpX#4775

Counter-point to this PR:
Technically, data in this region is literally not-a-number (yet). Matplotlib gracefully ignores NaNs for plotting, and can be configured to mask one way or the other with color. Padding with zeros is ambiguous: maybe data was not written, maybe data was written and truly zero.

We now always fill with zeros, hoping that "why is a region empty" ("because it was not written") does not create another kind of confusion.

Side note: resizing during write of BTD is non-trivial (as in: not supported by HDF5 and ADIOS), because we need to resize from the "lower index end". HDF5 and ADIOS only support resizing the upper index bound.

X-ref: #334 #340

Filling unwritten/invalid regions, e.g., access outside of written
ADIOS blocks, with not-a-number (NaN) created some confusion.
Technically, data in this region is literally not-a-number (yet), but
it seems easier to process data when it is just filled with zeros
instead.

We now always fill with zeros, hoping that "why is a region empty"
("because it was not written") does not create another kind of
confusion.

Side note: resizing during write of BTD is non-trivial (as in:
not supported by HDF5 and ADIOS), because we need to resize from
the "lower index end". HDF5 and ADIOS only support resizing the
upper index bound.
@ax3l
Copy link
Member Author

ax3l commented Mar 13, 2024

@RemiLehe @jlvay note that we return NaNs often where technically sensible. E.g., LPA diagnostics and particle tracker return NaN if a particle selection does not apply (for a requested index).

Maybe this is just a lack of documentation.

@ax3l ax3l changed the title Fill Invalid Regions w/ Zero [WIP] Fill Invalid Regions w/ Zero Mar 13, 2024
@ax3l ax3l requested a review from RemiLehe March 13, 2024 23:48
@ax3l ax3l requested a review from jlvay March 13, 2024 23:48
@ax3l
Copy link
Member Author

ax3l commented Mar 14, 2024

Preferred solution for BTD:
Crop away the NaN regions and resize the meta-data to what was truly written.

Might require an extra openPMD meta-data attribute to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants