<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi yt-users,<div class=""><br class=""></div><div class="">Newb question:  I’m trying to draw a line on my volume render of some FLASH data using camera.draw_line but I’m getting an error.  My guess is that it is something to do with units, but I can’t figure out how to fix what I’m doing.  I’m assuming that draw_line using code units, which for FLASH should be cgs.  Here is my code snippet:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c79c24" class="">cam</span> = ds.camera(c, L, W, N, transfer_function=tf, ds=ds, no_ghost=<span style="font-variant-ligatures: no-common-ligatures; color: #d03cff" class="">True</span>,</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">                fields=field, log_fields=[<span style="font-variant-ligatures: no-common-ligatures; color: #d03cff" class="">False</span>])</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c79c24" class="">im</span> = cam.snapshot()</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0); min-height: 19px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">cam.draw_coordinate_vectors(im)</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">cam.draw_domain(im)</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">cam.draw_line(im, [2e8,0.,0.], [0.,2e8,0.])</div></div><div class=""><br class=""></div><div class="">And here is the error I get when I run it:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Traceback (most recent call last):</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">  File "render_radv.py", line 53, in <module></div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">    cam.draw_line(im, [2e8,0.,0.], [0.,2e8,0.])</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">  File "/work/00863/smc/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 415, in draw_lin\</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">e</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">    dx0 = ((x0-self.origin)*self.orienter.unit_vectors[1]).sum()</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">  File "/work/00863/smc/yt-x86_64/src/yt-hg/yt/units/yt_array.py", line 716, in __rsub__</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">    lo = sanitize_units_add(self, left_object, "subtraction")</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">  File "/work/00863/smc/yt-x86_64/src/yt-hg/yt/units/yt_array.py", line 134, in sanitize_units_add</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">    raise YTUnitOperationError(op_string, inp.units, dimensionless)</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">yt.utilities.exceptions.YTUnitOperationError: The subtraction operator for YTArrays with units (code_length) an\</div><div style="margin: 0px; font-size: 14px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">d (1) is not well defined.</div></div><div class=""><br class=""></div><div class="">Any help or guidance would be much appreciated!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Sean</div><div class=""><br class=""></div><br class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">-----------------------------------------------------------<br class="">Sean M. Couch<br class="">Theoretical Astrophysics Including Relativity<br class="">California Institute of Technology<br class="">Mail Code 350-17<br class="">Pasadena, CA  91125<br class="">(626) 395-4282<br class=""><a href="http://www.tapir.caltech.edu/~smc" class="">www.tapir.caltech.edu/~smc</a></div></div>
</div>
<br class=""></body></html>