numpy - Plot really big file in python (5GB) with x axis offset -


I am trying to plot a huge file (~ 5GB) using Python and Metaplib. I am able to load the entire file in memory (there is a total of 16 GB available in the machine), but when I conspired by using simple eyeshov, then I get a split mistake. This is most probable for the upside, which I have set up to 15000 but I can not set the higher I have come to the conclusion that I have to sort my array in batches and therefore have made a simple code to do this. My main purpose is that when I plot a batch of large arrays, the X coordinate starts from 0 always and there is no way that I can overlay the images to make a last big one. Please tell me if you have any suggestions, besides this, I am not able to install new packages like "image" on this machine due to administrative rights. Here is a sample code that reads the first 12 rows of my array and creates 3 plots. Import Import Import SP Import SPP import as sapy import plt import pickle DEF readalllines (file1, rows, freqs) as imported plat ) Import pylab as imported * Import PP Import fileinput from matplotlib.pylab Import from * scipy.fftpack * Import from fftpack to import * Optparse from optionParser as matplotlib.cm: file = range (rows * freqs) = I = 0 q = np.zeros (size, 'float') = open (file1, 'r') sizer = int (rows * freqs): s = fil E.readline () s = S.split () # print [4], q [i] q [i] = float (s [4]) if i% 262144 == 0: print '\ r', int ( I * 100.0 / (337 * 262144), 'full percent', I + = file.close () return q parser = OptionParser () parser.add_option ('- f', dest = "filename", help = " Read the dynamic spectrum from the file Parser.add_option ('- n', parser.add_option ('-t', dest = "dtime", help = "time integration used in seconds, default 10", default = 10) Destination = "D freq", help = "each frequency channel in Hz", default = 11.92092896) parser.add_option ('- w', destination = "reducing bandwidth", help = "variable Chuncker divider in frequency channels, integer default 16 ", default = 16) (does not, args) = parser.parse_args () rows = 12 freqs = 262,144 file1 = opts.filename S = readalllines (file1, rows, freqs) S = Np.reshape (s, (rows, freqs)) s = tribe print s.shape #raw_input () #s_shift = scipy.fftpack.fftshift (s) #fig = plt.figure () # fig.patch.set_alpha (0.0) ) #axes = plt.axes () #axes Patch.set_lafa (0.0) ### plt.ylim (0,8) plt.ion (o) = 0 (0, rows, 4) for the o in the category: fig = plt.figure () # plt.clf ( (O [4, rows, 0, freqs]) fdf, fdff = xticks () print fdf xticks (fdf + o) print xticks () #axis ([o, o + 4,0, freqs]) plt.draw () #W, h = fig.canvas.get_width_height () #buf = np.fromstring (fig.canvas.tostring_argb (), dtype = np.uint8) # buf.shape = (w, h, 4) #buf = Np.rol (buf, 3, axis = 2) # w, h, _ = buf.shape #img = Im age.fromstring ("RGBA", (w, h), buf.tostring ()) #if prev: # Prev.paste (img) # del prev #prev = img i + = 1 pl.colorbar () pl.show ()

I think you only to extent = (left, plt.imshow . x = np.random Randn (2 , 10) y = np .ones ((4, 10)) x [0] = 0 # to clarify which side is above, etc. [0] = -1 plt.imshow (x, to extent = ( 0, 10, 0, 2) Plt.imshow (y, to extent = (0, 10, 2, 6)) # It is necessary, the plot plot becomes scaled and only the last array is plt.ylim (0, 6 ) Plt.colorbar () shows plt. Show ()

Enter image details here < / Div>

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -