<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="">Alex, <div class=""><br class=""></div><div class="">My apologies—this is a bug in the code. I have a fix, which I hope to have ready by tonight or tomorrow.</div><div class=""><div class=""><br class=""></div><div class="">Just a quick question—how did you install yt? It looks like your Python stack is in /usr/local. </div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 26, 2015, at 3:26 AM, alex volioths <<a href="mailto:alex-volos@hotmail.com" class="">alex-volos@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px;" class="">Hello John<div class=""><br class=""></div><div class="">I am using spyder to run the script. Spyder is using the 1.8.2 version.</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Alex</div><div class=""><br class=""><div class="">From: <a href="mailto:jzuhone@gmail.com" class="">jzuhone@gmail.com</a><br class="">Date: Tue, 25 Aug 2015 09:54:31 -0400<br class="">To: <a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">Subject: Re: [yt-users] problem with units<br class=""><br class=""><div class="">Hi Alex,</div><div id="ecxAppleMailSignature" class=""><br class=""></div><div id="ecxAppleMailSignature" class="">Sorry for the trouble--I'll see if I can figure out what's gone wrong on this end.</div><div id="ecxAppleMailSignature" class=""><br class=""></div><div id="ecxAppleMailSignature" class="">It looks like you're running yt 3.2--can you tell me what version of NumPy you are running?</div><div id="ecxAppleMailSignature" class=""><br class=""></div><div id="ecxAppleMailSignature" class="">Best,</div><div id="ecxAppleMailSignature" class=""><br class=""></div><div id="ecxAppleMailSignature" class="">John<br class=""><br class=""><span style="font-size: 13pt; background-color: rgba(255, 255, 255, 0);" class="">John ZuHone</span><br class=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Kavli Center for Astrophysics and Space Research<br class="">Massachusetts Institute of Technology<br class=""><a target="_blank" class="">77 Massachusetts Ave.</a>, 37-582G<br class=""><a target="_blank" class="">Cambridge, MA 02139</a><br class="">(w) <a target="_blank" class="">617-253-2354</a><br class="">(m) <a target="_blank" class="">781-708-5004</a><br class=""><a href="mailto:jzuhone@space.mit.edu" class="">jzuhone@space.mit.edu</a><br class=""><a href="mailto:jzuhone@gmail.com" class="">jzuhone@gmail.com</a><br class=""><a href="http://www.jzuhone.com/" target="_blank" class="">http://www.jzuhone.com</a></span><br style="font-family: UICTFontTextStyleBody;" class=""></div></div><div class=""><br class="">On Aug 25, 2015, at 9:41 AM, alex volioths <<a href="mailto:alex-volos@hotmail.com" class="">alex-volos@hotmail.com</a>> wrote:<br class=""><br class=""></div><blockquote class=""><div class=""><div dir="ltr" class="">Hello everyone,<div class=""><br class=""></div><div class="">I've been practicing with the example "Creating a X-ray observation from an in-memory dataset" </div><div class="">from here <a href="http://yt-project.org/doc/analyzing/analysis_modules/photon_simulator.html" target="_blank" style="font-size: 12pt;" class="">http://yt-project.org/doc/analyzing/analysis_modules/photon_simulator.html</a> </div><div class=""><br class=""></div><div class="">However even with simple copy and paste after defining the photons I get this error message:</div><div class=""><br class=""></div><div class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">685</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class="">runfile</span><br class="">execfile(filename, namespace)<br class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">78</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class="">execfile</span><br class="">builtins.execfile(filename, *where)<br class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/home/afi/Documents/X_ray_sim/X_mock.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">75</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class=""><module></span><br class="">exp_time, thermal_model, center="c")<br class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/analysis_modules/photon_simulator/photon_simulator.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">330</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class="">from_scratch</span><br class="">photons = photon_model(data_source, parameters)<br class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/analysis_modules/photon_simulator/photon_models.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">140</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class="">__call__</span><br class="">kT_bins = np.linspace(kT_min, max(my_kT_max, kT_max), num=n_kT+1)<br class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/usr/lib/python2.7/dist-packages/numpy/core/function_base.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">87</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class="">linspace</span><br class="">step = (stop-start)/float((num-1))<br class=""><br class=""><br class="">File<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">"/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/units/yt_array.py"</span>, line<span class="Apple-converted-space"> </span><span style="color: rgb(0, 100, 0);" class="">745</span>, in<span class="Apple-converted-space"> </span><span style="color: rgb(148, 0, 211);" class="">__sub__</span><br class="">ro = sanitize_units_add(self, right_object, "subtraction")<br class=""><br class=""><br class=""><span style="color: rgb(70, 130, 180);" class="">File<span class="Apple-converted-space"> </span></span><span style="color: rgb(0, 100, 0);" class="">"/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/units/yt_array.py"</span><span style="color: rgb(70, 130, 180);" class="">, line<span class="Apple-converted-space"> </span></span><span style="color: rgb(0, 100, 0);" class="">134</span><span style="color: rgb(70, 130, 180);" class="">, in<span class="Apple-converted-space"> </span></span><span style="color: rgb(148, 0, 211);" class="">sanitize_units_add</span><br class=""><span style="color: rgb(139, 0, 0);" class="">raise YTUnitOperationError(op_string, inp.units, dimensionless)</span><br class=""><br class=""><br class=""><span style="color: rgb(139, 0, 0);" class="">YTUnitOperationError:</span><span class="Apple-converted-space"> </span>The subtraction operator for YTArrays with units (keV) and (1) is not well defined.<br class=""><br class=""><br class="">Any ideas? I am new to yt and i can't see something wrong.<br class=""><br class=""><br class="">Thnak you<br class="">Alex<br class=""></div><h2 style="box-sizing: border-box; font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1.1; color: rgb(51, 51, 51); font-size: 34px; height: 45px; visibility: hidden; background-color: rgb(255, 255, 255);" class=""></h2><h2 style="box-sizing: border-box; font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1.1; color: rgb(51, 51, 51); font-size: 34px; height: 45px; visibility: hidden; background-color: rgb(255, 255, 255);" class=""></h2></div></div></blockquote><blockquote class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">yt-users mailing list</span><br class=""><span class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a></span><br class=""><span class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></span><br class=""></div></blockquote><br class="">_______________________________________________ yt-users mailing list<span class="Apple-converted-space"> </span><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><span class="Apple-converted-space"> </span><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div></div></div><span style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">yt-users mailing list</span><br style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:yt-users@lists.spacepope.org" style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px;" class="">yt-users@lists.spacepope.org</a><br style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" style="font-family: Calibri; font-size: 16px; 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; -webkit-text-stroke-width: 0px;" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div></blockquote></div><br class=""></div></div></body></html>