Exemplo n.º 1
0
 fnames = [os.path.join(tdir, 'x%02d.jpg' % i) for i in range(n_img) ]
 
 f = m.figure(1, size = (1000, 500), fgcolor = (0, 0, 0),
              bgcolor = (1., 1., 1.))
 
 s = m.surf(n_e_arr[1], n_e_arr[2], n_mu_q_arr[0, :, :])
 ms = s.mlab_source
 
 m.axes(s, color = (.7, .7, .7),
        extent = (-1, 1, 0, 1, 0, 1),
        ranges = (-0.21, 0.21, 0.1, 20, 0, max_mu_q),
        xlabel = 'x[mm]', ylabel = 'Lr[mm]',
        zlabel = 'f[N]',)
 m.view(-60.0, 70.0, focalpoint = [0., 0.45, 0.45])
 
 m.savefig(fnames[0])
 
 for i, fname in enumerate(fnames[1:]):
     ms.scalars = n_mu_q_arr[i, :, :]
     m.savefig(fname)
 
 images = string.join(fnames, ' ')
 destination = os.path.join('fig', 'fiber_cb_8p_anim.gif')
 
 import platform
 if platform.system() == 'Linux':
     os.system('convert ' + images + ' ' + destination)
 else:
     raise NotImplementedError, 'film production available only on linux'
 
 m.show()
Exemplo n.º 2
0
    m.axes(
        s,
        color=(.7, .7, .7),
        extent=(-1, 1, 0, 1, 0, 1),
        ranges=(-0.21, 0.21, 0.1, 20, 0, max_mu_q),
        xlabel='x',
        ylabel='Lr',
        zlabel='Force',
    )

    m.view(-60.0, 70.0, focalpoint=[0., 0.45, 0.45])
    # Store the information
    view = m.view()
    roll = m.roll()
    print(('view', view))
    print(('roll', roll))
    print((n_mu_q_arr.shape[2]))

    ms = s.mlab_source
    for i in range(1, n_mu_q_arr.shape[0]):
        ms.scalars = n_mu_q_arr[i, :, :]
        fname = 'x%02d.jpg' % i
        print(('saving', fname))
        m.savefig(fname)
        sleep(0.1)
#    m.surf( n_e_arr[0], n_e_arr[1], n_mu_q_arr + n_std_q_arr )
#    m.surf( n_e_arr[0], n_e_arr[1], n_mu_q_arr - n_std_q_arr )

    m.show()
Exemplo n.º 3
0
    s = m.surf(n_e_arr[1], n_e_arr[2], n_mu_q_arr[0, :, :])
    ms = s.mlab_source

    m.axes(
        s,
        color=(.7, .7, .7),
        extent=(-1, 1, 0, 1, 0, 1),
        ranges=(-0.21, 0.21, 0.1, 20, 0, max_mu_q),
        xlabel='x[mm]',
        ylabel='Lr[mm]',
        zlabel='f[N]',
    )
    m.view(-60.0, 70.0, focalpoint=[0., 0.45, 0.45])

    m.savefig(fnames[0])

    for i, fname in enumerate(fnames[1:]):
        ms.scalars = n_mu_q_arr[i, :, :]
        m.savefig(fname)

    images = string.join(fnames, ' ')
    destination = os.path.join('fig', 'fiber_cb_8p_anim.gif')

    import platform
    if platform.system() == 'Linux':
        os.system('convert ' + images + ' ' + destination)
    else:
        raise NotImplementedError, 'film production available only on linux'

    m.show()
Exemplo n.º 4
0
    f = m.figure(1, size = (1000, 500), fgcolor = (0, 0, 0),
                 bgcolor = (1., 1., 1.))

    s = m.surf(n_e_arr[1], n_e_arr[2], n_mu_q_arr[0, :, :])

    m.axes(s, color = (.7, .7, .7),
           extent = (-1, 1, 0, 1, 0, 1),
              ranges = (-0.21, 0.21, 0.1, 20, 0, max_mu_q),
              xlabel = 'x', ylabel = 'Lr',
              zlabel = 'Force',)

    m.view(-60.0, 70.0, focalpoint = [0., 0.45, 0.45])
    # Store the information
    view = m.view()
    roll = m.roll()
    print 'view', view
    print 'roll', roll
    print n_mu_q_arr.shape[2]

    ms = s.mlab_source
    for i in range(1, n_mu_q_arr.shape[0]):
        ms.scalars = n_mu_q_arr[i, :, :]
        fname = 'x%02d.jpg' % i
        print 'saving', fname
        m.savefig(fname)
        sleep(0.1)
#    m.surf( n_e_arr[0], n_e_arr[1], n_mu_q_arr + n_std_q_arr )
#    m.surf( n_e_arr[0], n_e_arr[1], n_mu_q_arr - n_std_q_arr )

    m.show()