Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Wiring frb buffers with plot_window #1877

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
67e31b2
Use explicit names for callbacks
cphyc Jul 3, 2018
e36c829
First implementation
cphyc Jul 3, 2018
6ec13e3
Wire the filters to the plot window functionality
cphyc Jul 3, 2018
fcb0eb9
Simplify 2g gaussian filter
cphyc Jul 3, 2018
5543e46
Add test
cphyc Jul 3, 2018
1dbbee2
Pass plot_window to all FixedResolutionbuffer
cphyc Jul 3, 2018
dba66a3
Check on plot window side
cphyc Jul 6, 2018
5d5c59f
DRY: Wrap everything in a single function
cphyc Jul 6, 2018
0fe8f28
More thorough checks
cphyc Jul 6, 2018
873020a
Updating doc
cphyc Jul 6, 2018
d7ddc7a
Remote WIP code
cphyc Jul 6, 2018
64a593a
Make data_is_valid a property
cphyc Jul 7, 2018
296637d
Fix signature of frb
cphyc Jul 7, 2018
0b4b88c
Fix doc
cphyc Jul 7, 2018
71b246d
Update doc to include comments
cphyc Jul 10, 2018
7f0663a
Issue warning when using the nbeam param
cphyc Jul 10, 2018
05dae59
Remove `_data_valid` from plot_window
cphyc Jul 10, 2018
0089d55
Oops
cphyc Jul 10, 2018
adb84a6
Flaking, etc.
Sep 1, 2020
303dcdc
More descriptive test
cphyc Sep 1, 2020
dbc54b3
Take comments into account
cphyc Sep 1, 2020
7be7bdb
Update yt/visualization/fixed_resolution_filters.py
cphyc Sep 1, 2020
f4ee761
bugfix: fix an error where validate_plot decorator would fail for obj…
neutrinoceros Sep 1, 2020
38d569f
exp: deactivate frb data invalidation (should pass tests)
neutrinoceros Oct 11, 2020
5227e6d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 13, 2021
166afce
fix a broken import statement
neutrinoceros Apr 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test
  • Loading branch information
cphyc authored and neutrinoceros committed Aug 29, 2021
commit 5543e46b393dd147fb5a8859b2e5a72cd7c87e61
20 changes: 18 additions & 2 deletions yt/visualization/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"""

from yt.testing import fake_amr_ds, requires_module

import yt
import numpy as np

@requires_module("scipy")
def test_white_noise_filter():
Expand All @@ -21,5 +22,20 @@ def test_gauss_beam_filter():
ds = fake_amr_ds(fields=("density",), units=("g/cm**3",))
p = ds.proj(("gas", "density"), "z")
frb = p.to_frb((1, "unitary"), 64)
frb.apply_gauss_beam(nbeam=15, sigma=1.0)
frb.apply_gauss_beam(sigma=1.0)
frb[("gas", "density")]


@requires_module("scipy")
def test_filter_wiring():
from scipy.ndimage import gaussian_filter
ds = fake_amr_ds(fields=("density", ))
p = yt.SlicePlot(ds, 'x', 'density')
data_before = p.frb['density'].value
sigma = 2
p.frb.apply_gauss_beam(sigma)
data_after = p.frb['density'].value

# Check that the frb yields the same result
assert np.allclose(gaussian_filter(data_before, sigma),
data_after)