<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Dear Nathan,</div><div class=""><br class=""></div><div class="">Thanks very much for your help.</div><div class="">entropy is a filed in my FLASH dataset. The unit of entropy is kB/baryon in the code but it is recognised as dimensionless in yt.</div><div class=""><br class=""></div><div class="">The field “entr" is the entropy in my dataset. The derived field “Entropy” is the one I want to visualise. </div><div class="">PNS_DENSITY and PNS_ENTR are just constants. </div><div class=""><br class=""></div><div class="">Many thanks,</div><div class="">Kuo-Chuan</div><div class=""><br class=""></div><div class="">  11 def _entrdens(field,data):</div><div class="">  12     """</div><div class="">  13     create a new derived field to show both entropy and density</div><div class="">  14     """</div><div class="">  15     dens = data["dens"]</div><div class="">  16     entr = data["entr"]</div><div class="">  17     entrdens = entr*(np.exp(-(dens.in_cgs()/PNS_DENSITY)**5))+PNS_ENTR</div><div class="">  18     return entrdens</div><div class="">  19 yt.add_field("Entropy",function=_entrdens,units="dimensionless") </div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 1, 2016, at 2:20 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" class="">nathan12343@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Kuo-Chuan,<div class=""><br class=""></div><div class="">Can you show us how you've defined your derived field?</div><div class=""><br class=""></div><div class="">Is entropy a derived field as well or is it a field that's included in your dataset? This is the entropy per baryon, right?</div><div class=""><br class=""></div><div class="">-Nathan</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Nov 1, 2016 at 1:09 PM, Kuo-Chuan Pan <span dir="ltr" class=""><<a href="mailto:pankuoch@msu.edu" target="_blank" class="">pankuoch@msu.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br class="">
<br class="">
I have a custom new derived field based on density (g/cm^3) and entropy (kB/baryon but it is recognised as dimensionless).<br class="">
Currently, this new derived field is set to dimensionless (it should be kB/baryon).<br class="">
<br class="">
Could anyone teach me how to set this new derived filed to its correct unit (which should be kB/baryon)?<br class="">
Or is it possible to simply override the field label in my volume rendering plot before using save_annotated()?<br class="">
<br class="">
Many thanks,<br class="">
Kuo-Chuan<br class="">
______________________________<wbr class="">_________________<br class="">
yt-users mailing list<br class="">
<a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank" class="">http://lists.spacepope.org/<wbr class="">listinfo.cgi/yt-users-<wbr class="">spacepope.org</a><br class="">
</blockquote></div><br class=""></div>
_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br class=""></div></blockquote></div><br class=""></body></html>