<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello John<div><br></div><div>I am using spyder to run the script. Spyder is using the 1.8.2 version.</div><div><br></div><div>Cheers</div><div>Alex</div><div><br><div>From: jzuhone@gmail.com<br>Date: Tue, 25 Aug 2015 09:54:31 -0400<br>To: yt-users@lists.spacepope.org<br>Subject: Re: [yt-users] problem with units<br><br><div>Hi Alex,</div><div id="ecxAppleMailSignature"><br></div><div id="ecxAppleMailSignature">Sorry for the trouble--I'll see if I can figure out what's gone wrong on this end.</div><div id="ecxAppleMailSignature"><br></div><div id="ecxAppleMailSignature">It looks like you're running yt 3.2--can you tell me what version of NumPy you are running?</div><div id="ecxAppleMailSignature"><br></div><div id="ecxAppleMailSignature">Best,</div><div id="ecxAppleMailSignature"><br></div><div id="ecxAppleMailSignature">John<br><br><span style="font-size:13pt;background-color:rgba(255, 255, 255, 0);">John ZuHone</span><br><div><span style="background-color:rgba(255, 255, 255, 0);">Kavli Center for Astrophysics and Space Research<br>Massachusetts Institute of Technology<br><a target="_blank">77 Massachusetts Ave.</a>, 37-582G<br><a target="_blank">Cambridge, MA 02139</a><br>(w) <a target="_blank">617-253-2354</a><br>(m) <a target="_blank">781-708-5004</a><br><a href="mailto:jzuhone@space.mit.edu">jzuhone@space.mit.edu</a><br><a href="mailto:jzuhone@gmail.com">jzuhone@gmail.com</a><br><a href="http://www.jzuhone.com/" target="_blank">http://www.jzuhone.com</a></span><br style="font-family:UICTFontTextStyleBody;"></div></div><div><br>On Aug 25, 2015, at 9:41 AM, alex volioths <<a href="mailto:alex-volos@hotmail.com">alex-volos@hotmail.com</a>> wrote:<br><br></div><blockquote><div>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr">Hello everyone,<div><br></div><div>I've been practicing with the example "Creating a X-ray observation from an in-memory dataset" </div><div>from here <a href="http://yt-project.org/doc/analyzing/analysis_modules/photon_simulator.html" target="_blank" style="font-size:12pt;">http://yt-project.org/doc/analyzing/analysis_modules/photon_simulator.html</a> </div><div><br></div><div>However even with simple copy and paste after defining the photons I get this error message:</div><div><br></div><div>
<br><br>
  File <span style="color:#006400;">"/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py"</span>, line <span style="color:#006400;">685</span>, in <span style="color:#9400d3;">runfile</span><br>
    execfile(filename, namespace)<br>
<br><br>
  File <span style="color:#006400;">"/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py"</span>, line <span style="color:#006400;">78</span>, in <span style="color:#9400d3;">execfile</span><br>
    builtins.execfile(filename, *where)<br>
<br><br>
  File <span style="color:#006400;">"/home/afi/Documents/X_ray_sim/X_mock.py"</span>, line <span style="color:#006400;">75</span>, in <span style="color:#9400d3;"><module></span><br>
    exp_time, thermal_model, center="c")<br>
<br><br>
  File <span style="color:#006400;">"/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 style="color:#006400;">330</span>, in <span style="color:#9400d3;">from_scratch</span><br>
    photons = photon_model(data_source, parameters)<br>
<br><br>
  File <span style="color:#006400;">"/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 style="color:#006400;">140</span>, in <span style="color:#9400d3;">__call__</span><br>
    kT_bins = np.linspace(kT_min, max(my_kT_max, kT_max), num=n_kT+1)<br>
<br><br>
  File <span style="color:#006400;">"/usr/lib/python2.7/dist-packages/numpy/core/function_base.py"</span>, line <span style="color:#006400;">87</span>, in <span style="color:#9400d3;">linspace</span><br>
    step = (stop-start)/float((num-1))<br>
<br><br>
  File <span style="color:#006400;">"/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/units/yt_array.py"</span>, line <span style="color:#006400;">745</span>, in <span style="color:#9400d3;">__sub__</span><br>
    ro = sanitize_units_add(self, right_object, "subtraction")<br>
<br><br>
<span style="color:#4682b4;">  File </span><span style="color:#006400;">"/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:#4682b4;">, line </span><span style="color:#006400;">134</span><span style="color:#4682b4;">, in </span><span style="color:#9400d3;">sanitize_units_add</span><br>
<span style="color:#8b0000;">    raise YTUnitOperationError(op_string, inp.units, dimensionless)</span><br>
<br><br>
<span style="color:#8b0000;">YTUnitOperationError:</span> The subtraction operator for YTArrays with units (keV) and (1) is not well defined.<br>
<br><br>Any ideas? I am new to yt and i can't see something wrong.<br><br><br>Thnak you<br>Alex<br></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);">Creating a X-ray observation from an in-memory dataset</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);">Creating a X-ray observation from an in-memory dataset</h2>                                           </div>
</div></blockquote><blockquote><div><span>_______________________________________________</span><br><span>yt-users mailing list</span><br><span><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a></span><br><span><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></span><br></div></blockquote><br>_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</div></div>                                    </div></body>
</html>