Ejemplo n.º 1
0
#from chronostar.error_ellipse import plot_cov_ellipse
import chronostar.traceback as traceback
import pickle

plt.ion()

times = np.linspace(0, 2, 3)
nts = len(times)
print(times)
bp = Table.read('data/betaPic.csv')
bp = bp[np.where([
    (n.find('6070') < 0) & (n.find('12545') < 0) & (n.find('Tel') < 0)
    for n in bp['Name']
])[0]]
bp = bp[1:3]
params = np.array(
    [bp['RAdeg'], bp['DEdeg'], bp['Plx'], bp['pmRA'], bp['pmDE'], bp['RV']])
p = np.transpose(params)

tb = traceback.TraceBack(bp)
tb.traceback(times, savefile="trial_save.pkl")
stars, times, xyzuvwb, xyzuvw_cov = pickle.load(open('trial_save.pkl'))
xyzuvwf = [traceback.traceforward((xyzuvwb[0])[nts - 1], times)]
for i in np.arange(1, len(bp)):
    newxyz = [traceback.traceforward((xyzuvwb[i])[nts - 1], times)]
    #x = np.flipud(x)
    xyzuvwf = np.concatenate((xyzuvwf, newxyz), axis=0)
print(xyzuvwb)
print(xyzuvwf)
print(p)
Ejemplo n.º 2
0
#Some hardwired plotting options.
if (dims[0] == 0) & (dims[1] == 1):
    #yoffset[0:10] = [6,-8,-6,2,0,-4,0,0,0,-4]
    #yoffset[10:] = [0,-8,0,0,6,-6,0,0,0]
    #xoffset[10:] = [0,-4,0,0,-15,-10,0,0,-20]
    axis_range = [-70, 60, -40, 120]

if (dims[0] == 1) & (dims[1] == 2):
    axis_range = [-40, 120, -30, 100]
    #text_ix = [0,1,4,7]
    #xoffset[7]=-15

times = np.linspace(0, max_time, n_times)

if trace_it_back:
    tb = traceback.TraceBack(t)
    tb.traceback(times,
                 xoffset=xoffset,
                 yoffset=yoffset,
                 axis_range=axis_range,
                 dims=dims,
                 plotit=False,
                 savefile="results/" + pklfile)

if fit_the_group:
    star_params = fit_group.read_stars("results/" + pklfile)

    beta_pic_group = np.array([ -0.908, 60.998, 27.105, -0.651,-11.470, -0.148, \
      8.055,  4.645,  8.221,  0.655,  0.792,  0.911,  0.843, 18.924])

    ol_swig = fit_group.lnprob_one_group(beta_pic_group,
Ejemplo n.º 3
0
#Which dimensions do we plot? 0=X, 1=Y, 2=Z
dims = [1,2]
dim1=dims[0]
dim2=dims[1]

if (dims[0]==0) & (dims[1]==1):
#    yoffset[0:10] = [6,-8,-6,2,0,-4,0,0,0,-4]
#    yoffset[10:] = [0,-8,0,0,6,-6,0,0,0]
#    xoffset[10:] = [0,-4,0,0,-15,-10,0,0,-20]
    axis_range = [-500,500,-500,500]

if (dims[0]==1) & (dims[1]==2):
    axis_range = [-500,500,-500,500]
    text_ix = [0,1,4,7]
#    xoffset[1]=-15 

#Trace back orbits with plotting enabled.
tb = traceback.TraceBack(stars)
tb.traceback(times,xoffset=xoffset, max_plot_error=150, yoffset=yoffset, axis_range=axis_range, dims=dims,plotit=True,savefile="results/traceback_save.pkl", plot_text=False)

#Centre of mass - Black line
plt_COM = traceback.traceback2(centre_pl,times)
plt.plot(plt_COM[:,dim1],plt_COM[:,dim2],'co')
#Simbad - Cyan line
plt_simbad = traceback.traceback2(pl_from_simbad,times)
plt.plot(plt_simbad[:,dim1],plt_simbad[:,dim2],'co')


plt.savefig('plot.png')
plt.show()
Ejemplo n.º 4
0
#This needs to be fixed! Vaguely correct below.
pl = crvad2[play.get_pl_loc2(crvad2)]
pl['HIP'].name = 'Name'
#Which times are we plotting?
times = np.linspace(0, 5, 11)
xoffset = np.zeros(len(pl))
yoffset = np.zeros(len(pl))
axis_range = [-500, 500, -500, 500]

#Which dimensions do we plot? 0=X, 1=Y, 2=Z
dims = [0, 1]
dim1 = dims[0]
dim2 = dims[1]

#Trace back orbits with plotting enabled.
tb = traceback.TraceBack(pl)
tb.traceback(times,
             xoffset=xoffset,
             yoffset=yoffset,
             axis_range=axis_range,
             dims=dims,
             plotit=True,
             savefile="results/traceback_save.pkl")

#Error ellipse for the association. This comes from "fit_group.py".
xyz_cov = np.array([[34.25840977, 35.33697325, 56.24666544],
                    [35.33697325, 46.18069795, 66.76389275],
                    [56.24666544, 66.76389275, 109.98883853]])
xyz = [-6.221, 63.288, 23.408]
cov_ix1 = [[dims[0], dims[1]], [dims[0], dims[1]]]
cov_ix2 = [[dims[0], dims[0]], [dims[1], dims[1]]]