예제 #1
0
파일: comm17pup.py 프로젝트: amerand/PRIMA
def bootstrapHD103060():
    global pup
    HD10360corr = []
    HD10360 = []
    for k, f in enumerate(files_hd10360):
        print k+1, '/', len(files_hd10360)
        HD10360corr.append(astromNew.bootstrapListOfFiles(f, data_directory,
                                 firstGuess={'SEP':8., 'PA':135, 'M0':-0.03,
                                             'AT4 a_2':pup['BEST']['AT4 a_2'],
                                          'AT4 phi_2':pup['BEST']['AT4 phi_2']},
                                     doNotFit=['AT4 phi_2', 'AT4 a_2'], N=100))
        HD10360.append(astromNew.bootstrapListOfFiles(f, data_directory, N=100,
                              firstGuess={'SEP':8., 'PA':135, 'M0':-0.03}))

    pyplot.figure(10)
    pyplot.clf()
    pyplot.axes().set_aspect('equal', 'datalim')
    th = np.linspace(0, 2*np.pi, 100)
    colors=['r', 'g', 'b', 'y', 'm', 'c']
    for k,d in enumerate(HD10360corr):
        ### observation:
        pyplot.plot(d['RA_mas']/1000., d['DEC_mas']/1000., '+'+colors[k],
                markersize=12)
        pyplot.plot(d['RA_mas']/1000.+
                    d['errs_uas'][0]*d['PCA'][0][1]*np.cos(th)/1e6+
                    d['errs_uas'][1]*d['PCA'][0][0]*np.sin(th)/1e6,
                    d['DEC_mas']/1000.+
                    -d['errs_uas'][1]*d['PCA'][0][1]*np.sin(th)/1e6+
                    d['errs_uas'][0]*d['PCA'][0][0]*np.cos(th)/1e6,
                    color=colors[k], linewidth=3, alpha=0.5)
    for k,d in enumerate(HD10360):
        ### observation:
        pyplot.plot(d['RA_mas']/1000., d['DEC_mas']/1000., '.'+colors[k],
                markersize=8)
        pyplot.plot(d['RA_mas']/1000.+
                    d['errs_uas'][0]*d['PCA'][0][1]*np.cos(th)/1e6+
                    d['errs_uas'][1]*d['PCA'][0][0]*np.sin(th)/1e6,
                    d['DEC_mas']/1000.+
                    -d['errs_uas'][1]*d['PCA'][0][1]*np.sin(th)/1e6+
                    d['errs_uas'][0]*d['PCA'][0][0]*np.cos(th)/1e6,
                    color=colors[k], linewidth=3, alpha=0.5)

    return
예제 #2
0
파일: comm17naco.py 프로젝트: amerand/PRIMA
def bootstrapHD10360(N=100, ATPUP_scale=1.0, plot=False):
    """
    bootstraping. ATPUP_scale=0.0 sets the pupil correction to 0. N is
    the number of bootstrapping iteration.
    """
    t0 = time.time()
    fgNACO['ATPUP scale'] = ATPUP_scale
    b = astromNew.bootstrapListOfFiles(files_hd10360_NACO,
                                       directory=data_directory,
                                       firstGuess=fgNACO,
                                       doNotFit=['AT3', 'AT4', 'ATPUP scale'],
                                       plot=plot, N=N)
    print 'done in', round(time.time()-t0,2), \
          's (', round((time.time()-t0)/float(N), 2),\
          's per iteration)'
    if plot:
        t = np.linspace(0, 2*np.pi, 100)
        pyplot.plot(naco['Delta RA cos(DEC)'], naco['Delta DEC'],
                    '*r', label='NACO position')
        pyplot.plot(naco['Delta RA cos(DEC)']+np.cos(t)*13e-3,
                    naco['Delta DEC']+np.sin(t)*13e-3, 'r',
                    label='13mas circle')
        pyplot.legend(numpoints=1)
    return b