def append_to_frame(frame, timeseries, type='<STR_LIT>', channelid=<NUM_LIT:0>):<EOL>
if timeseries.channel:<EOL><INDENT>channel = str(timeseries.channel)<EOL><DEDENT>else:<EOL><INDENT>channel = str(timeseries.name)<EOL><DEDENT>offset = float(LIGOTimeGPS(timeseries.t0.value) -<EOL>LIGOTimeGPS(*frame.GetGTime()))<EOL>if type.lower() == '<STR_LIT>':<EOL><INDENT>frdata = frameCPP.FrAdcData(<EOL>channel,<EOL><NUM_LIT:0>,  <EOL>channelid,  <EOL><NUM_LIT:16>,  <EOL>timeseries.sample_rate.value,  <EOL>)<EOL>frdata.SetTimeOffset(offset)<EOL>append = frame.AppendFrAdcData<EOL><DEDENT>elif type.lower() == '<STR_LIT>':<EOL><INDENT>frdata = frameCPP.FrProcData(<EOL>channel,  <EOL>str(timeseries.name),  <EOL>frameCPP.FrProcData.TIME_SERIES,  <EOL>frameCPP.FrProcData.UNKNOWN_SUB_TYPE,  <EOL>offset,  <EOL>abs(timeseries.span),  <EOL><NUM_LIT:0.>,  <EOL><NUM_LIT:0.>,  <EOL><NUM_LIT:0.>,  <EOL><NUM_LIT:0.>,  <EOL>)<EOL>append = frame.AppendFrProcData<EOL><DEDENT>elif type.lower() == '<STR_LIT>':<EOL><INDENT>frdata = frameCPP.FrSimData(<EOL>str(timeseries.channel),  <EOL>str(timeseries.name),  <EOL>timeseries.sample_rate.value,  <EOL>offset,  <EOL><NUM_LIT:0.>,  <EOL><NUM_LIT:0.>,  <EOL>)<EOL>append = frame.AppendFrSimData<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError("<STR_LIT>"<EOL>"<STR_LIT>".format(type))<EOL><DEDENT>frdata.AppendData(create_frvect(timeseries))<EOL>append(frdata)<EOL>
Append data from a `TimeSeries` to a `~frameCPP.FrameH`

    Parameters
    ----------
    frame : `~frameCPP.FrameH`
        frame object to append to

    timeseries : `TimeSeries`
        the timeseries to append

    type : `str`
        the type of the channel, one of 'adc', 'proc', 'sim'

    channelid : `int`, optional
        the ID of the channel within the group (only used for ADC channels)