Hi,
I am trying to make a particle filter for just the old stars for which my
simulation requires pruning with two fields "particle_mass" and
"particle_age".
def old(pfilter, data):
>
> age = data["all", "particle_age"]
>
> old_only = data["all", "particle_mass"]
>
> filter = np.logical_and(age.in_units('Myr') = 0,
> old_only.in_units('Msun') < 4e6)
>
> return filter
>
>
>
But I encounter an error:
File "new-old-stars.py", line 14
> filter = np.logical_and(age.in_units('Myr') = 0,
> old_only.in_units('Msun') < 4e6)
> ^
> SyntaxError: keyword can't be an expression
Could someone please point out what the issue here could be? Can I not use
a filter with two different fields?