def RunRadDiel(sample_id, rad_res, diel_res, numbands, N_part): rad_min = 0.0 rad_max = 0.5 dielBack = 10.0 diel_min = 1.0 diel_max = 1.0 print 'creating scripts for radius resolution {:d} and dielectric resolution {:d}'.format(rad_res, diel_res) [N, n_s, n_c, r_c, coords] = mht.read(sample_id) list_rad = mht.MakeRad(n_s, rad_res, rad_min, rad_max) list_dielCyl = mht.MakeDiel(n_s, diel_res, diel_min, diel_max, dielBack) fout_qsub = './dat/{0}/{0}_qsub.sh'.format(sample_id) mht.ensure_dir(fout_qsub) with open(fout_qsub,'w') as f: f.write('#!/bin/sh\n') for rad in list_rad: for dielCyl in list_dielCyl: cmd = scripts.Create(sample_id, n_s, rad, dielBack, dielCyl, N, n_c, coords, N_part, numbands) f.write(cmd)
def GetConfig(): fout = './dat/' + sample_id + '/log/' + sample_id + '.log' mht.ensure_dir(fout) cmd = code_pack + ' < ' + filenames.params + ' | tee ' + fout os.system(cmd) shutil.move(out_pack, filenames.centers) shutil.move(out_pack2, filenames.centers2)
def SaveParams(): mht.ensure_dir(filenames.params) args = ([num_species, num_stagegrowth, num_stagerelax] + num_cells + radii + [growthrate, transmod, start_quench, start_config, num_MC, len_cell]) with open(filenames.params, 'w') as fout: for var in args: fout.write(str(var)+'\n') fout.close()