radius = get_radius(modelname, step) nodez = len(radius) #print radius ### slice the capfile for all layers ### for cap in range(12): capfile = get_capfile(modelname, cap, step) exist = 1 for layer in range(nodez): zfile = zslice.zslicefile(capfile, layer) exist = exist and os.path.isfile(zfile) if not exist: #print 'Creating zslice files' zslice.zslice(capfile) ### create great circle path ### gcproj = great_circle_proj() gcfile = 'circle.xyp' az_resolution = 0.5 command = 'project %(gcproj)s -G%(az_resolution)f > %(gcfile)s' % vars() os.system(command) ### create cross section along the great circle ### ## range of layers to plot botlayer = 0 toplayer = nodez - 1
step = int(sys.argv[3]) layer = int(sys.argv[4]) ## read model parameters infile = '%s.cap%02d.%d' % (modelname, 0, step) nodex, nodey, nodez = read_params(infile) ## slice the capfile(s), results saved in zfile import zslice all_zfiles = '' for cap in range(caps): capfile = '%s.cap%02d.%d' % (modelname, cap, step) zfile = zslice.zslicefile(capfile, layer) all_zfiles = all_zfiles + ' ' + zfile if not os.path.exists(zfile): zslice.zslice(capfile, layer) ####################################################################### # define GMT parameters ####################################################################### ## width of the plot mapwidth = 6.0 if caps == 1: ## find min/max of the coordinate xmin, xmax, ymin, ymax = find_minmax(zfile, nodex, nodey) bounds = '%f/%f/%f/%f' % (xmin, xmax, ymin, ymax) proj = 'M%f' % mapwidth resolution = '%f/%f' % ((xmax - xmin) / nodex, (ymax - ymin) / nodey) else:
### get radius ### radius = get_radius(modelname, step) nodez = len(radius) #print radius ### slice the capfile for all layers ### for cap in range(12): capfile = get_capfile(modelname, cap, step) exist = 1 for layer in range(nodez): zfile = zslice.zslicefile(capfile, layer) exist = exist and os.path.isfile(zfile) if not exist: #print 'Creating zslice files' zslice.zslice(capfile) ### create great circle path ### gcproj = great_circle_proj() gcfile = 'circle.xyp' az_resolution = 0.5 command = 'project %(gcproj)s -G%(az_resolution)f > %(gcfile)s' % vars() os.system(command) ### create cross section along the great circle ### ## range of layers to plot botlayer = 0 toplayer = nodez - 1 ## min/max values to truncate temperature field
layer = int(sys.argv[4]) ## read model parameters infile = '%s.cap%02d.%d' % (modelname, 0, step) nodex, nodey, nodez = read_params(infile) ## slice the capfile(s), results saved in zfile import zslice all_zfiles = '' for cap in range(caps): capfile = '%s.cap%02d.%d' % (modelname, cap, step) zfile = zslice.zslicefile(capfile, layer) all_zfiles = all_zfiles + ' ' + zfile if not os.path.exists(zfile): zslice.zslice(capfile, layer) ####################################################################### # define GMT parameters ####################################################################### ## width of the plot mapwidth = 6.0 if caps == 1: ## find min/max of the coordinate xmin, xmax, ymin, ymax = find_minmax(zfile, nodex, nodey) bounds = '%f/%f/%f/%f' % (xmin,xmax,ymin,ymax) proj = 'M%f' % mapwidth resolution = '%f/%f' % ( (xmax-xmin)/nodex, (ymax-ymin)/nodey )