Пример #1
0
 def plot_profile(self, plot_shift=None):
     import pylab
     from bumps.plotutil import auto_shift
     plot_shift = plot_shift if plot_shift is not None else Experiment.profile_shift
     trans = auto_shift(plot_shift)
     if self.ismagnetic:
         z,rho,irho,rhoM,thetaM = self.magnetic_profile()
         #rhoM_net = rhoM*numpy.cos(numpy.radians(thetaM))
         pylab.plot(z,rho,transform=trans)
         pylab.plot(z,irho,hold=True,transform=trans)
         pylab.plot(z,rhoM,hold=True,transform=trans)
         pylab.xlabel('depth (A)')
         pylab.ylabel('SLD (10^6 / A**2)')
         pylab.legend(['rho','irho','rhoM'])
         if (abs(thetaM-thetaM[0])>1e-3).any():
             ax = pylab.twinx()
             pylab.plot(z,thetaM,':k',hold=True,axes=ax,transform=trans)
             pylab.ylabel('magnetic angle (degrees)')
     else:
         z,rho,irho = self.step_profile()
         pylab.plot(z,rho,':g',z,irho,':b',transform=trans)
         z,rho,irho = self.smooth_profile()
         pylab.plot(z,rho,'-g',z,irho,'-b', hold=True,transform=trans)
         pylab.legend(['rho','irho'])
         pylab.xlabel('depth (A)')
         pylab.ylabel('SLD (10^6 / A**2)')
Пример #2
0
 def plot_profile(self, plot_shift=None):
     import pylab
     from bumps.plotutil import auto_shift
     plot_shift = plot_shift if plot_shift is not None else Experiment.profile_shift
     trans = auto_shift(plot_shift)
     if self.ismagnetic:
         z,rho,irho,rhoM,thetaM = self.magnetic_profile()
         #rhoM_net = rhoM*numpy.cos(numpy.radians(thetaM))
         pylab.plot(z,rho,transform=trans)
         pylab.plot(z,irho,hold=True,transform=trans)
         pylab.plot(z,rhoM,hold=True,transform=trans)
         pylab.xlabel('depth (A)')
         pylab.ylabel('SLD (10^6 / A**2)')
         pylab.legend(['rho','irho','rhoM'])
         if (abs(thetaM-thetaM[0])>1e-3).any():
             ax = pylab.twinx()
             pylab.plot(z,thetaM,':k',hold=True,axes=ax,transform=trans)
             pylab.ylabel('magnetic angle (degrees)')
     else:
         z,rho,irho = self.step_profile()
         pylab.plot(z,rho,':g',z,irho,':b',transform=trans)
         z,rho,irho = self.smooth_profile()
         pylab.plot(z,rho,'-g',z,irho,'-b', hold=True,transform=trans)
         pylab.legend(['rho','irho'])
         pylab.xlabel('depth (A)')
         pylab.ylabel('SLD (10^6 / A**2)')
Пример #3
0
    def plot_profile(self, plot_shift=0.):
        import pylab
        from bumps.plotutil import auto_shift

        trans = auto_shift(plot_shift)
        z, rho, irho = self.step_profile()
        pylab.plot(z, rho, '-g', z, irho, '-b', transform=trans)
        z, rho, irho = self.smooth_profile()
        pylab.plot(z, rho, ':g', z, irho, ':b', transform=trans)
        pylab.legend(['rho', 'irho'])
Пример #4
0
    def plot_profile(self, plot_shift=0.):
        import matplotlib.pyplot as plt
        from bumps.plotutil import auto_shift

        trans = auto_shift(plot_shift)
        z, rho, irho = self.step_profile()
        plt.plot(z, rho, '-g', z, irho, '-b', transform=trans)
        z, rho, irho = self.smooth_profile()
        plt.plot(z, rho, ':g', z, irho, ':b', transform=trans)
        plt.legend(['rho', 'irho'])
Пример #5
0
    def plot_profile(self, plot_shift=None):
        import matplotlib.pyplot as plt
        from bumps.plotutil import auto_shift

        plot_shift = plot_shift if plot_shift is not None else Experiment.profile_shift
        trans = auto_shift(plot_shift)
        if self.ismagnetic:
            if not self.step_interfaces:
                z, rho, irho, rhoM, thetaM = self.magnetic_step_profile()
                #rhoM_net = rhoM*np.cos(np.radians(thetaM))
                plt.plot(z, rho, ':g', transform=trans)
                plt.plot(z, irho, ':b', transform=trans)
                plt.plot(z, rhoM, ':r', transform=trans)
                if (abs(thetaM - DEFAULT_THETA_M) > 1e-3).any():
                    ax = plt.twinx()
                    plt.plot(z, thetaM, ':k', axes=ax, transform=trans)
                    plt.ylabel('magnetic angle (degrees)')
            z, rho, irho, rhoM, thetaM = self.magnetic_smooth_profile()
            #rhoM_net = rhoM*np.cos(np.radians(thetaM))
            handles = [
                plt.plot(z, rho, '-g', transform=trans, label='rho')[0],
                plt.plot(z, irho, '-b', transform=trans, label='irho')[0],
                plt.plot(z, rhoM, '-r', transform=trans, label='rhoM')[0],
            ]
            if (abs(thetaM - DEFAULT_THETA_M) > 1e-3).any():
                ax = plt.twinx()
                h = plt.plot(z,
                             thetaM,
                             '-k',
                             axes=ax,
                             transform=trans,
                             label='thetaM')
                handles.append(h[0])
                plt.ylabel('magnetic angle (degrees)')
            plt.xlabel('depth (A)')
            plt.ylabel('SLD (10^6 / A**2)')
            labels = [h.get_label() for h in handles]
            plt.legend(handles=handles, labels=labels)
        else:
            if not self.step_interfaces:
                z, rho, irho = self.step_profile()
                plt.plot(z, rho, ':g', z, irho, ':b', transform=trans)
            z, rho, irho = self.smooth_profile()
            plt.plot(z, rho, '-g', z, irho, '-b', transform=trans)
            plt.legend(['rho', 'irho'])
            plt.xlabel('depth (A)')
            plt.ylabel('SLD (10^6 / A**2)')