print(i)
        save_folder = '../S{}'.format(i)

        # Get the folder where the data is
        folder = '/mnt/bulk-data/research_data/USC_beamtime/APS_March_2016/S' \
                 + str(i) + '/temp_exp'

        # Get the run header assocaited with that folder
        hdr = db(run_folder=folder)[0]

        # Mux the data so that we have the correct Temp->data relationship
        dm = DataMuxer()
        dm.append_events(get_events(hdr))
        df = dm.to_sparse_dataframe()
        print(df.keys())
        binned = dm.bin_on('img', interpolation={'T': 'linear'})

        for plot_type in [
            'gr',
            'chi'
        ]:
            if plot_type is 'gr':
                # Only to the G(r)
                key_list = [f for f in os.listdir(folder) if
                            f.endswith('.gr') and not f.startswith('d')]
                # If we are working with G(r) files use these offset and read parameters
                offset = .1
                skr = 0
                xlims = [
                    (0, 40),
                    (0, 10),