[yt-users] Off Axis Projection Box size error
Stephanie Tonnesen
stonnes at gmail.com
Wed Jun 1 16:56:19 PDT 2016
Hi all,
I am trying my hand at off axis projections, and having some trouble
setting the width of the projection. Specifically, unless I make the width
much too small to be useful to me, I get an error that my region is outside
of the box boundaries.
Here is the bit of code I have written:
L = [0.0,0.93969,-0.342]
c = [0.5,0.5,0.5]
N = 1028
north_vector = [0,-0.342,0.93969]
plot12 =
yt.OffAxisProjectionPlot(ds,L,'density',width=(80,'kpc'),north_vector=north_vector)
plot12.save()
My whole box is about 215 kpc wide, but unless I set my width to be 35 kpc
I get this error (or something like it with the edge values listed at the
end varying). When I use 35 kpc it looks probably right, although it is
just the center of a galaxy so a bit hard to say.
Traceback (most recent call last):
File "yt_yslices_allout.py", line 57, in <module>
plot12 =
yt.OffAxisProjectionPlot(ds,L,'density',width=(80,'kpc'),north_vector=north_vector)
File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
line 1650, in __init__
periodic=False, oblique=True, fontsize=fontsize)
File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
line 625, in __init__
PlotWindow.__init__(self, *args, **kwargs)
File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
line 205, in __init__
self._setup_plots()
File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
line 693, in _setup_plots
self._recreate_frb()
File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
line 1656, in _recreate_frb
super(OffAxisProjectionPlot, self)._recreate_frb()
File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",
line 265, in _recreate_frb
self._frb._get_data_source_fields()
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/fixed_resolution.py",
line 164, in _get_data_source_fields
self[f]
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/fixed_resolution.py",
line 577, in __getitem__
north_vector=dd.north_vector, method=dd.method)
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/off_axis_projection.py",
line 194, in off_axis_projection
for i, (grid, mask) in enumerate(data_source.blocks):
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
line 1022, in blocks
for io_chunk in self.chunks([], "io"):
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
line 1076, in chunks
self.get_data() # Ensure we have built ourselves
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
line 1110, in get_data
self.index._identify_base_chunk(self)
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/geometry/grid_geometry_handler.py",
line 283, in _identify_base_chunk
gi = dobj.selector.select_grids(self.grid_left_edge,
File
"/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
line 1071, in selector
self._selector = sclass(self)
File "yt/geometry/selection_routines.pyx", line 848, in
yt.geometry.selection_routines.RegionSelector.__init__
(yt/geometry/selection_routines.c:15619)
RuntimeError: Error: yt attempted to read outside the boundaries of a
non-periodic domain along dimension 1.
Region left edge = -0.0320252970485 code_length, Region right edge =
1.03202529705 code_length
Dataset left edge = 0.0 code_length, Dataset right edge = 1.0 code_length
This commonly happens when trying to compute ghost cells up to the domain
boundary. Two possible solutions are to load a smaller region that does not
border the edge or override the periodicity for this dataset.
Can anyone help me? Thanks,
Stephanie
--
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
stonnes at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160601/952fbc49/attachment.htm>
More information about the yt-users
mailing list