
Hello Fernando,
I'm using the following script to analyze my data:
from yt.config import ytcfg; ytcfg["yt","serialize"] = "False" from yt.mods import * from yt.analysis_modules.star_analysis.api import * pf = load("DD0088/g1e10s1e11dm1e12_0088") my_disk=pf.h.disk([0.5, 0.5, 0.5], [0, 0, 1], 50/pf["kpc"], 10/pf["kpc"]) sfr = StarFormationRate(pf, data_source=my_disk)
If you want to select stars by particle_type, the easiest way to do it is to hand-feed the stars you want considered to the analysis machinery:
from yt.config import ytcfg; ytcfg["yt","serialize"] = "False" from yt.mods import * from yt.analysis_modules.star_analysis.api import * pf = load("DD0088/g1e10s1e11dm1e12_0088") my_disk=pf.h.disk([0.5, 0.5, 0.5], [0, 0, 1], 50/pf["kpc"], 10/pf["kpc"]) sel = (my_disk["particle_type"] == 2) st_ct = my_disk["creation_time"][sel] st_mass = my_disk["ParticleMassMsun"][sel] sfr = StarFormationRate(pf, star_mass = st_mass, star_creation_time = st_ct)
However! The error message you sent shows that the "creation_time" field is problematic in your dataset, so even the example above won't work. Clearly, the creation time of stars is needed if you want to graph the star formation rate as a function of time. This looks like an enzo dataset, can you try this command and tell me what the output is?
h5ls DD0088/g1e10s1e11dm1e12_0088.cpu0000/Grid00000001