コード例 #1
0
ファイル: mcsnr_alchemy.py プロジェクト: wkerzendorf/mcsnr
 def plot_vrad_chi2(self, fig):
     fig.clf()
     ax = fig.add_subplot(111)
     ax.plot(self.v_rads, self.v_rad_grid)
     ax.set_xlabel('v_rad [km/s]')
     ax.set_ylabel('Chi2')
     ax.axvline(self.v_rad, color='red', linewidth=2)
     ax.set_title('v_rad = %.2f' % self.v_rad)
コード例 #2
0
    def plot_slip(self, p):
        slip = self.slip_field.subfields[1]
        xdata = slip.vtk_X[:, 0]
        ydata = slip.field_arr[:, 0]
        idata = argsort(xdata)
        ymax = max(ydata)
        p.plot(xdata[idata], ydata[idata], 'ro-')

        p.set_xlabel('bar axis [mm]')
        p.set_ylabel('slip [N/m]')
コード例 #3
0
    def plot_shear_flow(self, p):
        shear_flow = self.shear_flow_field.subfields[1]
        xdata = shear_flow.vtk_X[:, 0]
        ydata = shear_flow.field_arr[:, 0] / self.P_f
        idata = argsort(xdata)
        ymax = max(ydata)
        p.plot(xdata[idata], ydata[idata], 'o-')

        p.set_xlabel('bar axis [mm]')
        p.set_ylabel('shear flow [N/m]')
コード例 #4
0
    def plot_slip(self, p):
        slip = self.slip_field.subfields[1]
        xdata = slip.vtk_X[:, 0]
        ydata = slip.field_arr[:, 0]
        idata = argsort(xdata)
        ymax = max(ydata)
        p.plot(xdata[idata], ydata[idata], "ro-")

        p.set_xlabel("bar axis [mm]")
        p.set_ylabel("slip [N/m]")
コード例 #5
0
    def plot_shear_flow(self, p):
        shear_flow = self.shear_flow_field.subfields[1]
        xdata = shear_flow.vtk_X[:, 0]
        ydata = shear_flow.field_arr[:, 0] / self.P_f
        idata = argsort(xdata)
        ymax = max(ydata)
        p.plot(xdata[idata], ydata[idata], "o-")

        p.set_xlabel("bar axis [mm]")
        p.set_ylabel("shear flow [N/m]")
コード例 #6
0
    def plot_sig_eps(self, p):
        p.set_xlabel("control displacement [mm]")
        p.set_ylabel("stress [MPa]")

        self.sig_eps_m.refresh()
        self.sig_eps_m.trace.plot(p, "o-")

        self.sig_eps_f.refresh()
        self.sig_eps_f.trace.plot(p, "o-")

        p.plot(self.sig_eps_m.trace.xdata, self.sig_eps_m.trace.ydata + self.sig_eps_f.trace.ydata, "o-")
コード例 #7
0
    def plot_omega(self, p):
        omega_m = self.omega_m_field.subfields[0]
        xdata = omega_m.vtk_X[:, 0]
        ydata = omega_m.field_arr[:]
        idata = argsort(xdata)
        p.fill(xdata[idata], ydata[idata], facecolor='gray', alpha=0.2)

        print 'max omega', max(ydata[idata])

        p.set_ylim(ymin=0, ymax=1.0)
        p.set_xlabel('bar axis [mm]')
        p.set_ylabel('omega [-]')
コード例 #8
0
    def plot_sig_eps(self, p):
        p.set_xlabel('control displacement [mm]')
        p.set_ylabel('stress [MPa]')

        self.sig_eps_m.refresh()
        self.sig_eps_m.trace.plot(p, 'o-')

        self.sig_eps_f.refresh()
        self.sig_eps_f.trace.plot(p, 'o-')

        p.plot(self.sig_eps_m.trace.xdata,
               self.sig_eps_m.trace.ydata + self.sig_eps_f.trace.ydata, 'o-')
コード例 #9
0
    def plot_omega(self, p):
        omega_m = self.omega_m_field.subfields[0]
        xdata = omega_m.vtk_X[:, 0]
        ydata = omega_m.field_arr[:]
        idata = argsort(xdata)
        p.fill(xdata[idata], ydata[idata], facecolor="gray", alpha=0.2)

        print "max omega", max(ydata[idata])

        p.set_ylim(ymin=0, ymax=1.0)
        p.set_xlabel("bar axis [mm]")
        p.set_ylabel("omega [-]")
コード例 #10
0
    def plot_sig_eps( self, p ):
        p.set_xlabel( 'control displacement [mm]' )
        p.set_ylabel( 'stress [MPa]' )

        self.sig_eps_m.refresh()
        self.sig_eps_m.trace.plot( p, 'o-' )

        self.sig_eps_f.refresh()
        self.sig_eps_f.trace.plot( p, 'o-' )

        p.plot( self.sig_eps_m.trace.xdata,
                self.sig_eps_m.trace.ydata + self.sig_eps_f.trace.ydata, 'o-' )
コード例 #11
0
ファイル: mcsnr_alchemy.py プロジェクト: wkerzendorf/mcsnr
 def plot_teff_logg(self, fig):
     fig.clf()
     ax = fig.add_subplot(111)
     #grid = ax.imshow(self.teff_logg_grid.transpose(),  aspect='auto', extent=(self.teffs.min(), self.teffs.max(), self.loggs.min(), self.loggs.max()))
     #fig.colorbar(grid)
     ax.set_xlabel('Teff')
     ax.set_ylabel('log(g)')
     X, Y = np.meshgrid(self.teffs, self.loggs)
     contours = ax.contourf(X, Y, self.teff_logg_grid)
     fig.colorbar(contours)
     ax.plot([self.teff], [self.logg], 'rx', mew=3, ms=20, label='polyfit')
     ax.plot([self.teff_min], [self.logg_min], 'gx', mew=3, ms=20, label='min')
     ax.set_title('teff = %.2f teff_min = %.2f logg = %.2f logg_min = %.2f' %
                  (self.teff, self.teff_min, self.logg, self.logg_min))
     ax.legend(numpoints=1)
コード例 #12
0
    def plot_eps(self, p):
        eps_m = self.eps_m_field.subfields[0]
        xdata = eps_m.vtk_X[:, 0]
        ydata = eps_m.field_arr[:, 0, 0]
        idata = argsort(xdata)
        p.plot(xdata[idata], ydata[idata], 'o-')

        eps_f = self.eps_f_field.subfields[1]
        xdata = eps_f.vtk_X[:, 0]
        ydata = eps_f.field_arr[:, 0, 0]
        idata = argsort(xdata)
        p.plot(xdata[idata], ydata[idata], 'o-')

        p.set_ylim(ymin=0)
        p.set_xlabel('bar axis [mm]')
        p.set_ylabel('strain [-]')
コード例 #13
0
    def plot_eps(self, p):
        eps_m = self.eps_m_field.subfields[0]
        xdata = eps_m.vtk_X[:, 0]
        ydata = eps_m.field_arr[:, 0, 0]
        idata = argsort(xdata)
        p.plot(xdata[idata], ydata[idata], "o-")

        eps_f = self.eps_f_field.subfields[1]
        xdata = eps_f.vtk_X[:, 0]
        ydata = eps_f.field_arr[:, 0, 0]
        idata = argsort(xdata)
        p.plot(xdata[idata], ydata[idata], "o-")

        p.set_ylim(ymin=0)
        p.set_xlabel("bar axis [mm]")
        p.set_ylabel("strain [-]")
コード例 #14
0
    def plot_sig(self, p):
        sig_m = self.sig_m_field.subfields[0]
        xdata = sig_m.vtk_X[:, 0]
        ydata = sig_m.field_arr[:, 0, 0]
        idata = argsort(xdata)
        ymax = max(ydata)
        p.plot(xdata[idata], ydata[idata], 'o-')

        sig_f = self.sig_f_field.subfields[1]
        xdata = sig_f.vtk_X[:, 0]
        ydata = sig_f.field_arr[:, 0, 0]
        idata = argsort(xdata)
        p.plot(xdata[idata], ydata[idata], 'o-')

        xdata = sig_f.vtk_X[:, 0]
        ydata = sig_f.field_arr[:, 0, 0] + sig_m.field_arr[:, 0, 0]
        p.plot(xdata[idata], ydata[idata], 'ro-')

        p.set_ylim(ymin=0)  # , ymax = 1.2 * ymax )
        p.set_xlabel('bar axis [mm]')
        p.set_ylabel('stress [MPa]')
コード例 #15
0
    def plot_sig(self, p):
        sig_m = self.sig_m_field.subfields[0]
        xdata = sig_m.vtk_X[:, 0]
        ydata = sig_m.field_arr[:, 0, 0]
        idata = argsort(xdata)
        ymax = max(ydata)
        p.plot(xdata[idata], ydata[idata], "o-")

        sig_f = self.sig_f_field.subfields[1]
        xdata = sig_f.vtk_X[:, 0]
        ydata = sig_f.field_arr[:, 0, 0]
        idata = argsort(xdata)
        p.plot(xdata[idata], ydata[idata], "o-")

        xdata = sig_f.vtk_X[:, 0]
        ydata = sig_f.field_arr[:, 0, 0] + sig_m.field_arr[:, 0, 0]
        p.plot(xdata[idata], ydata[idata], "ro-")

        p.set_ylim(ymin=0)  # , ymax = 1.2 * ymax )
        p.set_xlabel("bar axis [mm]")
        p.set_ylabel("stress [MPa]")
コード例 #16
0
ファイル: prf.py プロジェクト: Li-Yangyang/K2_Centroid_Test
             Y,
             rv.pdf(pos),
             offset=0.15,
             level=[0.069182369442786328, 0.069182369442786329])
ax1.axes.errorbar(centroid_off_x,
                  centroid_off_y,
                  xerr=std[0],
                  yerr=std[1],
                  marker='+',
                  color='green')
ax1.scatter(centroid_off_x, centroid_off_y, marker='X', color='white', s=150)
ax1.scatter(0, 0, marker='*', color='red', s=150)
ax1.set_xlim(xmin=-5, xmax=5)
ax1.set_ylim(ymin=-5, ymax=5)
ax1.set_title('Offset Relative to Out of Transit Centroid', fontweight=1000)
ax1.set_xlabel('RA Offset (arcsec)', fontweight=1000)
ax1.set_ylabel('Dec Offset (arcsec)', fontweight=1000)
fig1.savefig("Centroid_Offset1.eps", format='eps')
fig2 = plt.figure(figsize=(14, 10))
plt.scatter((x1_ - x0_) * np.cos(y0_ * np.pi / 180.0) * 3600,
            (y1_ - y0_) * 3600,
            marker='X',
            color='purple',
            s=150)
plt.scatter(0, 0, marker='*', color='red', s=150)
plt.set_xlim(xmin=-1, xmax=1)
plt.set_ylim(ymin=-1, ymax=1)
plt.set_title('Offset Relative to K2 Position', fontweight=1000)
plt.set_xlabel('RA Offset (arcsec)', fontweight=1000)
plt.set_ylabel('Dec Offset (arcsec)', fontweight=1000)
fig2.savefig("Centroid_Offset2.eps", format='eps')