[yt-users] changing the name of saved files

Cameron Hummels chummels at astro.columbia.edu
Fri Jul 8 06:03:01 PDT 2011


Hi Elizabeth,

You could always include these lines in your script:

import os
old_filename =
'GT_BTAccel_256AMR4_PeHeat_sf5_SNe_0301_Slice_z_PotentialField'
count = 0
<whatever code generates your png file>
new_filename = "%s_%04i.png" % (old_filename, count)
os.rename(old_filename, new_filename)|
| count += 1
||...

I don't think there is an automatic filename iterator (instead of
clobberer) in yt.  Maybe I'll look at adding one later.

Cameron


On 07/08/2011 07:43 AM, Elizabeth Tasker wrote:
> Hi,
>
> I'd like to create a bunch of slices of the same field, but with different options (width, modifiers etc). Is it possible to change the file name yt saves the plots under so:
>
> GT_BTAccel_256AMR4_PeHeat_sf5_SNe_0301_Slice_z_PotentialField.png
>
>
> Doesn't get over-written with each one?
>
> Thanks you~
>
> Elizabeth
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>

-- 
Cameron Hummels
PhD Candidate, Astronomy Department of Columbia University
Public Outreach Director, Astronomy Department of Columbia University
NASA IYA New York State Student Ambassador
http://outreach.astro.columbia.edu 
PGP: 0x06F886E3

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20110708/effcfde8/attachment.html>


More information about the yt-users mailing list