Closed VictorForouhar closed 6 months ago
Code to reproduce :
snapshot_path = '/cosma8/data/dp004/flamingo/Runs/L1000N3600/HYDRO_FIDUCIAL/snapshots/flamingo_0066/flamingo_0066.hdf5'
mask = sw.mask(snapshot_path)
cell_centre = np.array([17, 26, 29], dtype=int)
cell_edges = np.array([[x, x + 1] for x in cell_centre])
load_region = cell_edges * mask.cell_size[0]
mask.constrain_spatial(load_region)
sw.subset_writer.write_subset(f"{output_file_path}.hdf5", mask)
Maybe naive suspicion: the neutrinos are PartType6.
Mm seems like it's failing on line 69, indicating a problem with the extraction of the particle type number, not its association with a string.
Have you made sure that you are running the latest version of swiftsimio? I recall us having this problem before, maybe we fixed it?
Yeah; your code works for me. I think you must just be running an outdated version of swiftsimio.
Ugh, let me update swiftsimio and confirm.
Okay, updated to latest version from my previous one (4.9.0
) and it works! Thank you :)
I am trying to write a subset of a FLAMINGO snapshot, in particular, the particles contained within a specified swift cell. However, when I execute
subset_writer.write_subset
, the following error appears: