<div dir="ltr">Hello Elizabeth ,<div><br></div><div>I Would like to create a new function <span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">virial_CRFraction</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">()</span></div>
<div><br></div><div><span style="font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin-top:0px;margin-right:0px;padding:0px;color:rgb(198,93,9);font-weight:bold">>>> </span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">vcr</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap"> </span><span style="font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px;color:rgb(102,102,102)">=</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap"> </span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">halos</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">[</span><span style="font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px;color:rgb(32,128,80)">0</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">]</span><span style="font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px;color:rgb(102,102,102)">.</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">virial_CRFraction</span><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">() </span></div>
<div><span style="color:rgb(0,0,0);font-size:10px;line-height:22.399999618530273px;text-align:justify;white-space:pre-wrap;margin:0px;padding:0px">should give the virial CRFraction of the halo. </span></div><div>where CRFraction is defined as follows </div>
<div>@derived_field(name = "CRFraction")</div><div>def my_new_field(field, data):</div><div>    .</div><div>    .</div><div>    .</div><div>    .    </div><div>    temp =....</div><div><br></div><div>    return temp</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 7, 2014 at 6:01 PM, Elizabeth Tasker <span dir="ltr"><<a href="mailto:tasker@astro1.sci.hokudai.ac.jp" target="_blank">tasker@astro1.sci.hokudai.ac.jp</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Reju,<div><br></div><div>If you want to see exactly what the function looks like, you can just examine you source directly for yt.</div>
<div><br></div><div>e.g. go into </div><div><br></div><div>~/<span style="font-family:Menlo;font-size:11px">yt/src/yt-hg</span></div><div><br></div><div>and then grep for “virial_mass” (bearing in mind there are subdirectories). So:</div>
<div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo">grep virial_mass */*/*/*py</div></div><div style="margin:0px;font-size:11px;font-family:Menlo"><br></div><div style="margin:0px">will tell you that this particular routine lives in:</div>
<div style="margin:0px"><br></div><div style="margin:0px"><div style="margin:0px;font-size:11px;font-family:Menlo">~/yt/src/yt-hg/yt/analysis_modules/halo_finding/halo_objects.py</div><div style="margin:0px;font-size:11px;font-family:Menlo">
<br></div><div style="margin:0px"><div style="font-family:Menlo;font-size:11px;margin:0px"><span style="color:#d03cff">def</span> <span style="color:#afd7ff;background-color:#b32ab2">virial</span><span style="color:#5e34ff">_mass</span>(<span style="color:#d03cff">self</span>, <span style="background-color:#affeff">virial</span>_overdensity=200., bins=300):</div>
<div style="font-family:Menlo;font-size:11px;margin:0px">.</div><div style="font-family:Menlo;font-size:11px;margin:0px">.</div><div style="font-family:Menlo;font-size:11px;margin:0px">.</div><div style="font-family:Menlo;font-size:11px;margin:0px">
<br></div><div style="margin:0px"><br></div><div style="margin:0px">Hope that helps!</div><div style="margin:0px"><br></div><div style="margin:0px">If you explain a more clearly what you’d like a new function to do, we might be able to help a little more or point you to similar examples.</div>
<div style="margin:0px"><br></div><div style="margin:0px">Elizabeth</div><div style="font-family:Menlo;font-size:11px;margin:0px"><br></div><div style="font-family:Menlo;font-size:11px;margin:0px"><br></div></div></div><div>
<br><div><div><div class="h5"><div>On Jun 7, 2014, at 9:18 PM, Reju Sam John <<a href="mailto:rejusamjohn@gmail.com" target="_blank">rejusamjohn@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div>
<div class="h5"><div dir="ltr">Where can I find the definition (source code) of the following function  ?<div><br></div><div>virial_mass(virial_overdensity=200.0, bins=300)</div><div><br></div><div>Like this function I have to create a new function for my derived field. <br clear="all">

<div><br></div>-- <br><div dir="ltr">Reju Sam John</div>
</div></div></div></div>
_______________________________________________<br>yt-dev mailing list<br><a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br><a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</blockquote></div><br></div></div><br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Reju Sam John</div>
</div>