AMR: Expand particle deposition onto the grid to vector fields.
PR Summary
Currently, only scalar quantites of particles can be deposited to the grid (such as mass), with final shape (Ncells,) I want to be able to deposit a vector quantity (stellar spectra of each star particle) onto the grid with shape (Ncells, spectra_length), with the main goal to build spectra for each cell (nebular continuum + emission lines, and stellar spectra.) I have not been able to make the deposition of the vector fields work yet, so any help is greatly appreciated.
PR Checklist
- [ ] New features are documented, with docstrings and narrative docs
- [ ] Adds a test for any bugs fixed. Adds tests for new features.
Just to add, I am currently only considering method="sum" for deposition of vector fields
@cphyc some octree enhancements/changes here that you might be interested in checking out when you're back from holiday :)
@AnatoleStorck would be happy to look more at this after the test failures are addressed.
I'd love to see this functionality in yt. Let me know if there are ways I can assist in testing this or debugging.
Note for @AnatoleStorck and @cphyc, the particle_deposit_vector.pyx and .pxd should be removed, and merged into particle_deposit.pyx. The latter should be modified to accept a vector field in general, with the specific case of a scalar field being a vector field of dimension 1.
@chummels this should support SPH datasets, but I have never used an SPH dataset, and I'm not sure what the particle deposition would mean for SPH? Onto what are you deposing?
Given my ignorance, I haven't really tested this, but it'd be amazing if you could give it a go
We still have failures for AMR (non-octree) datasets. It seems that vector fields end up being stored vector-first, i.e., with shape (vector_size, nx, ny, nz, num_zones) whereas oct-based dataset have shape (nx, ny, nz, num_zones, vector_size). I'm sure there must be a transpose somewhere, but couldn't find it yet. Any help is welcome :)