def rainbow_to_df(r, timeformat='h'):
    " Convert Rainbow object to pandas dataframe\n    Parameters\n    ----------\n        r : Rainbow object\n            chromatic Rainbow object to convert into pandas df format\n        timeformat : str\n            (optional, default='hours')\n            The time format to use (seconds, minutes, hours, days etc.)\n    Returns\n    ----------\n        pd.DataFrame\n    "
    (rflux, rfluxe, rtime, rwavel) = rainbow_to_vector(r, timeformat)
    (x, y) = np.meshgrid(rtime.to_value(), rwavel.to_value())
    rainbow_dict = {f'Time ({timeformat})': x.ravel(), 'Wavelength (microns)': y.ravel(), 'Flux': rflux.ravel(), 'Flux Error': rfluxe.ravel()}
    df = pd.DataFrame(rainbow_dict)
    return df
Convert Rainbow object to pandas dataframe
Parameters
----------
    r : Rainbow object
        chromatic Rainbow object to convert into pandas df format
    timeformat : str
        (optional, default='hours')
        The time format to use (seconds, minutes, hours, days etc.)
Returns
----------
    pd.DataFrame
def rainbow_to_df(r, timeformat='h'):
    " Convert Rainbow object to pandas dataframe\n    Parameters\n    ----------\n        r : Rainbow object\n            chromatic Rainbow object to convert into pandas df format\n        timeformat : str\n            (optional, default='hours')\n            The time format to use (seconds, minutes, hours, days etc.)\n    Returns\n    ----------\n        pd.DataFrame\n    "
    (rflux, rfluxe, rtime, rwavel) = rainbow_to_vector(r, timeformat)
    (x, y) = np.meshgrid(rtime.to_value(), rwavel.to_value())
    rainbow_dict = {f'Time ({timeformat})': x.ravel(), 'Wavelength (microns)': y.ravel(), 'Flux': rflux.ravel(), 'Flux Error': rfluxe.ravel()}
    df = pd.DataFrame(rainbow_dict)
    return df