Hi all, I have a question about the star analysis module. I understand how to run it and print out a file with the results, but is there a way to run it and access the results within the script? I am ignorant of how classes work in python, and I am uncertain whether there is a trivial way to access the contents of a star analysis object, or whether I need a method to access its contents. I looked at the code for the class and I didn't see a method that does this, so I'm guessing there is a simple way to do this? Christine
Hi Christine,
I have a question about the star analysis module. I understand how to run it and print out a file with the results, but is there a way to run it and access the results within the script? I am ignorant of how classes work in python, and I am uncertain whether there is a trivial way to access the contents of a star analysis object, or whether I need a method to access its contents. I looked at the code for the class and I didn't see a method that does this, so I'm guessing there is a simple way to do this?
Are you talking about star formation rates or colors? -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)
Rates. For example, if I ran the module to get the star formation rates like this: sfr = StarFormationRate(pf, data_source=all) How can I access the contents of sfr in the script itself, rather than just writing it out to a file? Thanks Christine On May 28, 2011, at 3:51 PM, Stephen Skory wrote:
Hi Christine,
I have a question about the star analysis module. I understand how to run it and print out a file with the results, but is there a way to run it and access the results within the script? I am ignorant of how classes work in python, and I am uncertain whether there is a trivial way to access the contents of a star analysis object, or whether I need a method to access its contents. I looked at the code for the class and I didn't see a method that does this, so I'm guessing there is a simple way to do this?
Are you talking about star formation rates or colors?
-- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice) _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Christine,
For example, if I ran the module to get the star formation rates like this:
sfr = StarFormationRate(pf, data_source=all)
How can I access the contents of sfr in the script itself, rather than just writing it out to a file?
You should look at the write_out() function in the source: http://hg.enzotools.org/yt/src/6d4a5588a550/yt/analysis_modules/star_analysi... in the for loop for inspiration. In the source things that are named 'self.mass_bins', for example, can be accessed as 'sfr.mass_bins' if you do things as you've said above. Good luck! -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)
participants (2)
-
Christine Simpson
-
Stephen Skory