pyrats/fields.py
def young_star(ds, age_myr=10):
    '''
    Select particles created after the beginning of the simulation,
    that are younger than age_myr (in Myr).'''
    def _young_star(pfilter, data):
        filter = data[('star','age')] < data.ds.arr(age_myr,'Myr')
        return filter
    yt.add_particle_filter("young_star", function=_young_star,
                  filtered_type="star")
    ds.add_particle_filter("young_star")  
    return ds

    Select particles created after the beginning of the simulation,
    that are younger than age_myr (in Myr).
Select particles created after the beginning of the simulation,
that are younger than age_myr (in Myr).
Select particles created after the beginning of the simulation that are younger than age_myr ( in Myr ) .
def young_star(ds, age_myr=10):
    def _young_star(pfilter, data):
        filter = data[('star','age')] < data.ds.arr(age_myr,'Myr')
        return filter
    yt.add_particle_filter("young_star", function=_young_star,
                  filtered_type="star")
    ds.add_particle_filter("young_star")  
    return ds
def young_star ( ds , age_myr = 10 ) : def _young_star ( pfilter , data ) : filter = data [ ( 'star' , 'age' ) ] < data . ds . arr ( age_myr , 'Myr' ) return filter yt . add_particle_filter ( "young_star" , function = _young_star , filtered_type = "star" ) ds . add_particle_filter ( "young_star" ) return ds
Select particles created after the beginning of the simulation,
that are younger than age_myr (in Myr).
Select particles created after the beginning of the simulation that are younger than age_myr ( in Myr ) .
'''
    Select particles created after the beginning of the simulation,
    that are younger than age_myr (in Myr).'''
ds
age_myr