yt icon indicating copy to clipboard operation
yt copied to clipboard

Enable the same projection "methods" for OffAxisProjectionPlot as available for ProjectionPlot

Open yt-fido opened this issue 10 years ago • 6 comments

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

yt-fido avatar Sep 28 '14 13:09 yt-fido

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.

yt-fido avatar Mar 24 '16 18:03 yt-fido

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.

yt-fido avatar Dec 02 '14 22:12 yt-fido

Original comment by chummels (Bitbucket: chummels, GitHub: chummels):


Removing milestone: 3.1 (automated comment)

yt-fido avatar Oct 16 '14 15:10 yt-fido

@chummels, do you know if this is still relevant ?

neutrinoceros avatar Oct 21 '21 18:10 neutrinoceros

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

chummels avatar Oct 21 '21 18:10 chummels

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.

matthewturk avatar Oct 22 '21 13:10 matthewturk