My apologies—this is a bug in the code. I have a fix, which I hope to have ready by tonight or tomorrow.

Just a quick question—how did you install yt? It looks like your Python stack is in /usr/local. 



On Aug 26, 2015, at 3:26 AM, alex volioths <> wrote:

Hello John

I am using spyder to run the script. Spyder is using the 1.8.2 version.


Date: Tue, 25 Aug 2015 09:54:31 -0400
Subject: Re: [yt-users] problem with units

Hi Alex,

Sorry for the trouble--I'll see if I can figure out what's gone wrong on this end.

It looks like you're running yt 3.2--can you tell me what version of NumPy you are running?



John ZuHone
Kavli Center for Astrophysics and Space Research
Massachusetts Institute of Technology
77 Massachusetts Ave., 37-582G
Cambridge, MA 02139
(w) 617-253-2354
(m) 781-708-5004

On Aug 25, 2015, at 9:41 AM, alex volioths <> wrote:

Hello everyone,

I've been practicing with the example "Creating a X-ray observation from an in-memory dataset" 

However even with simple copy and paste after defining the photons I get this error message:

File "/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/", line 685, in runfile
execfile(filename, namespace)

File "/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/", line 78, in execfile
builtins.execfile(filename, *where)

File "/home/afi/Documents/X_ray_sim/", line 75, in <module>
exp_time, thermal_model, center="c")

File "/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/analysis_modules/photon_simulator/", line 330, in from_scratch
photons = photon_model(data_source, parameters)

File "/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/analysis_modules/photon_simulator/", line 140, in __call__
kT_bins = np.linspace(kT_min, max(my_kT_max, kT_max), num=n_kT+1)

File "/usr/lib/python2.7/dist-packages/numpy/core/", line 87, in linspace
step = (stop-start)/float((num-1))

File "/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/units/", line 745, in __sub__
ro = sanitize_units_add(self, right_object, "subtraction")

File "/usr/local/lib/python2.7/dist-packages/yt-3.2-py2.7-linux-x86_64.egg/yt/units/", line 134, in sanitize_units_add
raise YTUnitOperationError(op_string, inp.units, dimensionless)

YTUnitOperationError: The subtraction operator for YTArrays with units (keV) and (1) is not well defined.

Any ideas? I am new to yt and i can't see something wrong.

Thnak you

yt-users mailing list

_______________________________________________ yt-users mailing list
yt-users mailing list