예제 #1
0
파일: comm16.py 프로젝트: amerand/PRIMA
def analyse238_HD10360(reduceData=False, bootstrap=False):
    """
    astrometric fit
    """
    files = files_238_10360
    if reduceData:
        for f in files:
            a = prima.drs(data_directory+f)
            print '#'*5, f, '#'*12
            a.astrometryFtk(max_err_um=2.0, max_GD_um=3.0, sigma_clipping=4.0,
                            writeOut=True, overwrite=True, max_length_s=1.0)
            del a
            a=[]

    selection = range(len(files))
    #selection = [0,1,2,3,5]
    #selection = [1,3,5]
    if bootstrap:
        files = [files[k] for k in selection]
        astrom.bootstrapListOfFiles(files, data_directory, N=500,
                                    fit_param  =[1,    1,    1], plot=True,
                                    first_guess=[6.0, 200.0,-3.92104])
    else:
        res = astrom.interpListOfFiles(files, data_directory,
                                       plot=True,quiet=False,
                                       fit_param  =[1,    1,    1],
                                       first_guess=[6.0, 200.0,-3.92104],
                                       fit_only_files=selection,
                                       maxResiduals=5)
    return
예제 #2
0
파일: comm16.py 프로젝트: amerand/PRIMA
def analyse236_HD202730(reduceData=False, bootstrap=False):
    """
    astrometric fit
    """
    files = files_236
    if reduceData:
        for f in files:
            print '#'*5, f, '#'*12
            a = prima.drs(data_directory+f)
            a.astrometryFtk(max_err_um=5, max_GD_um=3.0, sigma_clipping=3.0,
                            writeOut=True, overwrite=True, max_length_s=1.0)
            del a
            if f == '2011-08-23/PACMAN_OBJ_ASTRO_236_0007.fits':
                tmp=pyfits.open(data_directory+\
                               '/2011-08-23/PACMAN_OBJ_ASTRO_236_0007_RED.fits',
                               mode='update')
                tmp[0].header.update('HIERARCH ESO INS MODE', 'SWAPPED')
                tmp.flush()
                tmp.close()

    selection = range(len(files))
    #selection = [0,1,4,5,8,9]
    if bootstrap:
        files = [files[k] for k in selection]
        astrom.bootstrapListOfFiles(files, data_directory, N=500,
                                    fit_param  =[1,    1,    1], plot=True,
                                    first_guess=[6.0, 200.0,-3.92104],
                                    maxResidualsMas=20, multi=True)
    else:
        astrom.interpListOfFiles(files, data_directory,
                                 plot=True,
                                 fit_param  =[1,    1,    1],
                                 first_guess=[6.0, 200.0,1.0],
                                 fit_only_files=selection, maxResiduals=20 )
    return
예제 #3
0
파일: comm16.py 프로젝트: amerand/PRIMA
def analyse241_HD10268(reduceData=False, bootstrap=False):
    """
    astrometric fit
    """
    files = files_241_HD10268
    if reduceData:
        for f in files:
            print '#'*5, f, '#'*12
            a = prima.drs(data_directory+f)
            a.astrometryFtk(max_err_um=5, max_GD_um=3.0, sigma_clipping=4.0,
                            writeOut=True, overwrite=True, max_length_s=1.0)
            del a
    selection = range(len(files))
    selection=[0,1,2,4,5,6]
    if bootstrap:
        files = [files[k] for k in selection]
        res = astrom.bootstrapListOfFiles(files, data_directory, N=500,
                                          fit_param  =[1,    1,    1],
                                          plot=True,
                                          first_guess=[6.0, 200.0,-3.92104],
                                          maxResidualsMas=30, multi=True)
    else:
        astrom.interpListOfFiles(files, data_directory,
                                 plot=True,
                                 fit_param  =[1,    1,    1],
                                 first_guess=[6.0, 200.0,1.0],
                                 fit_only_files=selection,maxResiduals=20)
        res = []
    return res
예제 #4
0
파일: comm16.py 프로젝트: amerand/PRIMA
def doAll(files, directory=data_directory, reduceData=False, bootstrap=False,
          selection=None, maxResiduals=None, firstGuess=[10.,90., 0.0],
          fittedParam=[1,1,1], res2fits=False):
    """
    astrometric fit
    """
    # -- data reduction
    if reduceData:
        for f in files:
            print '#'*5, f, '#'*12
            a = prima.drs(data_directory+f)
            a.astrometryFtk(max_err_um=3, max_GD_um=5.0, sigma_clipping=4.0,
                            writeOut=True, overwrite=True, max_length_s=1.0)
            a.raw.close()
            del a
            # correct a bug in this particular file
            if f == '2011-08-23/PACMAN_OBJ_ASTRO_236_0007.fits':
                tmp=pyfits.open(data_directory+\
                               '/2011-08-23/PACMAN_OBJ_ASTRO_236_0007_RED.fits',
                                mode='update')
                tmp[0].header.update('HIERARCH ESO INS MODE', 'SWAPPED')
                tmp.flush()
                tmp.close()

    # -- data fitting
    if selection is None:
        selection = range(len(files))
    if bootstrap:
        files = [files[k] for k in selection]
        t0 = time.time()
        res = astrom.bootstrapListOfFiles(files, data_directory, N=500,
                                          fit_param  =fittedParam, plot=True,
                                          first_guess=firstGuess,
                                          maxResidualsMas=maxResiduals,
                                          multi=True)
        print 'bootstraping performed in', round(time.time()-t0, 1), 's'
    else:
        astrom.interpListOfFiles(files, data_directory,
                                 plot=True, quiet=False,
                                 fit_param  = fittedParam,
                                 first_guess= firstGuess,
                                 fit_only_files=selection,
                                 maxResiduals=maxResiduals, res2fits=res2fits)
        res = []
    return