Hello Elizabeth , I Would like to create a new function virial_CRFraction()
vcr = halos[0].virial_CRFraction() should give the virial CRFraction of the halo. where CRFraction is defined as follows @derived_field(name = "CRFraction") def my_new_field(field, data): . . . . temp =....
return temp On Sat, Jun 7, 2014 at 6:01 PM, Elizabeth Tasker < tasker@astro1.sci.hokudai.ac.jp> wrote:
Hi Reju,
If you want to see exactly what the function looks like, you can just examine you source directly for yt.
e.g. go into
~/yt/src/yt-hg
and then grep for “virial_mass” (bearing in mind there are subdirectories). So:
grep virial_mass */*/*/*py
will tell you that this particular routine lives in:
~/yt/src/yt-hg/yt/analysis_modules/halo_finding/halo_objects.py
def virial_mass(self, virial_overdensity=200., bins=300): . . .
Hope that helps!
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.
Elizabeth
On Jun 7, 2014, at 9:18 PM, Reju Sam John <rejusamjohn@gmail.com> wrote:
Where can I find the definition (source code) of the following function ?
virial_mass(virial_overdensity=200.0, bins=300)
Like this function I have to create a new function for my derived field.
-- Reju Sam John _______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
-- Reju Sam John