def setup_reader(self):
     """"Setup the reader in here.  This is called after the engine
     has been created and started.  The engine is available as
     self.e.  This method is called by setUp().
     """
     # Read a OBJ data file.
     r = PolyDataReader()
     r.initialize(get_example_data('shuttle.obj'))
     self.e.add_source(r)
     self.bounds = (-7.65, 7.04, -4.68, 4.68, -1.35, 4.16)
 def setup_reader(self):
     """"Setup the reader in here.  This is called after the engine
     has been created and started.  The engine is available as
     self.e.  This method is called by setUp().
     """
     # Read a SLC data file.
     r = PolyDataReader()
     r.initialize(get_example_data('nut.slc'))
     self.e.add_source(r)
     self.bounds = (0.0, 67.0, 0.0, 40.0, 0.0, 58.0)
 def setup_reader(self):
     """"Setup the reader in here.  This is called after the engine
     has been created and started.  The engine is available as
     self.e.  This method is called by setUp().
     """
     # Read a BYU data file.
     r = PolyDataReader()
     r.initialize(get_example_data('cow.g'))
     self.e.add_source(r)
     self.bounds = (-4.445, 5.998, -3.608, 2.760, -1.690, 1.690)
 def setup_reader(self):
     """"Setup the reader in here.  This is called after the engine
     has been created and started.  The engine is available as
     self.e.  This method is called by setUp().
     """
     # Read a PDB data file.
     r = PolyDataReader()
     r.initialize(get_example_data('caffeine.pdb'))
     self.e.add_source(r)
     self.bounds = (3.10, 10.78, -2.39, 4.03, -10.60, -6.31)
 def setup_reader(self):
     """"Setup the reader in here.  This is called after the engine
     has been created and started.  The engine is available as
     self.e.  This method is called by setUp().
     """
     # Read a Facet data file.
     r = PolyDataReader()
     r.initialize(get_example_data('clown.facet'))
     self.e.add_source(r)
     self.bounds = (-0.5, 0.69, -0.49, 0.49, -1.09, 0.5)
 def setup_reader(self):
     """"Setup the reader in here.  This is called after the engine
     has been created and started.  The engine is available as
     self.e.  This method is called by setUp().
     """
     # Read a STL data file.
     r = PolyDataReader()
     r.initialize(get_example_data('humanoid_tri.stla'))
     self.e.add_source(r)
     self.bounds = (0.60, 3.47, -3.96, 3.95, 3.05, 17.39)
示例#7
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a BYU data file.
        r = PolyDataReader()
        r.initialize(get_example_data('cow.g'))
        self.e.add_source(r)
        self.bounds = (-4.445, 5.998, -3.608, 2.760, -1.690, 1.690)
示例#8
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a OBJ data file.
        r = PolyDataReader()
        r.initialize(get_example_data('shuttle.obj'))
        self.e.add_source(r)
        self.bounds = (-7.65, 7.04, -4.68, 4.68, -1.35, 4.16)
示例#9
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a Facet data file.
        r = PolyDataReader()
        r.initialize(get_example_data('clown.facet'))
        self.e.add_source(r)
        self.bounds = (-0.5, 0.69, -0.49, 0.49, -1.09, 0.5)
示例#10
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a SLC data file.
        r = PolyDataReader()
        r.initialize(get_example_data('nut.slc'))
        self.e.add_source(r)
        self.bounds =  (0.0, 67.0, 0.0, 40.0, 0.0, 58.0)
示例#11
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a STL data file.
        r = PolyDataReader()
        r.initialize(get_example_data('humanoid_tri.stla'))
        self.e.add_source(r)
        self.bounds =  (0.60, 3.47, -3.96, 3.95, 3.05, 17.39)
示例#12
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a PDB data file.
        r = PolyDataReader()
        r.initialize(get_example_data('caffeine.pdb'))
        self.e.add_source(r)
        self.bounds = (3.10, 10.78, -2.39, 4.03, -10.60, -6.31)
示例#13
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a Particle data file.
        r = PolyDataReader()
        r.initialize(get_example_data('Particles.raw'))
        self.e.add_source(r)
        r.reader.set(data_byte_order='big_endian', data_type='float', file_type='binary')
        self.bounds = (817.33, 826.09, 545.02, 571.02, 1443.48, 1511.18)
示例#14
0
    def setup_reader(self):

        """"Setup the reader in here.  This is called after the engine
        has been created and started.  The engine is available as
        self.e.  This method is called by setUp().
        """
        # Read a Particle data file.
        r = PolyDataReader()
        r.initialize(get_example_data('Particles.raw'))
        self.e.add_source(r)
        r.reader.set(data_byte_order='big_endian', data_type='float', file_type='binary')
        self.bounds = (817.33, 826.09, 545.02, 571.02, 1443.48, 1511.18)
示例#15
0
def make_plot(phi_min = 0, phi_max = 2.*np.pi):
    vmec_filename = '/home/srh112/code/python/h1_eq_generation/results7/kh0.100-kv1.000fixed/wout_kh0.100-kv1.000fixed.nc'
    f = mlab.figure(1, fgcolor=(0, 0, 0), bgcolor=(1, 1, 1))
    from mayavi.sources.poly_data_reader import PolyDataReader 
    a = PolyDataReader()
    a.initialize("/home/srh112/code/python/python-h1/h1/h1model/helical.stl")
    e = mlab.get_engine()
    e.add_source(a)
    from mayavi.modules.surface import Surface
    s = Surface()
    e.add_module(s)

    x, y, z, B = plot_vmec(vmec_filename=vmec_filename, phi_min = phi_min, phi_max = phi_max)
    #x, y, z, B = extract_VMEC_surface_data(vmec_filename, s_ind=-1, phi_min = phi_min, phi_max = phi_max)
    #pts = mlab.mesh(x[:,:], y[:,:], z[:,:], opacity = 1.0, scalars = B, colormap = 'hot', representation='surface')

    #plot the TFC's 
    include_coils = range(5,27,1)
    tfc_thickness=0.075;tfc_width=0.15; tfc_radius = 0.383
    #tfc_mesh_props = {'opacity':0.3,'color':(1,0.,0.)}
    tfc_mesh_props = {'opacity':1.0,'color':(0.5,0.5,0.5)}
    plot_tfc(include_coils, tfc_thickness=0.075, tfc_width=0.15, tfc_radius = 0.383, tfc_mesh_props = None)

    pfc_mesh_props = {'opacity':1.,'color':(0.5,0.5,0.5)}
    plot_pfc(pfc_thickness = 0.11, pfc_width = 0.11, pfc_radius = 1.0, pfc_mesh_props=pfc_mesh_props)

    ovc_mesh_props = {'opacity':1,'color':(255/255., 255/255., 51/255.)}
    #plot_ovc(ovc_mesh_props=ovc_mesh_props)

    ivc_mesh_props = {'opacity':1,'color':(0.5,0.5,0.5)}
    #plot_ivc(ivc_mesh_props=ivc_mesh_props)

    #Plot the HMA and poloidal Mirnov arrays as cubes joined by a line
    show_hma = 1; show_pol_array1 = 1; show_pol_array2 = 1
    HMA_x, HMA_y, HMA_z, pol_array1_x, pol_array1_y, pol_array1_z, pol_array2_x, pol_array2_y, pol_array2_z = mirnov_locations()
    if show_hma:
        mlab.plot3d(HMA_x, HMA_y, HMA_z,line_width=1,tube_radius=0.01)
        #mlab.points3d(HMA_x, HMA_y, HMA_z, scale_mode='none', scale_factor = 0.04, color=(0.5,0.5,0.5),mode='cube')
        mlab.points3d(HMA_x, HMA_y, HMA_z, scale_mode='none', scale_factor = 0.04, color=(0,0.,1),mode='cube')
    if show_pol_array1:
        mlab.plot3d(pol_array1_x, pol_array1_y, pol_array1_z,line_width=1,tube_radius=0.02)
        mlab.points3d(pol_array1_x, pol_array1_y, pol_array1_z, scale_mode='none', scale_factor = 0.04, color=(0,1,0),mode='cube')
    if show_pol_array2:
        mlab.plot3d(pol_array2_x, pol_array2_y, pol_array2_z,line_width=1,tube_radius=0.02)
        mlab.points3d(pol_array2_x, pol_array2_y, pol_array2_z, scale_mode='none', scale_factor = 0.04, color=(0.,1.,0.),mode='cube')

    return x, y, z
示例#16
0
    def read(self, fname, **kwds):
        """ read a ply file """
        try:
            from mayavi.sources.poly_data_reader import PolyDataReader
        except:
            from enthought.mayavi.sources.poly_data_reader import PolyDataReader

        my_reader = PolyDataReader()
        return generic_vtk_read(my_reader, fname, **kwds)