lib/transient.py
def rrPlot3d(self, Yparameter='Sample Orientation', title='3dplot', Xlabel='Time, ps',
                 Zlabel='Kerr rotation (mrad)',
                 colormap='viridis'):  # todo: correct to new TransientsSet() class system
        '''plot 3d graf with time on X trace on Z and selected parametr on Y '''
        # create 3 lists of X Y Z data
        time = []
        trace = []
        ypar = []
        # for every scan object takes values
        for item in self.transients:
            time.append(item.time)
            trace.append(item.trace)
            # on Y axis will be chosen parameter which exist in scan object
            ypar.append(item.parameters[Yparameter][0])
        # Make proper arrays from lists with data
        Ypar = []

        for item in range(len(self.transients[0].time)):
            Ypar.append(ypar)

        X = np.array(time)
        Y = np.transpose(np.array(Ypar))
        Z = np.array(trace)

        fig = plt.figure(num=2)
        ax = fig.add_subplot(111, projection='3d')
        ax.plot_surface(X, Y, Z, rstride=1, cstride=100, cmap=colormap)
        ax.set_xlabel(Xlabel, fontsize=20, labelpad=20)
        ax.tick_params(axis='x', labelsize=20)
        ax.tick_params(axis='y', labelsize=20)
        ax.tick_params(axis='z', labelsize=20)

        ax.set_ylabel(Yparameter, fontsize=20, labelpad=20)
        ax.set_zlabel(Zlabel, fontsize=20, labelpad=20)
        ax.set_title(title, fontsize=40)
        plt.show()
plot 3d graf with time on X trace on Z and selected parametr on Y 
plot 3d graf with time on X trace on Z and selected parametr on Y
plot 3d graf with time on X trace on Z and selected parametr on Y
def rrPlot3d(self, Yparameter='Sample Orientation', title='3dplot', Xlabel='Time, ps',
                 Zlabel='Kerr rotation (mrad)',
                 colormap='viridis'):  
        time = []
        trace = []
        ypar = []
        for item in self.transients:
            time.append(item.time)
            trace.append(item.trace)
            ypar.append(item.parameters[Yparameter][0])
        Ypar = []
        for item in range(len(self.transients[0].time)):
            Ypar.append(ypar)
        X = np.array(time)
        Y = np.transpose(np.array(Ypar))
        Z = np.array(trace)
        fig = plt.figure(num=2)
        ax = fig.add_subplot(111, projection='3d')
        ax.plot_surface(X, Y, Z, rstride=1, cstride=100, cmap=colormap)
        ax.set_xlabel(Xlabel, fontsize=20, labelpad=20)
        ax.tick_params(axis='x', labelsize=20)
        ax.tick_params(axis='y', labelsize=20)
        ax.tick_params(axis='z', labelsize=20)
        ax.set_ylabel(Yparameter, fontsize=20, labelpad=20)
        ax.set_zlabel(Zlabel, fontsize=20, labelpad=20)
        ax.set_title(title, fontsize=40)
        plt.show()
def rrPlot3d ( self , Yparameter = 'Sample Orientation' , title = '3dplot' , Xlabel = 'Time, ps' , Zlabel = 'Kerr rotation (mrad)' , colormap = 'viridis' ) : time = [ ] trace = [ ] ypar = [ ] for item in self . transients : time . append ( item . time ) trace . append ( item . trace ) ypar . append ( item . parameters [ Yparameter ] [ 0 ] ) Ypar = [ ] for item in range ( len ( self . transients [ 0 ] . time ) ) : Ypar . append ( ypar ) X = np . array ( time ) Y = np . transpose ( np . array ( Ypar ) ) Z = np . array ( trace ) fig = plt . figure ( num = 2 ) ax = fig . add_subplot ( 111 , projection = '3d' ) ax . plot_surface ( X , Y , Z , rstride = 1 , cstride = 100 , cmap = colormap ) ax . set_xlabel ( Xlabel , fontsize = 20 , labelpad = 20 ) ax . tick_params ( axis = 'x' , labelsize = 20 ) ax . tick_params ( axis = 'y' , labelsize = 20 ) ax . tick_params ( axis = 'z' , labelsize = 20 ) ax . set_ylabel ( Yparameter , fontsize = 20 , labelpad = 20 ) ax . set_zlabel ( Zlabel , fontsize = 20 , labelpad = 20 ) ax . set_title ( title , fontsize = 40 ) plt . show ( )
plot 3d graf with time on X trace on Z and selected parametr on Y
plot 3d graf with time on X trace on Z and selected parametr on Y
# todo: correct to new TransientsSet() class system '''plot 3d graf with time on X trace on Z and selected parametr on Y ''' # create 3 lists of X Y Z data # for every scan object takes values # on Y axis will be chosen parameter which exist in scan object # Make proper arrays from lists with data
self
Yparameter
title
Xlabel
Zlabel
colormap