Hi, I'm creating a series of projections in a loop, where the conditions for the projection change with each iteration: for v in range(resolution[2]): projection = pf.h.proj(2, 'LOSVelocityRangeDensity') I can't seem to persuade yt to delete the old projection and make a fresh one each sweep. I've tried: if projection.has_key("LOSVelocityRangeDensity"): del projection["LOSVelocityRangeDensity"] and for g in pf.h.grids: if g.has_key("LOSVelocityRangeDensity"): del g["LOSVelocityRangeDensity"] But it's clearly not re-making the projection. Is there a better way to make it ever forget it has ever produced a projection of this field before and start from scratch with the new loop parameters? Elizabeth
Hi Elizabeth, Put this at the very top of your script: from yt.config import ytcfg ytcfg["yt","serialize"] = "False" This will disable saving the projections. I'd very, very much like to turn off auto-saving of projections in future versions of yt, and make it a deliberate choice, but I don't know how good an idea that is. :) -Matt On Sat, Jul 14, 2012 at 7:45 AM, Elizabeth Tasker <tasker@astro1.sci.hokudai.ac.jp> wrote:
Hi,
I'm creating a series of projections in a loop, where the conditions for the projection change with each iteration:
for v in range(resolution[2]): projection = pf.h.proj(2, 'LOSVelocityRangeDensity')
I can't seem to persuade yt to delete the old projection and make a fresh one each sweep. I've tried:
if projection.has_key("LOSVelocityRangeDensity"): del projection["LOSVelocityRangeDensity"]
and
for g in pf.h.grids: if g.has_key("LOSVelocityRangeDensity"): del g["LOSVelocityRangeDensity"]
But it's clearly not re-making the projection.
Is there a better way to make it ever forget it has ever produced a projection of this field before and start from scratch with the new loop parameters?
Elizabeth _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Matt, Hmm, oddly I did that but I think I did it after I ran the script once and created a .yt and .harrays file. I've deleted those and retried (using only your line, not my other attempts) and we seems to be good! Thanks! Elizabeth On Jul 15, 2012, at 2:34 AM, Matthew Turk wrote:
Hi Elizabeth,
Put this at the very top of your script:
from yt.config import ytcfg ytcfg["yt","serialize"] = "False"
This will disable saving the projections. I'd very, very much like to turn off auto-saving of projections in future versions of yt, and make it a deliberate choice, but I don't know how good an idea that is. :)
-Matt
On Sat, Jul 14, 2012 at 7:45 AM, Elizabeth Tasker <tasker@astro1.sci.hokudai.ac.jp> wrote:
Hi,
I'm creating a series of projections in a loop, where the conditions for the projection change with each iteration:
for v in range(resolution[2]): projection = pf.h.proj(2, 'LOSVelocityRangeDensity')
I can't seem to persuade yt to delete the old projection and make a fresh one each sweep. I've tried:
if projection.has_key("LOSVelocityRangeDensity"): del projection["LOSVelocityRangeDensity"]
and
for g in pf.h.grids: if g.has_key("LOSVelocityRangeDensity"): del g["LOSVelocityRangeDensity"]
But it's clearly not re-making the projection.
Is there a better way to make it ever forget it has ever produced a projection of this field before and start from scratch with the new loop parameters?
Elizabeth _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Elizabeth Tasker
-
Matthew Turk