import math import numpy as np import matplotlib.pyplot as plt import csv plt.style.use('_mpl-gallery-nogrid') onlyFinal = bool(input("Would you like to look at all the data? (alternative is only final data) (y/n)")=="n") if(not(onlyFinal)): toPng = bool(input("Would you like to simply convert to png? (y/n) ")=="y") stop = int(input("What is the final numerical index for the surface water files (usually 99 but sometimes 98)")) i=1 results = [] with open("currentWater1.csv") as csvfile: reader = csv.reader(csvfile, quoting=csv.QUOTE_NONNUMERIC) #change contents to floats for row in reader: # each row is a list results.append(row) X, Y = np.meshgrid(np.linspace(0, len(results[0])-1, len(results[0])), np.linspace(0, len(results)-1, len(results))) while(i<=stop): #import data from corresponding file if(i!=1): #by reusing array it saves time that would be used for allocating memory name = "currentWater%d.csv" % (i) with open(name) as csvfile: reader = csv.reader(csvfile, quoting=csv.QUOTE_NONNUMERIC) #change contents to floats a=0 for row in reader: # each row is a list results[a]=row a+=1 inspecting=True #preparing model Z = results min = np.amin(Z) max = np.amax(Z) maxI = -1 maxK = -1 f=0 while(f