yt.analysis_modules.halo_finding.halo_objects.LoadTextHaloes

class yt.analysis_modules.halo_finding.halo_objects.LoadTextHaloes(ds, filename, columns, comment='#')[source]

Load a text file of halos.

Like LoadHaloes, but when all that is available is a plain text file. This assumes the text file has the 3-positions of halos along with a radius. The halo objects created are spheres.

Parameters:

fname : String

The name of the text file to read in.

columns : dict

A dict listing the column name : column number pairs for data in the text file. It is zero-based (like Python). An example is {‘x’:0, ‘y’:1, ‘z’:2, ‘r’:3, ‘m’:4}. Any column name outside of [‘x’, ‘y’, ‘z’, ‘r’] will be attached to each halo object in the supplementary dict ‘supp’. See example.

comment : String

If the first character of a line is equal to this, the line is skipped. Default = “#”.

Examples

>>> ds = load("data0005")
>>> halos = LoadTextHaloes(ds, "list.txt",
    {'x':0, 'y':1, 'z':2, 'r':3, 'm':4},
    comment = ";")
>>> halos[0].supp['m']
    3.28392048e14

Attributes

Methods