[yt-users] creating a max_density and max_temperature sweep line plot

tazkera haque h.tazkera at gmail.com
Thu Apr 28 15:38:47 PDT 2016


Hi,

I am trying to create a max_dens and max_temp sweep plot in yt. I am using
the following code

for n in range (0,118):


        fn = flashFolder+'super3d_hdf5_plt_cnt_%04d' % n
        pf = yt.load(fn) # load data
        #print pf.current_time

        c = pf.h.find_max('temp')[1]
        ax = 0 # take a line cut along the x axis

        # cutting through the y0,z0 such that we hit the max density
        #ray = ds.h.ortho_ray(ax, (c[1], c[2]))

        # ray with start and end point

        ray = pf.h.ray([0.,0.,0.],c)

        # Sort the ray values by 'x' so there are no discontinuities
        # in the line plot
        srt = np.argsort(ray['x'])

        plt.subplot(211)
        plt.semilogy(np.array(ray['x'][srt]), np.array(ray['dens'][srt]))
        plt.ylabel('dens')
        plt.subplot(212)
        plt.semilogy(np.array(ray['x'][srt]), np.array(ray['temp'][srt]))
        plt.xlabel('x')
        plt.ylabel('temp')

        plt.savefig("test_plots/den_temp_xsweep.png")

and getting the the following error:

IOError: [Errno 2] No such file or directory:
'test_plots/den_temp_xsweep.png'


Any suggestion on how to fix this error is highly appreciated.

THanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160428/f37c2019/attachment.htm>


More information about the yt-users mailing list