uob-positron-imaging-centre / up4

Post-processor for particle data.
https://uob-positron-imaging-centre.github.io/up4/
GNU General Public License v3.0
9 stars 1 forks source link

grid.collapse returns NaNs when granular temperature is initiated with grid containing values. #31

Open dwerner95 opened 1 year ago

dwerner95 commented 1 year ago

Following code returns a field of NaNs

import up4
import numpy as np

data = up4.Data("test.hdf5")
grid = up4.Grid(data)
velfield = data.velocityfield(grid)

gran_temp_field = data.granular_temperature(field)
gran_temp_2d= gran_temp_field.collapse(0)

print(np.isnan(gran_temp_2d).all())

## returns True

While it is not the way the grid should be used, this bug should not happen. gran_temp_field contains numbers that are not NaN, the grid.collapse() function should be able to produce a proper field. (slices work)

DanW97 commented 1 year ago

Aren't you meant to be on holiday?