Hi Matt and Stephen, I was able to fork YT (hg clone https://gsiisg@bitbucket.org/gsiisg/el-yt) and implemented the class AMREllipsoidBase(AMR3DData): in data_containers.py, and right now I'm trying to put in the different methods of finding the ellipsoid parameters from the halo parameters. I'm going to put in the geometry method first, and that requires the halo's -center of mass x,y,z -particle positions x,y,z -grid edges left and right (for checking periodicity)
From Matt's previous email: "I think how this would work the best would be to make two separate methods on the Halo base class."
I was wondering where to put the addition to Halo base class, should it be in the halo_objects.py, or make a new file? I'm still need to figure out (and this is where help would save me a ton of time), how to access the two files inside a class in halo_objects.py. Both of which are created by haloes.dump() One of the file (.out) has the center of mass, and the other (.h5) has the particle positions. In my script they were either in memory already when I ran the halo finder parallelHF, or loaded into memory by the single function LoadHaloes(). I did a h5ls on the .h5 files and don't see the center of mass information, so I assume it opened both the .out and .h5 and loaded them into memory. And last but not least, I need to make another "dump" mechanism, or add to the existing one so it output the ellipsoid parameters. Yes I did take Britton's advice and cut out the e2xyz, e3xyz and use a single tilt angle to replace them, which should cut out 5 columns of extra information. The ellipsoid object will take *center_of_mass, A,B,C,*e1vector,tilt_angle as input, the ones with * means the input is a numpy array. From G.S.
Hi Geoffrey,
I'm still need to figure out (and this is where help would save me a ton of time), how to access the two files inside a class in halo_objects.py. Both of which are created by haloes.dump()
I don't think you'll have to write new versions of the functions. The best thing would be to modify them and add the capability to save the ellipsoid information, and the user can choose to have these modifications active or not for output. Actually, if I just modify things for you it would be faster for everyone. halo_objects.py is a big mess right now and really only I have a full picture of it. Which is not a good thing, I must admit. So, am I to understand that in your branch of yt, I can do something like this now? ell = pf.h.ellispoid(parameters) similarly to sp = pf.h.sphere(parameters)? And if I have a halo, I can get the ellipsoid parameters in some way? If so, I could make the changes in short order. Let me know! -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)
"if I just modify things for you it would be faster for
everyone"
Thanks Stephen, the scripts are at:
http://paste.enzotools.org/show/1740/
http://paste.enzotools.org/show/1741/
The first one is just running parallelHF then using the halo list to find
the ellipsoid attributes, the second script is a simple script that loads
the attributes into YT's ellipsoid object and then calculate the total
density inside the first ellipsoid.
I find it convenient to have a second dev YT installed, then replace the
yt-hg directory with the one I created from the fork, that way you can alias
two commands one to "deactivate the current YT and activate the dev", the
other to "deactivate the current YT and activate the forked".
From
G.S.
On Wed, Aug 10, 2011 at 7:41 PM, Stephen Skory wrote:
Hi Geoffrey,
I'm still need to figure out (and this is where help would save me a ton of time), how to access the two files inside a class in halo_objects.py. Both of which are created by haloes.dump()
I don't think you'll have to write new versions of the functions. The best thing would be to modify them and add the capability to save the ellipsoid information, and the user can choose to have these modifications active or not for output.
Actually, if I just modify things for you it would be faster for everyone. halo_objects.py is a big mess right now and really only I have a full picture of it. Which is not a good thing, I must admit. So, am I to understand that in your branch of yt, I can do something like this now?
ell = pf.h.ellispoid(parameters)
similarly to
sp = pf.h.sphere(parameters)?
And if I have a halo, I can get the ellipsoid parameters in some way? If so, I could make the changes in short order. Let me know!
-- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice) _______________________________________________ Yt-dev mailing list Yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
Hi Geoffrey,
http://paste.enzotools.org/show/1740/ http://paste.enzotools.org/show/1741/
I'm working on this now. In the future, please try to stick with PEP-8 coding standards. In particular, we try to use 4 spaces per indentation level throughout yt. I am seeing 2 spaces in the code above. I'll fix it in the code you sent me, and you might consider fixing it in whatever else you've done to yt. Thanks! http://www.python.org/dev/peps/pep-0008/ -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)
I'm working on testing and verifying the inertial tensor ellipsoid parameter
find method right now and I'll try to adopt those standards religiously, let
me know if I make further mistakes.
From
G.S.
On Thu, Aug 11, 2011 at 2:05 PM, Stephen Skory wrote:
Hi Geoffrey,
http://paste.enzotools.org/show/1740/ http://paste.enzotools.org/show/1741/
I'm working on this now. In the future, please try to stick with PEP-8 coding standards. In particular, we try to use 4 spaces per indentation level throughout yt. I am seeing 2 spaces in the code above. I'll fix it in the code you sent me, and you might consider fixing it in whatever else you've done to yt.
Thanks!
http://www.python.org/dev/peps/pep-0008/
-- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice) _______________________________________________ Yt-dev mailing list Yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (2)
-
Geoffrey So
-
Stephen Skory