[yt-dev] definition (source code) of virial_mass(virial_overdensity=200.0, bins=300)

Elizabeth Tasker tasker at astro1.sci.hokudai.ac.jp
Sat Jun 7 07:59:22 PDT 2014


Hi Reju,

One way to do this would be to modify the ‘Halo’ class in halo_objects.py to also contain your new definition (copying the format from the original virial_mass). 

As far as I’m aware (and I don’t use the halo profiler myself, so I could be wrong…) there isn’t a way of adding to the class from an external script. I think you have to modify. 

Elizabeth



On Jun 7, 2014, at 10:48 PM, Reju Sam John <rejusamjohn at gmail.com> wrote:

> 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 at 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 at 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 at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> 
> 
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> 
> 
> 
> 
> -- 
> Reju Sam John
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20140607/920cd7d3/attachment.html>


More information about the yt-dev mailing list