yt-project / yt

Main yt repository
http://yt-project.org
Other
454 stars 272 forks source link

Sph projections, slices, gridding: backend and off-axis #4939

Open nastasha-w opened 4 days ago

nastasha-w commented 4 days ago

Fixes issues in the SPH projection backend and adds off-axis projection for SPH particles.

PR Summary

The current version removes the addition of small SPH particles to column densities along lines of sight those particles do not intersect. Additionally, this version supports off-axis projections for SPH datasets. Similar issues in slice plots and grid value interpolation (scatter method) for SPH datasets are still TODO. Tests are also currently in a separate script sph_pixelization_tests_2024-07-03.py.zip, so I can run the tests on the main and issue branches.

This addresses some of the points in issue #4788 ; it should eventually address all of them.

PR Checklist

nastasha-w commented 4 days ago

Some nice test images for the off-axis projection: the gizmo_mhd_mwdisk projected along the x- and z-axes with axis-aligned projections: sph_projection_test_lineofsight_x.pdf sph_projection_test_lineofsight_z.pdf and that same galaxy projected along the (marginally-off) x and z axes, going from x to z in nine steps. Here, unlike for the axis-aligned plots, there is an option to set the image y-direction (north_vector), which in this case is always the simulation y-axis: sph_projection_test_lineofsight_step0of9.pdf sph_projection_test_lineofsight_step1of9.pdf sph_projection_test_lineofsight_step2of9.pdf sph_projection_test_lineofsight_step3of9.pdf sph_projection_test_lineofsight_step4of9.pdf sph_projection_test_lineofsight_step5of9.pdf sph_projection_test_lineofsight_step6of9.pdf sph_projection_test_lineofsight_step7of9.pdf sph_projection_test_lineofsight_step8of9.pdf

I haven't added these as formal answer tests, it's just a visual verification that the outcomes make sense on real data.

neutrinoceros commented 3 days ago

@nastasha-w looks like there are a couple defects at the moment. If you need a hand to get CI green let me know !

nastasha-w commented 3 days ago

Thanks @neutrinoceros! I think the main issue now is that I branched this off main like 6 months ago, so I'll try merging the lastest version in first. I do also think one or a few answer tests from the previous version should fail: these use the old SPH axis-aligned projections.

neutrinoceros commented 3 days ago

I think the main issue now is that I branched this off main like 6 months ago

Nothing a rebase can't fix. It shouldn't be risky actually since you don't have any conflicts.