def select_alive_stars(ds, data, t_min, t_max,
                       include_partial = True):
    """
    Given a list of all stars, returns boolean list that
    can be used to select the ones that were 'alive'
    during the desired time range, t_min and t_max. This is very
    useful for post-processing without having to acess many datasets

    include_partial : include stars that were alive for only part of the time
                      range, rather than the entire time range. Defualt True
    """

    lifetime = data[('io','particle_model_lifetime')].to('Myr')
    t_o      = data[('io','creation_time')].to('Myr')

    if include_partial: # include stars that were alive at some point during range
        pcut = (t_o + lifetime >= t_min) * ( t_o <= t_max )
    else: # only stars that were alive during the entire time range
        pcut = (t_o <= t_min) * (t_o + lifetime >= t_max)

    return pcut