You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If particle data for a particular species contains only one particle, the select filter is not taken into account.
Take, for example, attached data which is an OpenPMD file containing a single particle dataset data/2997/particles/electrons_oxygen_7 with only one particle (all other datasets have been removed). Try reading with openPMD-viewer:
The expected result is data should be empty as the value of 0.49 is not between 20 and 150, so this single data point should have been filtered out.
This happens because the utilities.apply_selection has the following condition which specifically ignores the filter for the case of 1 particle:
# Use select_array to reduce each quantityforiinrange(len(data_list)):
iflen(data_list[i]) >1: # Do not apply selection on scalar recordsdata_list[i] =data_list[i][select_array]
Perhaps this condition is relevant to some other cases when the record is truly scalar. But in my case, the record is not scalar, just sometimes for some iterations and species the number of particles in species turns out to be exactly equal to 1, and then I get incorrect results. Correspondingly, for datasets with 0 or 2+ particles, filtering works correctly, so only 1 particle is problematic.
The text was updated successfully, but these errors were encountered:
If particle data for a particular species contains only one particle, the
select
filter is not taken into account.Take, for example, attached data which is an OpenPMD file containing a single particle dataset
data/2997/particles/electrons_oxygen_7
with only one particle (all other datasets have been removed). Try reading with openPMD-viewer:Now
data
contains:The expected result is
data
should be empty as the value of 0.49 is not between 20 and 150, so this single data point should have been filtered out.This happens because the
utilities.apply_selection
has the following condition which specifically ignores the filter for the case of 1 particle:Perhaps this condition is relevant to some other cases when the record is truly scalar. But in my case, the record is not scalar, just sometimes for some iterations and species the number of particles in species turns out to be exactly equal to 1, and then I get incorrect results. Correspondingly, for datasets with 0 or 2+ particles, filtering works correctly, so only 1 particle is problematic.
The text was updated successfully, but these errors were encountered: