<div dir="ltr"><div><div><div><div><div>Hi all,<br><br></div>As the title states, I am confused - specifically about units.  I want to create a derived field where parts of the field are different values, dependent upon some cutoff criteria like so:<br><br>def _dene2(field,data):<br>    tl = data['temperature']<br>    dl = data['density']<br>    print("TEMP")<br>    print(tl.in_cgs())<br>    aux = np.where(tl.in_cgs() > 5000.)<br>    np.putmask(dl,aux, 0.0)<br>    dene = dl<br>    return dene<br><br><br>ds.add_field("dene", units="g/cm**3", function = _dene2)<br><br><br></div>Not only does this produce a very worrisome error:  "RuntimeError: Something has gone terribly wrong, _function is NullFunc for ('flash', 'temp')"<br><br></div>The print statement in there shows a bunch of values close to 1, which is why the "aux" mask never returns anything.  But why is data a bunch of 1's in here?  How do I access/convert to the "real" units?<br><br></div>Any help is appreciated,<br></div>-Jill<br><div><div><div><div><br></div></div></div></div></div>