Tb = Tk * (1.0 - exp(-tau)) return Tb, tau ## ## Main ## if __name__ == "__main__": # Some necessary imports from sparx import tasks, utils, inputs from glob import glob # Remove old files name = "uniform" if not utils.confirm_remove_files(glob("./%s.*"%name)): print "Aborted" exit() # Table header table = ['# %20s %20s %20s %20s %20s %20s %20s %20s %20s'%('Molec', 'Tau_S1D', 'Tau_S3D', 'Tau_Est', 'Tau_diff(%)', 'Tb_S1D(K)', 'Tb_S3D(K)', 'Tb_Est(K)', 'Tb_Diff(%)')] # Calculate image for different wavelengths for molec in 'o-h2o_2lev', 'co_2lev', 'hco+_2lev', 'sio_2lev', 'hnco_2lev': # Setup file names src1d = "%s.%s.src1d"%(name, molec) out1d = "%s.%s.xyv1d"%(name, molec) tau1d = "%s.%s.tau1d"%(name, molec) src3d = "%s.%s.src3d"%(name, molec) out3d = "%s.%s.xyv3d"%(name, molec) tau3d = "%s.%s.tau3d"%(name, molec)
Tb = Tk * tau return Tb, tau ## ## Main ## if __name__ == "__main__": # Some necessary imports from sparx import tasks, utils, inputs from glob import glob # Remove old files name = "uniform" if not utils.confirm_remove_files(glob("./%s.*" % name)): print "Aborted" exit() # Generate 1D model src1d = "%s1d.src" % (name) src3d = "%s3d.src" % (name) tasks.task_valdust1d(out=src1d) tasks.task_valdust3d(out=src3d) # Table header table = [ '# %20s %20s %20s %20s %20s %20s %20s %20s %20s' % ('Lambda(mm)', 'Tau_S1D', 'Tau_S3D', 'Tau_Est', 'Tau_Diff(%)', 'Tb_S1D(K)', 'Tb_S3D(K)', 'Tb_Est(K)', 'Tb_Diff(%)') ]
# NPROC NPROC = int(opts.nproc) # MAXITER MAXITER = int(opts.maxiter) # NDIV if opts.orig: NDIV = None else: NDIV = int(opts.ndiv) # Clear old files? if opts.clear: from glob import glob utils.confirm_remove_files(glob("./%s*"%NAME)) if opts.only1d: s3d_path = None else: s3d_path = "." ## ## Run validation ## # Calculate static problem if not opts.lvg_only: static = Static(NDIV, Xmol_LIST, opts.molec, tcmb=opts.tcmb, s1d_path=".", s3d_path=s3d_path) static.run(opts.exc_only, opts.nofig, opts.no_intermediate) # Calculate LVG problem