yt
yt copied to clipboard
Enable the same projection "methods" for OffAxisProjectionPlot as available for ProjectionPlot
Originally reported by: chummels (Bitbucket: chummels, GitHub: chummels)
Right now, OffAxisProjectionPlot only allows weighted and unweighted 'integration' plots, but not 'sum' or 'mip' plots in the same way that ProjectionPlot does.
- Bitbucket: https://bitbucket.org/yt_analysis/yt/issue/911
Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):
So I don't forget, I think this can be relatively simply implemented by adding new "samplers" that do this. Simple modification of the way that the projection sampler works should do it. We're talking about summation (which will not function the same way unless we do 1 sample per cell) and max/min (which would be easy). Then these samplers need to get passed through the API, so they can be selected at runtime.
Original comment by John ZuHone (Bitbucket: jzuhone, GitHub: jzuhone):
This has been partially resolved by PR #1280, as it adds "sum" to off-axis projections, but "mip" is not present.
Original comment by chummels (Bitbucket: chummels, GitHub: chummels):
Removing milestone: 3.1 (automated comment)
@chummels, do you know if this is still relevant ?
Yes, it is still relevant. It's easy to test to demonstrate that this functionality still does not exist:
import yt
ds = yt.load_sample('IsolatedGalaxy')
yt.OffAxisProjectionPlot(ds, [1,0,0], ('gas', 'density'), method='mip').save()
Traceback (most recent call last):
File "test_proj.py", line 4, in <module>
yt.OffAxisProjectionPlot(ds, [1,0,0], ('gas', 'density'), method='mip').save()
File "/Users/chummels/src/yt/yt/visualization/plot_window.py", line 2254, in __init__
PWViewerMPL.__init__(
File "/Users/chummels/src/yt/yt/visualization/plot_window.py", line 873, in __init__
PlotWindow.__init__(self, *args, **kwargs)
File "/Users/chummels/src/yt/yt/visualization/plot_window.py", line 257, in __init__
self._setup_plots()
File "/Users/chummels/src/yt/yt/visualization/plot_window.py", line 994, in _setup_plots
self._recreate_frb()
File "/Users/chummels/src/yt/yt/visualization/plot_window.py", line 317, in _recreate_frb
self._frb._get_data_source_fields()
File "/Users/chummels/src/yt/yt/visualization/fixed_resolution.py", line 176, in _get_data_source_fields
self[f]
File "/Users/chummels/src/yt/yt/visualization/fixed_resolution.py", line 602, in __getitem__
buff = off_axis_projection(
File "/Users/chummels/src/yt/yt/visualization/volume_rendering/off_axis_projection.py", line 118, in off_axis_projection
raise NotImplementedError(
NotImplementedError: Only 'integrate' or 'sum' methods are valid for off-axis-projections
I'm not volunteering to add this functionality, but I will outline the process that would need to happen -- a new sampler would need to be added, similar to image_samplers.pyx:ProjectionSampler
that instead of integrating, took the maximum value.