import yt
import numpy as np
from matplotlib import pyplot as plt
import os

num_problems = 2

ncell = 64

vel_arr = [0, 1, 3, 10, 30, 100]

for p in range(num_problems):

    problem = p + 1

    for v in vel_arr:

        # First we load in the numerical data. We want to use the last plotfile
        # since that is at the time of interest.

        dir = "results/problem" + str(problem) + "/velocity" + str(v) + "/" + str(ncell)

        dir_contents = os.listdir(dir)

        # Strip out non-plotfiles, then select the last one in the list.

        plotfiles = sorted(filter(lambda s: s[0:3] == 'plt', dir_contents))

        pf_name = dir + "/" + plotfiles[len(plotfiles)-1]

        pf = yt.load(pf_name)

        plot = yt.SlicePlot(pf, 'z', "density", width=(1.0, 'cm'))

        file_name = 'density_t2_p_' + str(problem) + '_v_' + str(v) + '_n_' + str(ncell) + '.eps'

        plot.save(file_name)

@@ -100,10 +100,11 @@
 l = 
-64
+512
 %0A%0Ave
@@ -517,24 +517,34 @@
  select the 
+first and 
 last one in 
@@ -627,24 +627,708 @@
 contents))%0A%0A
+        # This step strips out 'plt' from each plotfile, sorts them numerically,%0A        # then recasts them as strings. This is necessary because we may have some%0A        # plotfiles with six digits and some with five, and the default sort will%0A        # not sort them properly numerically.%0A%0A        plotfiles = %5B'plt' + str(y).zfill(5) for y in sorted(%5Bint(x%5B3:%5D) for x in plotfiles%5D)%5D%0A%0A        pf_name = dir + %22/%22 + plotfiles%5B0%5D%0A%0A        print pf_name%0A%0A        pf = yt.load(pf_name)%0A%0A        plot = yt.SlicePlot(pf, 'z', %22density%22, width=(1.0, 'cm'))%0A%0A        file_name = 'density_t0_p_' + str(problem) + '_v_' + str(v) + '_n_' + str(ncell) + '.eps'%0A%0A        plot.save(file_name)%0A%0A
         pf_n
@@ -1374,16 +1374,39 @@
 es)-1%5D%0A%0A
+        print pf_name%0A%0A
         

Add ability of KH test analysis script to deal with plotfiles that reach six digits.