Skip to content

The ParticleGroup Class

Alex Gurvich edited this page Jun 16, 2021 · 4 revisions

Understanding the ParticleGroup keyword arguments

  • UIname - Name of the particle group that shows up in the UI, 4-5 characters is best

  • coordinates - The coordinates of the points in 3d space, should have a shape of (nparts,3).

  • tracked_arrays=[] - The arrays to associate with each coordinate in space, each array should be one-dimensional and have nparts entries.

  • tracked_names=[] - Should be the same length as tracked_arrays, and gives a name to each of the arrays when they show up in the UI dropdowns.

  • tracked_filter_flags=[] - Should be the same length as tracked_arrays, and gives a flag for whether that array should be available as an interactive filter within Firefly.

  • decimation_factor=1 - An integer factor to sub-sample the provided dataset at (in addition to any manual subsampling you might do). This will choose nparts/decimation_factor many points at random from the dataset to display in Firefly.

  • filenames_and_nparts=None - Allows you to manually control how the particles are distributed among the JSON files, highly recommended that you leave this to None, but if for whatever reason you need fine-tuning you should pass a list of tuples in the form [("json_name0.json",nparts_this_file0),("json_name1.json",nparts_this_file1) ... ] where where the sum of nparts_this_file%d is exactly nparts. These files will automatically be added to filenames.json if you use reader.dumpToJSON.

  • **option_kwargs - allows you to set default options like the color, particle sizes, etc... for this particle group at the creation of the instance. You can see available options by looking at list(particleGroup.options_default.keys()).