[yt-dev] text halo supplementary data

Stephen Skory s at skory.us
Tue Jul 10 09:18:32 PDT 2012


Hi all,

I didn't read my email until this morning, when I saw the text halos
thread had exploded. I had no idea how strongly people felt about
halos!

Here is a proposal for a solution that I think reduces confusion and
also adds capability. Using Christine's request as an example, what I
would do is add to the LoadTextHaloes a supplementary data column
dict:

pf = load("data")
halos = LoadTextHaloes(pf, "file.txt", columns = {'x':0, 'y':1, 'z':2,
'r':3}, supp = {'m':4})

And for each halo object there would be a supp dict hanging off of it:

h0 = halos[0]
h0.supp['m']

This means that h0.total_mass() will correspond to the sphere, while
the 'm' above to whatever's in the text file. This supp dict could be
used to store temporary data for each halo object outside the
LoadTextHaloes function, and if I hear that it might be useful, it
could be included in a halo.dump() save.

One issue is what happens to the supp columns? Do I float() them, or
do I keep them strings, which allows users to convert them if needed?
If I keep them strings, 'type' string columns would be useful. Or do I
have yet another dict that specifies type in the call to
LoadTextHaloes?

-- 
Stephen Skory
s at skory.us
http://stephenskory.com/
510.621.3687 (google voice)



More information about the yt-dev mailing list