<jupyter_start><jupyter_text>Convert FIRE dataIn this example notebook we demonstrate how to use the `Firefly.data_reader.FIREreader` sub-class which creates specialized data files for FIRE formatted data. The details of how the `FIREreader` class is "specialized" see the API documentation and to see the example of this output visit the live demo version.<jupyter_code>## create a FIRE reader object
reader = FIREreader(
    ## path to directory containing (optionally multiple) .hdf5 files
    snapdir = "/Users/agurvich/research/snaps/isolated_disks/Control_G4_20/snapdir_050/",
    ## the snapshot number, best to provide separately in order to disambiguate
    snapnum = 50,
    ## particle types one would like to extract from .hdf5 files
    ptypes=[0,4],
    ## what to call them in the UI
    UInames=['Gas','Stars'],
    ## by what factor would we like to reduce the data for performance stability and disk space concerns
    decimation_factors=[10,100],
    ## what fields would we like to extract
    fields=['Density','Velocities','Temperature'],
    ## do we want to take the magnitude of any of these fields?
    magFlags=[False,False,False],
    ## do we want to take the log? 
    logFlags=[True,False,True],
    ## which fields do we want to be able to filter on?
    filterFlags=[True,True,True],
    ## which fields do we want to be able to colormap by?
    colormapFlags=[True,True,True],
    ## where should the output .json files be saved to? 
    ##  if a relative path is given, like here, saves to $HOME/<JSONdir>
    ##  and creates a soft-link to Firefly/static/data
    JSONdir=os.path.abspath(os.path.join(os.getcwd(),'..','static','data','FIREData_50')),
    ## overwrite the existing startup.json file
    write_startup=True)

## fetch data from .hdf5 files
reader.loadData()

## set the color and size of the gas and star particles
##  to be aesthetically pleasing
reader.settings['color']['Gas']=[1,0,0,1]
reader.settings['color']['Stars']=[0,0,1,1]
reader.settings['sizeMult']['Gas']=1
reader.settings['sizeMult']['Stars']=0.5
reader.settings['camera'] = [0,0,-15]

## dump output to .json files
reader.dumpToJSON()<jupyter_output>Loading ptype 4
/Users/agurvich/research/snaps/isolated_disks/Control_G4_20/snapdir_050/snapshot_050.hdf5
Loading ptype 0
/Users/agurvich/research/snaps/isolated_disks/Control_G4_20/snapdir_050/snapshot_050.hdf5<jupyter_text>Using `Firefly.data_reader.SimpleFIREreader`To simplify this process we have provided `Firefly.data_reader.SimpleFIREreader` which takes a path to a FIRE snapshot and creates a "standard" iteration of Firefly given only a path to the data.<jupyter_code>reader = SimpleFIREreader(
    ## path to directory containing (optionally multiple) .hdf5 files
    "/Users/agurvich/research/snaps/isolated_disks/Control_G4_20/snapdir_050/",
    ## overwrite the existing startup.json file
    write_startup=True, 
    ## pass absolute path to avoid symlink
    JSONdir=os.path.abspath(os.path.join(os.getcwd(),'..','static','data','FIREData_50')))<jupyter_output>Loading ptype 4
/Users/agurvich/research/snaps/isolated_disks/Control_G4_20/snapdir_050/snapshot_050.hdf5
Loading ptype 0
/Users/agurvich/research/snaps/isolated_disks/Control_G4_20/snapdir_050/snapshot_050.hdf5
Outputting: Gas - 106666/1066668 particles - 3 tracked fields
Outputting: Stars - 51411/514118 particles - 3 tracked fields
{'fraction_non_alphanumeric': 0.1068363421130512, 'fraction_numerical': 0.033737792246226694, 'mean_word_length': 4.7679180887372015, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '131770', 'license': 'MIT', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1074, 'n_words': 316, 'path': 'src/Firefly/ntbks/convert_FIRE_data.ipynb', 'repo_name': 'neutrinoceros/Firefly', 'size': '3379'}