Skip to content

The Reader Class

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

Understanding the Reader keyword arguments

  • JSONdir=None - This should be the name of the sub-directory that will contain your JSON files, if you are not running python from /path/to/Firefly/data it should be the absolute path.

  • options=None - An Options instance, if you have created one you can pass it here. None will generate default options. reader.options.listKeys() will give you a list of the different available options you can set using reader.options["option_name"] = option_value.

  • write_startup='append' - This is a flag for whether startup.json file should be written. It has 3 values: True -> writes a new startup.json that will contain only this visualization, 'append' -> which will add this visualization to an existing startup.json (or create a new one), this is the default option, or False -> which will not add an entry to startup.json.

  • max_npart_per_file=10000 - The maximum number of particles saved per file, don't use too large a number or you will have trouble loading the individual files in.

  • prefix='Data' - What you would like your .json files to be called when you run reader.dumpToJSON. The format is (prefix)(particleGroupName)(fileNumber).json.

  • clean_JSONdir=0 - Whether you would like to delete all .json files in the JSONdir. Usually not necessary (since filenames.json will be updated) but good to clean up after yourself.

Clone this wiki locally