コード例 #1
0
def show_3d(cube, vmin=None, vmax=None):
    """opens mayavi window"""
    data = cube[0]
    dataview = cube[1]

    app = QtGui.QApplication.instance()
    if app is None:
        app = QtGui.QApplication(sys.argv)

    data.check_for_ev_cube(data.hdf5)
    ycube = analysis.mayavi_cube(data, dataview)
    if ycube == []:
        print "No ev cube in file. Press Make ev Cube"
        return
    if dataview.display_ev:
        if vmax is not None:
            dataview.vmin_wavelength = 1240 / vmax
        if vmin is not None:
            dataview.vmax_wavelength = 1240 / vmin
    else:
        if vmin is not None:
            dataview.vmin_wavelength = vmin
        if vmax is not None:
            dataview.vmax_wavelength = vmax

    min_slice, max_slice = analysis.mayavi_slices(data, dataview)

    #order min and max correctly
    try:
        ycube_slice = ycube[:, :, min_slice:max_slice]
    except ValueError:
        ycube_slice = ycube[:, :, max_slice:min_slice]
    visualization_window = visualization.MayaviQWidget(ycube_slice)
    app.exec_()
    return visualization_window
コード例 #2
0
ファイル: h_cubereader.py プロジェクト: jgrebel1/cubereader
def show_3d(cube, vmin=None,vmax=None):
    """opens mayavi window"""
    data = cube[0]
    dataview = cube[1]
    
    app = QtGui.QApplication.instance()
    if app is None:
        app = QtGui.QApplication(sys.argv)
        
    data.check_for_ev_cube(data.hdf5)
    ycube = analysis.mayavi_cube(data, dataview)
    if ycube == []:
        print "No ev cube in file. Press Make ev Cube"
        return
    if dataview.display_ev:
        if vmax is not None:
            dataview.vmin_wavelength = 1240/vmax
        if vmin is not None:
            dataview.vmax_wavelength = 1240/vmin
    else:
        if vmin is not None:
            dataview.vmin_wavelength = vmin
        if vmax is not None:
            dataview.vmax_wavelength = vmax

    min_slice, max_slice = analysis.mayavi_slices(data, dataview)
    
    #order min and max correctly
    try:
        ycube_slice = ycube[:,:,min_slice:max_slice]
    except ValueError:
        ycube_slice = ycube[:,:,max_slice:min_slice]
    visualization_window = visualization.MayaviQWidget(ycube_slice)
    app.exec_()
    return visualization_window
コード例 #3
0
ファイル: tab.py プロジェクト: jgrebel1/cubereader
 def open_visualization(self):
     """opens mayavi window"""
     self.data.check_for_ev_cube(self.data.hdf5)
     ycube = analysis.mayavi_cube(self.data, self.dataview)
     if ycube == []:
         print "No ev cube in file. Press Make ev Cube"
         return
     min_slice, max_slice = analysis.mayavi_slices(self.data, self.dataview)
     try:
         ycube_slice = ycube[:, :, min_slice:max_slice]
     except ValueError:
         ycube_slice = ycube[:, :, max_slice:min_slice]
     self.visualization_window = visualization.MayaviQWidget(ycube_slice)
     self.visualization_window.show()
コード例 #4
0
ファイル: tab.py プロジェクト: jgrebel1/cubereader
 def open_visualization(self):
     """opens mayavi window"""
     self.data.check_for_ev_cube(self.data.hdf5)
     ycube = analysis.mayavi_cube(self.data, self.dataview)
     if ycube == []:
         print "No ev cube in file. Press Make ev Cube"
         return
     min_slice, max_slice = analysis.mayavi_slices(self.data,
                                                   self.dataview)
     try:
         ycube_slice = ycube[:,:,min_slice:max_slice]
     except ValueError:
         ycube_slice = ycube[:,:,max_slice:min_slice]
     self.visualization_window = visualization.MayaviQWidget(ycube_slice)
     self.visualization_window.show()