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

Add max_resolution in get field for cylindrical #418

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
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
14 changes: 9 additions & 5 deletions openpmd_viewer/openpmd_timeseries/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ def get_particle(self, var_list=None, species=None, t=None, iteration=None,

def get_field(self, field=None, coord=None, t=None, iteration=None,
m='all', theta=0., slice_across=None,
slice_relative_position=None, plot=False,
plot_range=[[None, None], [None, None]], **kw):
slice_relative_position=None, max_resolution = None,
plot=False, plot_range=[[None, None], [None, None]], **kw):
"""
Extract a given field from a file in the openPMD format.

Expand Down Expand Up @@ -416,6 +416,10 @@ def get_field(self, field=None, coord=None, t=None, iteration=None,
Default: None, which results in slicing at 0 in all direction
of `slice_across`.

max_resolution : Tuple of int, optional
A tuple of 2 integers, indicating the maximum resolution of the
restructed 3d array. This is only used for thetaMode geometry.

plot : bool, optional
Whether to plot the requested quantity

Expand Down Expand Up @@ -510,16 +514,16 @@ def get_field(self, field=None, coord=None, t=None, iteration=None,
# For Cartesian components, combine r and t components
Fr, info = self.data_reader.read_field_circ(
iteration, field, 'r', slice_relative_position,
slice_across, m, theta)
slice_across, m, theta, max_resolution)
Ft, info = self.data_reader.read_field_circ(
iteration, field, 't', slice_relative_position,
slice_across, m, theta)
slice_across, m, theta, max_resolution)
F = combine_cylindrical_components(Fr, Ft, theta, coord, info)
else:
# For cylindrical or scalar components, no special treatment
F, info = self.data_reader.read_field_circ(iteration,
field, coord, slice_relative_position,
slice_across, m, theta)
slice_across, m, theta, max_resolution)

# Plot the resulting field
# Deactivate plotting when there is no slice selection
Expand Down