Ejemplo n.º 1
0
        import select_run as sr
        timestamp, basename = sr.run(options.investigate, options.case, options.latest)
        options.timestamps=[timestamp]
    else:
        import gi_base as gb
        basepath = gb.get_basepath()
        basename = os.path.abspath(basepath+'DT'+options.investigate+'/'+str(options.case))+'/'

    # use last timestamp for sample gp
    import import_path as ip
    tt = options.timestamps[-1]
    ip.insert_sys_path(basename+tt+'/programs/')
    ip.insert_sys_path(basename+tt+'/programs/sphere')
    import gi_params as gip
    gp = gip.Params(tt)
    gp.pops = sr.get_pops(basename+tt+'/')

    # find minimum number of iterations for all runs
    minlinelen = 1e99
    #import gi_collection as gc
    for tt in options.timestamps:
        linelen = 0
        with open(basename+tt+'/pc2.save', 'rb') as fi:
            dum = pickle.load(fi) # dummy variable
            try:
                while True:
                    linelen += 1
                    MODEL = pickle.load(fi)
            except EOFError:
                pass
        print('linelen = ',linelen)
Ejemplo n.º 2
0

## \fn pcload_single_entries(bn, gp)
# load all data into [chi^2, profiles] pairs, and add to a profile collection
# @param bn string
# @param gp global parameters

import import_path as ip
ip.insert_sys_path(basedir + 'programs/')
ip.insert_sys_path(basedir + 'programs/sphere')
import gi_params as ngip
ngp = ngip.Params(tt)
print(ngp)
print('ngp.rinfty = ', ngp.rinfty)
import select_run as sr
ngp.pops = sr.get_pops(basedir)
print('working with ', ngp.pops, ' populations')
prepare_output_folder(basedir)

# check whether we need to read in ngp.dat, or whether we are plotting from inside gravimage main program
if len(ngp.dat.Sig) == 0:
    import gi_file as glf
    ngp.dat = glf.get_binned_data(ngp)
read_scale(ngp)  # store half-light radii in  gp.Xscale
import gi_helper as gh
Radii, Binmin, Binmax, Sigdat1, Sigerr1 = gh.readcol5(ngp.files.Sigfiles[0])
# [Xscale0], [Munit/Xscale0^2]
# verified that indeed the stored files in the run directory are used
ngp.xipol = Radii * ngp.Xscale[0]  # [pc]
maxR = max(Radii)  # [pc]
minR = min(Radii)  # [pc]
Ejemplo n.º 3
0
    print("")
    return pc
## \fn pcload_single_entries(bn, gp)
# load all data into [chi^2, profiles] pairs, and add to a profile collection
# @param bn string
# @param gp global parameters

import import_path as ip
ip.insert_sys_path(basedir+'programs/')
ip.insert_sys_path(basedir+'programs/sphere')
import gi_params as ngip
ngp = ngip.Params(tt)
print(ngp)
print('ngp.rinfty = ',ngp.rinfty)
import select_run as sr
ngp.pops = sr.get_pops(basedir)
print('working with ', ngp.pops, ' populations')
prepare_output_folder(basedir)

# check whether we need to read in ngp.dat, or whether we are plotting from inside gravimage main program
if len(ngp.dat.Sig) == 0:
    import gi_file as glf
    ngp.dat = glf.get_binned_data(ngp)
read_scale(ngp) # store half-light radii in  gp.Xscale
import gi_helper as gh
Radii, Binmin, Binmax, Sigdat1, Sigerr1 = gh.readcol5(ngp.files.Sigfiles[0])
# [Xscale0], [Munit/Xscale0^2]
# verified that indeed the stored files in the run directory are used
ngp.xipol = Radii * ngp.Xscale[0]       # [pc]
maxR = max(Radii)                     # [pc]
minR = min(Radii)                     # [pc]