Hi yt-users! I am trying to add a field that is radius/rvir. This is an idealized galaxy sim with static DM potential (no live halo), so I was planning on putting the virial radius in by hand. I am not totally sure what is causing yt to choke--does it not like that I am putting in a number? See below for details. Thanks in advance for any help! Best, Stephanie The lines of code: def rrvir(field,data): return data['radius'].in_units('kpc')/(218.,'kpc') i =0 while i < len(loop): ds = yt.load("blahblah/DD"+loop[i]+"/sb_"+loop[i]) ds.add_field(('gas','r_rvir'),function=rrvir) ....many unimportant lines.... I get this error message: yt : [INFO ] 2018-06-14 09:02:48,783 Gathering a field list (this may take a moment.) yt_slices_allouts_mli.py:19: UserWarning: Because 'sampling_type' not specified, yt will assume a cell 'sampl ing_type' ds.add_field(('gas','r_rvir'),function=rrvir) Traceback (most recent call last): File "yt_slices_allouts_mli.py", line 19, in <module> ds.add_field(('gas','r_rvir'),function=rrvir) File "/home/stonnesen/yt-conda/src/yt-git/yt/data_objects/static_output.py", line 1221, in add_field deps, _ = self.field_info.check_derived_fields([name]) File "/home/stonnesen/yt-conda/src/yt-git/yt/fields/field_info_container.py", line 366, in check_derived_fi elds fd = fi.get_dependencies(ds = self.ds) File "/home/stonnesen/yt-conda/src/yt-git/yt/fields/derived_field.py", line 210, in get_dependencies e[self.name] File "/home/stonnesen/yt-conda/src/yt-git/yt/fields/field_detector.py", line 108, in __missing__ vv = finfo(self) File "/home/stonnesen/yt-conda/src/yt-git/yt/fields/derived_field.py", line 250, in __call__ dd = self._function(self, data) File "yt_slices_allouts_mli.py", line 13, in rrvir return data['radius'].in_units('kpc')/(300.,'kpc') File "/home/stonnesen/yt-conda/src/yt-git/yt/units/yt_array.py", line 1372, in __array_ufunc__ out=out, **kwargs) TypeError: ufunc 'true_divide' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' -- Dr. Stephanie Tonnesen Associate Research Scientist CCA, Flatiron Institute New York, NY stonnes@gmail.com