Hi, I have a user defined field with the following definition. def _epsilon(field, data): return (4.0/3.0)*(data['vShock']/data["VelocityMagnitude"]) add_field("epsilon", function=_epsilon, take_log=False, units=r" " ) Now I would like take ln(1 + data["epsilon"]). I am trying with the following definition. Is this the correct way of doing this ? def _lnepsilon(field, data): return 1 + data["epsilon"] add_field("lnepsilon", function=_lnepsilon, *take_log=True*, units=r" " ) Thank you -- Reju Sam John
On Tue, Aug 18, 2015 at 3:18 AM, Reju Sam John <rejusamjohn@gmail.com> wrote:
Hi,
I have a user defined field with the following definition.
def _epsilon(field, data): return (4.0/3.0)*(data['vShock']/data["VelocityMagnitude"]) add_field("epsilon", function=_epsilon, take_log=False, units=r" " )
Now I would like take ln(1 + data["epsilon"]). I am trying with the following definition. Is this the correct way of doing this ?
def _lnepsilon(field, data): return 1 + data["epsilon"] add_field("lnepsilon", function=_lnepsilon, *take_log=True*, units=r" " )
The take_log keyword argument only affects how the plot is displayed by default in e.g. . If you want the field to return the logarithm of 1+data['epsilon'], then you should do something like: def _lnepsilon(field, data): return np.log(1 + data['epsilon']) add_field("lnepsilon", function=_lnepsilon, units="")
Thank you -- Reju Sam John
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Thank you very much Nathan... On Tue, Aug 18, 2015 at 8:27 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Aug 18, 2015 at 3:18 AM, Reju Sam John <rejusamjohn@gmail.com> wrote:
Hi,
I have a user defined field with the following definition.
def _epsilon(field, data): return (4.0/3.0)*(data['vShock']/data["VelocityMagnitude"]) add_field("epsilon", function=_epsilon, take_log=False, units=r" " )
Now I would like take ln(1 + data["epsilon"]). I am trying with the following definition. Is this the correct way of doing this ?
def _lnepsilon(field, data): return 1 + data["epsilon"] add_field("lnepsilon", function=_lnepsilon, *take_log=True*, units=r" " )
The take_log keyword argument only affects how the plot is displayed by default in e.g. . If you want the field to return the logarithm of 1+data['epsilon'], then you should do something like:
def _lnepsilon(field, data): return np.log(1 + data['epsilon']) add_field("lnepsilon", function=_lnepsilon, units="")
Thank you -- Reju Sam John
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Reju Sam John
participants (2)
-
Nathan Goldbaum
-
Reju Sam John