grep_post = ARGS.grep_post savefig = ARGS.savefig showfig = ARGS.showfig alpha = float(ARGS.alpha) stiple = ARGS.stiple if ARGS.developer_mode: print "\nRunning in dev mode. No files will be saved, no directories will be created, and all plots will be printed to the screen." savfig = False showfig = True ############# # Main code # ############# # Make the date array dates = camdates(start, end, months) # Read in each file, extract the local variable at the point and field variable on the globe, track them in a master array # Correlate the local variable 1-d array to each grid cell of the field variable array # Return the correlation coefficients bottom = lat - delta top = lat + delta left = lon - delta if left < 0: left += 360 right = lon + delta if right > 360: right -= 360 region = [bottom, top, left, right]
days = ARGS.days grep_pre = ARGS.grep_pre grep_post = ARGS.grep_post savefig = ARGS.savefig showfig = ARGS.showfig raw = ARGS.raw removeMeans = True if raw: removeMeans = False if ARGS.developer_mode: print "\nRunning in dev mode. No files will be saved, no directories will be created, and all plots will be printed to the screen." savfig = False showfig = True # Extract the dates dates = camdates(start, end, months, days) for n, date in enumerate(dates): # Find the file for this date cfull_path, cfname = findClimoFile( "*" + grep_pre + "*" + date + "*" + grep_post + "*", cdir) tfull_path, tfname = findClimoFile( "*" + grep_pre + "*" + date + "*" + grep_post + "*", tdir) if cfname != 0: print cfname if tfname != 0: print tfname # Open the file cnc = camgoda(cfull_path) tnc = camgoda(tfull_path) is3d, var, vname = cnc.ExtractData(variable, box)
elif ARGS.box is not None: box = [int(b) for b in ARGS.box] else: print "No region set! Defaulting to global" box = [-90, 90, 0, 360] print "Box array:" print box # Find the date array dates = [] h1 = ARGS.h1 # boolean months = [int(m) for m in ARGS.months] if ARGS.years is not None: y1, y2 = [int(y) for y in ARGS.years] dates = camdates(y1, y2, months, days=h1) else: y1 = y2 = 0 # Remove the years and leave only months and days if needed # Useful for *dailyClim* files dates = [x[5:] for x in camdates(y1, y2, months, days=h1)] print "Date array:" print dates savefig = ARGS.savefig showfig = ARGS.showfig variables = ARGS.variables mkdir = True if ARGS.developer_mode: print "\nRunning in dev mode. No files will be saved, no directories will be created, and all plots will be printed to the screen."