[yt-users] problem with units

alex volioths alex-volos at hotmail.com
Tue Aug 25 06:41:55 PDT 2015


Hello everyone,
I've been practicing with the example "Creating a X-ray observation from an in-memory dataset" from here http://yt-project.org/doc/analyzing/analysis_modules/photon_simulator.html 
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/sitecustomize.py", line 685, in runfile

    execfile(filename, namespace)




  File "/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 78, in execfile

    builtins.execfile(filename, *where)




  File "/home/afi/Documents/X_ray_sim/X_mock.py", 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/photon_simulator.py", 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/photon_models.py", 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/function_base.py", 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/yt_array.py", 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/yt_array.py", 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
Alex
Creating a X-ray observation from an in-memory datasetCreating a X-ray observation from an in-memory dataset 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150825/1cc399de/attachment.htm>


More information about the yt-users mailing list