parser.add_argument('-r','--run',type=str,choices=['north','south'],required=True,help='Run?') opt = parser.parse_args() if opt.run == 'north': import settings_north as settings else: import settings_south as settings runcat = RunCatalog.from_list(settings.runlist_fn) with TaskManager(ntasks=ntasks) as tm: for run in tm.iterate(runcat): legacypipe_fn = find_file(base_dir=settings.legacypipe_output_dir,filetype='tractor',source='legacypipe',brickname=run.brickname) command = [] for stage,versions in run.stages.items(): pythonpath = 'PYTHONPATH=%s' % get_pythonpath(module_dir='/src/',versions=versions,full=True,as_string=True) command += [pythonpath] command += ['python',runbrick.__file__] command += ['--brick',run.brickname,'--threads',threads,'--outdir',settings.output_dir,'--run',settings.run, '--injected-fn',settings.injected_fn,'--fileid',run.fileid,'--rowstart',run.rowstart,'--skipid',run.skipid, '--sim-blobs','--sim-stamp','tractor','--add-sim-noise','poisson','--no-wise', #'--sim-blobs','--sim-stamp','tractor','--no-wise', '--skip-calibs','--write-stage',stage,'--write-log','--ps','--ps-t0',int(time.time()),'--stage',stage, '--env-header',legacypipe_fn,';'] #print(command) output = run_shell(command[:-1]) print(output)
for run in tm.iterate(runcat): legacypipe_fn = find_file(base_dir=settings.legacypipe_output_dir, filetype='tractor', source='legacypipe', brickname=run.brickname) command = [] for stage, versions in run.stages.items(): environment = EnvironmentManager(fn=legacypipe_fn) command = [ '%s=%s' % (key, val) for key, val in environment.environ.items() ] pythonpath = get_pythonpath(module_dir='/src/', versions=versions, full=True, as_string=False) command += ['PYTHONPATH=%s' % ':'.join(pythonpath)] command += [ 'python', os.path.join(pythonpath[0], 'legacypipe', 'runbrick.py') ] command += [ '--brick', run.brickname, '--threads', threads, '--outdir', settings.output_dir, '--run', settings.run, '--no-wise', '--no-write', '--stage', stage, ';' ] #command += ['--brick',run.brickname,'--threads',threads,'--outdir',settings.output_dir,'--run',settings.run, # '--no-wise','--no-write','--stage',stage,'--skip','--skip-calibs',';'] output = run_shell(command[:-1])