<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Thank you John,</p>
<p><br>
</p>
<p>I'm using the second example here, <a id="LPlnk945004" href="http://yt-project.org/doc/visualizing/plots.html#off-axis-projections">
http://yt-project.org/doc/visualizing/plots.html#off-axis-projections</a>. I'm also using version 3.1 of YT.
<br>
</p>
<p><br>
</p>
<p>My FLASH domain is set up as follows,<br>
</p>
<p>nblockx        = 2 <br>
nblocky        = 1<br>
nblockz        = 5<br>
</p>
<p><br>
</p>
<p>lrefine_min     = 5<br>
lrefine_max     = 5<br>
</p>
<p><br>
</p>
<p>xl_boundary_type = "outflow" <br>
xr_boundary_type = "outflow" <br>
yl_boundary_type = "reflect" <br>
yr_boundary_type = "outflow" <br>
zl_boundary_type = "user" #For wind tunnel<br>
zr_boundary_type = "outflow"</p>
<p><br>
</p>
<p>This generates a 3D array of [x,y,z]=[256,128,640] cells (20971520 cells in total).
</p>
<p><br>
</p>
<p><br>
</p>
<p>Doing everything from the prompt all I use is: <br>
<br>
ds = yt.load("4.2.1_hdf5_plt_cnt_0150") </p>
<p>prj = yt.OffAxisProjectionPlot(ds, [-1,1,0], 'dens')<br>
</p>
<p><br>
</p>
<p>The "..." from before was just the traceback output which I'll add to the end of this.
</p>
<p><br>
By adding a few things to yt.OffAxisProjectionPlot I've generated a few separate errors:<br>
<br>
Adding "depth=(0.5,"unitary")" generates the YTUnitOperationError again.<br>
<br>
Adding "width=(0.5,"unitary")", similar to the example in the cookbook, generates the periodic boundary error.</p>
<p><br>
</p>
<p>Adding both depth and width generates the periodic boundary error as well.   <br>
<br>
Fooling yt using ds.perodicity = (True,True,True) and using a "width" or "width" and "depth" causes YT to suffer a segmentation fault.<br>
</p>
<p><br>
</p>
<p>and using ds.perodicity and just "depth" generates the YTUnitOperationError again.
</p>
<p><br>
</p>
<p>-Jeff<br>
<br>
<br>
<br>
<br>
In [8]: prj = yt.OffAxisProjectionPlot(ds, [-1,1,0], 'dens')<br>
---------------------------------------------------------------------------<br>
YTUnitOperationError                      Traceback (most recent call last)<br>
/usr/local/bin/iyt in <module>()<br>
----> 1 prj = yt.OffAxisProjectionPlot(ds, [-1,1,0], 'dens')<br>
<br>
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in __init__(self, ds, normal, fields, center, width, depth, axes_unit, weight_field, max_level, north_vector, volume, no_ghost, le, re, interpolated, fontsize, method)<br>
   1442                  le=None, re=None, interpolated=False, fontsize=18, method="integrate"):<br>
   1443         (bounds, center_rot) = \<br>
-> 1444           get_oblique_window_parameters(normal,center,width,ds,depth=depth)<br>
   1445         fields = ensure_list(fields)[:]<br>
   1446         oap_width = ds.arr((bounds[1] - bounds[0],<br>
<br>
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in get_oblique_window_parameters(normal, center, width, ds, depth)<br>
    129 def get_oblique_window_parameters(normal, center, width, ds, depth=None):<br>
    130     display_center, center = ds.coordinates.sanitize_center(center, 4)<br>
--> 131     width = ds.coordinates.sanitize_width(normal, width, depth)<br>
    132 <br>
    133     if len(width) == 2:<br>
<br>
/usr/local/lib/python2.7/dist-packages/yt/geometry/coordinates/coordinate_handler.pyc in sanitize_width(self, axis, width, depth)<br>
    146                 # axis is actually the normal vector<br>
    147                 # for an off-axis data object.<br>
--> 148                 mi = np.argmin(self.ds.domain_width)<br>
    149                 w = self.ds.domain_width[[mi,mi]]<br>
    150             width = (w[0], w[1])<br>
<br>
/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.pyc in argmin(a, axis)<br>
    752     except AttributeError:<br>
    753         return _wrapit(a, 'argmin', axis)<br>
--> 754     return argmin(axis)<br>
    755 <br>
    756 <br>
<br>
/usr/local/lib/python2.7/dist-packages/yt/units/yt_array.pyc in __rsub__(self, left_object)<br>
    714     def __rsub__(self, left_object):<br>
    715         """ See __sub__. """<br>
--> 716         lo = sanitize_units_add(self, left_object, "subtraction")<br>
    717         return YTArray(super(YTArray, self).__rsub__(lo))<br>
    718 <br>
<br>
/usr/local/lib/python2.7/dist-packages/yt/units/yt_array.pyc in sanitize_units_add(this_object, other_object, op_string)<br>
    132     else:<br>
    133         if not inp.units.is_dimensionless:<br>
--> 134             raise YTUnitOperationError(op_string, inp.units, dimensionless)<br>
    135     return ret<br>
    136 <br>
<br>
YTUnitOperationError: The subtraction operator for YTArrays with units (code_length) and (1) is not well defined.<br>
</p>
<div style="word-wrap: break-word; color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> yt-users <yt-users-bounces@lists.spacepope.org> on behalf of John Zuhone <jzuhone@gmail.com><br>
<b>Sent:</b> Thursday, June 11, 2015 12:10 PM<br>
<b>To:</b> Discussion of the yt analysis package<br>
<b>Subject:</b> Re: [yt-users] FLASH and Off Axis Projections</font>
<div> </div>
</div>
<div>Hi Jeff,
<div class=""><br class="">
</div>
<div class="">Which cookbook example are you using? I think you might have to paste the script in full that shows the YTUnitOperationError, because I can’t produce that one over here with a FLASH dataset I have using the two lines you posted. </div>
<div class=""><br class="">
</div>
<div class="">As far as the indices/periodic boundaries error, I have seen this one before, and it has to do with the fact that when you project along the whole depth of the domain, to do the off-axis projection it wants to create guard cells that are outside
 the domain, and it doesn’t know how to do that unless the boundary is periodic. This is something we probably need to fix for non-periodic datasets. You can do two things here:</div>
<div class=""><br class="">
</div>
<div class="">1) You can adjust the depth of the projection so it doesn’t span the entire domain, by changing the “depth” of the projection. This example only projects through half the domain size:</div>
<div class=""><br class="">
</div>
<div class="">prj = yt.OffAxisProjectionPlot(ds, [-1,1,0], 'dens', depth=(0.5,"unitary”))</div>
<div class=""><br class="">
</div>
<div class="">where “unitary” refers to the size of the domain. </div>
<div class=""><br class="">
</div>
<div class="">2) You can override the periodicity for the dataset by doing this:</div>
<div class=""><br class="">
</div>
<div class="">ds.periodicity = (True, True, True)</div>
<div class=""><br class="">
</div>
<div class="">which will fool yt into thinking the domain is periodic. Depending on what your data is like, the resulting image would probably be fine, especially if the stuff on the edges is of low significance. </div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class=""><br class="">
</div>
<div class="">John Z</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jun 11, 2015, at 11:56 AM, Jeffrey Alan Gritton <<a href="mailto:jgritton@uga.edu" class="">jgritton@uga.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" class="" style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; font-size:12pt; background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<div class="" style="margin-top:0px; margin-bottom:0px">Hi all,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">I'm having a bit of a problem with off axis projections and my FLASH domains. I want to create an off axis projection for the entire domain. However, I try to follow the Cookbook I run into one of two
 errors. The first being:</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">ds = yt.load("4.2.1_hdf5_plt_cnt_0150")</div>
<div class="" style="margin-top:0px; margin-bottom:0px">prj = yt.OffAxisProjectionPlot(ds, [-1,1,0], 'dens')<br class="">
...</div>
<div class="" style="margin-top:0px; margin-bottom:0px">...<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">YTUnitOperationError: The subtraction operator for YTArrays with units (code_length) and (1) is not well defined.<br class="">
<br class="">
<br class="">
The second I can't recreate at the moment but yt throws an error back complaining about accessing indicies outside of the array and suggests overriding periodic boundaries. My domain has no periodic boundaries. Has anyone ever run into this?</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Thank you for your help,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Jeff<br class="">
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">yt-users
 mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<a href="mailto:yt-users@lists.spacepope.org" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">yt-users@lists.spacepope.org</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>