12 May
2010
12 May
'10
7:24 a.m.
Hi all, Is it possible to make something like a derived field in yt that takes passed variables? A simple example would be extracting gas density above a certain temperature, but changing that temperature threshold on the fly def _hotgas(field, data, temperature_threshold): reutrn data["density"]*(data["Temperature"] > temperature_threshold) add_field("hotgas", function=_hotgas, Something else goes here?) In this particular case I only need a few temperatures and can make a new derived quantity each time, but it seems like a generally useful ability. Thanks, Charles