if len(sys.argv) == 1: parser.print_help() exit(1) args = parser.parse_args() if args.verbose: print("verbosity turned on") if not (os.path.isfile(args.file1)): print "File ", args.file1, " does not exist " exit(1) if not (os.path.isfile(args.file2)): print "File ", args.file2, " does not exist " exit(1) print('Reading ' + args.file1) mycube1 = load_cube.cube() mycube1.readfile(args.file1) print('Reading ' + args.file2) mycube2 = load_cube.cube() mycube2.readfile(args.file2) risu = mycube1 + mycube2 f = open(args.output_cubefile, "w") risu.dump(f) f.close()
if len(sys.argv) == 1: parser.print_help() exit(1) args = parser.parse_args() if args.verbose: print("verbosity turned on") if (args.axis != 'z' and args.axis != 'y' and args.axis != 'x'): args.axis = 'z' print( 'Problem with the axis definition, we set it to the default z value.') print('Reading...' + args.filefrag1) mycube = load_cube.cube() if not (os.path.isfile(args.filefrag1)): print "File ", args.filefrag1, " does not exist " exit(1) mycube.readfile(args.filefrag1) x, y, z = np.array(mycube.get_grid_xyz()) data = mycube.get_data() # This is for fixing the range of sampling point (info arises from the cube grid) nump = 10000 # Fix number of sampling points if (args.axis == 'z'):
type=str) parser.add_argument("-v", "--verbose", help="increase output verbosity", default=False, \ action="store_true") if len(sys.argv) == 1: parser.print_help() exit(1) args = parser.parse_args() if args.verbose: print("verbosity turned on") if not (os.path.isfile(args.file1)): print("File ", args.file1, " does not exist ") exit(1) factor = args.factor print(('Scale factort', factor)) print(('Reading ' + args.file1)) mycube1 = load_cube.cube() mycube1.readfile(args.file1) risu = mycube1 aa = risu.get_data() * factor risu.set_data(aa) f = open(args.output_cubefile, "w") risu.dump(f) f.close()
parser.print_help() exit(1) args = parser.parse_args() if args.verbose: print("verbosity turned on") if args.verbose: print('Reading...' + args.file[0]) if not (os.path.isfile(args.file[0])): print "File ", args.file[0], " does not exist " exit(1) totcube = load_cube.cube() totcube.readfile(args.file[0]) if args.verbose: print('Reading...' + args.file[1]) if not (os.path.isfile(args.file[1])): print "File ", args.file[1], " does not exist " exit(1) frag1cube = load_cube.cube() frag1cube.readfile(args.file[1]) if args.verbose: print('Reading...' + args.file[2])
exit(1) args = parser.parse_args() if args.verbose: print("verbosity turned on") if (args.axis != 'z' and args.axis != 'y' and args.axis != 'x'): args.axis = 'z' print('Problem with the axis definition, we set it to the default z value.') if not (os.path.isfile(args.file1)): print("File ", args.file1, " does not exist ") exit(1) cubeA = load_cube.cube(args.file1) if not (os.path.isfile(args.file2)): print("File ", args.file2, " does not exist ") exit(1) cubeB = load_cube.cube(args.file2) if args.verbose: print("Performing cubaA - cubeB") cube = cubeA - cubeB v = cube.cd(args.axis) vals = numpy.array(v)
required=False, type=str, default="diff.txt") if len(sys.argv) == 1: parser.print_help() exit(1) args = parser.parse_args() dr = float(args.deltar) if not (os.path.isfile(args.filea)): print "File ", args.filea, " does not exist " exit(1) print('Reading... ' + args.filea) acube = load_cube.cube() acube.readfile(args.filea) axis = args.axis angle = float(args.angle) if not (os.path.isfile(args.fileb)): print "File ", args.fileb, " does not exist " exit(1) center = [0.0, 0.0, 0.0] cs = args.center scs = cs.split(",") if len(scs) != 3: print "Error in center values"
default=False, action="store_true") if len(sys.argv) == 1: parser.print_help() exit(1) args = parser.parse_args() #print(args.file) #parser.print_help() #print(len(args.addcubes)) if args.verbose: print("verbosity turned on") print('Reading...' + args.file) totcube = load_cube.cube() if not (os.path.isfile(args.file)): print "File ", args.file, " does not exist " exit(1) totcube.readfile(args.file) center = [0.0, 0.0, 2.876163] r = [] rint = [] #print list(frange(0.0, 6.0, 0.2)) for rr in [0., 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2., \ 2.2, 2.4, 2.6, 2.8, 3., 3.2,3.4,3.6,3.8,4.,5., 6.]: radius = float(rr)
if len(sys.argv) == 1: parser.print_help() exit(1) args = parser.parse_args() if args.verbose: print("verbose turned on") print(('Reading...' + args.file)) if not (os.path.isfile(args.file)): print("File ", args.file, " does not exist ") exit(1) totcube = load_cube.cube() totcube.readfile(args.file) print(('Reading...' + args.filebader)) if not (os.path.isfile(args.filebader)): print("File ", args.filebader, " does not exist ") exit(1) badercube = load_cube.cube() badercube.readfile(args.filebader) dv = totcube.get_dx() * totcube.get_dy() * totcube.get_dz() s = 0.0 for i in range(totcube.get_nx()):