Exemplo n.º 1
0
# read in or create the ring system tau and radii

print 'Reading in disk parameters from %s' % fitsin_disk
(res, taun_ringsxx, rad_ringsxx, dstar) = exorings.read_ring_fits(fitsin_disk)

# make the radius and projected gradient for the measured gradient points
(ring_disk_fit, grad_disk_fit) = \
    exorings.make_ring_grad_line(grad_time, res[0], res[1], res[2], res[3])

# produce fine grained gradient and ring values
samp_t = np.arange(-100, 100, 0.001) + 54222.
(samp_r, samp_g) = exorings.make_ring_grad_line(samp_t, res[0], res[1], res[2],
                                                res[3])
hjd_minr = samp_t[np.argmin(samp_g)]

exorings.print_disk_parameters(res, hjd_minr, samp_r)

# plotting fit of gradients from ellipse curve to J1407 gradients

plt.rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})
plt.rc('text', usetex=True)

figfit = plt.figure(figsize=(10, 6))
f2 = figfit.add_subplot(111)

f2.set_ylim([0, 1.1 * np.max(grad_mag)])
f2.set_xlim([np.min(samp_t), np.max(samp_t)])

plot_gradient_fit(grad_time, grad_disk_fit * np.max(grad_mag), grad_mag, \
    samp_t, samp_g*np.max(grad_mag), f2)
(ring_disk_fit, grad_disk_fit) = exorings.ring_grad_line(grad_time, res[0], res[1], res[2], res[3])

# produce fine grained gradient and ring values
samp_t = np.arange(-100, 100, 0.001) + 54222.
(samp_r, samp_g) = exorings.ring_grad_line(samp_t, res[0], res[1], res[2], res[3])
hjd_minr = samp_t[np.argmin(samp_g)]

# times when there is no photometry
(rstart, rend) = exorings.ring_mask_no_photometry(kern, dstar, time, res[0], res[1], res[2], res[3])

rmask = (rstart < 40)
rstart = rstart[rmask]
rend = rend[rmask]

# print disk parameters
exorings.print_disk_parameters(res, hjd_minr, samp_r)

# smoothed curve useful for animation tracking
splfunc = UnivariateSpline(time, flux, s=5)

# make the plots
ringcolor = 'orange'
bgndcolor = 'black'

fig_ringsv = plt.figure('ringsv', figsize=(10, 7))

fig_ringsv.patch.set_facecolor(bgndcolor)

p1v = plt.axes([0.0, 0.3, 1.0, 0.7], axisbg=bgndcolor)
#p1v.axis('scaled')
# why am I not using this 'scaled' to make the rings have the correct