<div dir="ltr"><div><div><div><div>Hi all,<br><br></div>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. <br><br><br></div><div>Here is the bit of code I have written:<br><br> L = [0.0,0.93969,-0.342]<br> c = [0.5,0.5,0.5] <br> N = 1028<br> north_vector = [0,-0.342,0.93969]<br> plot12 = yt.OffAxisProjectionPlot(ds,L,'density',width=(80,'kpc'),north_vector=north_vector)<br> plot12.save()<br><br></div>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.<br><br>Traceback (most recent call last):<br> File "yt_yslices_allout.py", line 57, in <module><br> plot12 = yt.OffAxisProjectionPlot(ds,L,'density',width=(80,'kpc'),north_vector=north_vector)<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 1650, in __init__<br> periodic=False, oblique=True, fontsize=fontsize)<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 625, in __init__<br> PlotWindow.__init__(self, *args, **kwargs)<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 205, in __init__<br> self._setup_plots()<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 693, in _setup_plots<br> self._recreate_frb()<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 1656, in _recreate_frb<br> super(OffAxisProjectionPlot, self)._recreate_frb()<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 265, in _recreate_frb<br> self._frb._get_data_source_fields()<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/fixed_resolution.py", line 164, in _get_data_source_fields<br> self[f]<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/fixed_resolution.py", line 577, in __getitem__<br> north_vector=dd.north_vector, method=dd.method)<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/off_axis_projection.py", line 194, in off_axis_projection<br> for i, (grid, mask) in enumerate(data_source.blocks):<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1022, in blocks<br> for io_chunk in self.chunks([], "io"):<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1076, in chunks<br> self.get_data() # Ensure we have built ourselves<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1110, in get_data<br> self.index._identify_base_chunk(self)<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/geometry/grid_geometry_handler.py", line 283, in _identify_base_chunk<br> gi = dobj.selector.select_grids(self.grid_left_edge,<br> File "/home/stonnes/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1071, in selector<br> self._selector = sclass(self)<br> File "yt/geometry/selection_routines.pyx", line 848, in yt.geometry.selection_routines.RegionSelector.__init__ (yt/geometry/selection_routines.c:15619)<br>RuntimeError: Error: yt attempted to read outside the boundaries of a non-periodic domain along dimension 1.<br>Region left edge = -0.0320252970485 code_length, Region right edge = 1.03202529705 code_length<br>Dataset left edge = 0.0 code_length, Dataset right edge = 1.0 code_length<br><br>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.<br><br><br></div>Can anyone help me? Thanks,<br></div>Stephanie<br><br clear="all"><div><div><div><div><div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><font face="garamond,serif">--<br>Dr. Stephanie Tonnesen<br></font></div><font face="garamond,serif">Alvin E. Nashman Postdoctoral Fellow<br></font></div><font face="garamond,serif">Carnegie Observatories, Pasadena, CA<br></font></div><font face="garamond,serif"><a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a><br></font></div></div></div>
</div></div></div></div></div></div>