def HSTsync(sim, cam, verbose):
    """ this function now uses UT1 time -- seconds since 1970 Jan 1
    """
    try:
        if isinstance(sim.startutc, datetime):
            reqStart = sim.startutc.timestamp()
            reqStop = sim.stoputc.timestamp()
        elif isinstance(sim.startutc, (float, int)):  # ut1_unix
            reqStart = sim.startutc
            reqStop = sim.stoputc
        else:
            raise TypeError('unknown time request format')
    except AttributeError:  # no specified start,stop, but is there a specifed time list?
        try:
            treqlist = atleast_1d(sim.treqlist)
            if isinstance(treqlist[0], datetime):
                treqlist = array([t.timestamp() for t in treqlist])
            elif isinstance(treqlist[0], (float, int)):
                pass  # already ut1_unix
            elif isinstance(treqlist[0], str):
                raise TypeError('parse dates before passing them in here')
            else:
                logging.error(
                    'I did not understand your time request, falling back to all times')
                reqStart = 0.  # arbitrary time in the past
                reqStop = 3e9  # arbitrary time in the future
        except AttributeError:
            reqStart = 0.  # arbitrary time in the past
            reqStop = 3e9  # arbitrary time in the future
# %% determine mutual start/stop frame
# FIXME: assumes that all cameras overlap in time at least a little.
# we will play only over UTC times for which both sites have frames available
    # who started last
    mutualStart = max([C.filestartutc for C in cam if C.usecam])
    mutualStop = min([C.filestoputc for C in cam if C.usecam]
                     )  # who ended first
# %% make playback time steps
    """
    based on the "simulated" UTC times that do not necessarily correspond exactly
    with either camera.
    """
    tall = arange(mutualStart, mutualStop, sim.kineticsec)

    logging.info(f'{tall.size} mutual frames available '
                 f'from {datetime.utcfromtimestamp(mutualStart)}'
                 f'to {datetime.utcfromtimestamp(mutualStop)}')
# %% adjust start/stop to user request
    try:
        treq = treqlist
    except NameError:
        # keep greater than start time
        treq = tall[(tall > reqStart) & (tall < reqStop)]

    assert len(treq) > 0, 'did not find any times within your limits'

    logging.info('Per user specification, analyzing {} frames from {} to {}'.format(
        treq.size, treq[0], treq[-1]))
# %% use *nearest neighbor* interpolation to find mutual frames to display.
    """ sometimes one camera will have frames repeated, while the other camera
    might skip some frames altogether
    """
    for C in cam:
        if C.usecam:
            ft = interp1d(C.ut1unix,
                          arange(C.ut1unix.size, dtype=int),
                          kind='nearest',
                          bounds_error=False)

            ind = around(ft(treq))
            ind = ind[isfinite(ind)]  # discard requests outside of file bounds
            # these are the indices for each time (the slower camera will use some frames twice in a row)
            C.pbInd = ind.astype(int)
            print('using frames {} to {} for camera {}'.format(
                C.pbInd[0], C.pbInd[-1], C.name))

    sim.nTimeSlice = treq.size

    return cam, sim