Garjy / ice-cache-explorer

Automatically exported from code.google.com/p/ice-cache-explorer
GNU General Public License v3.0
0 stars 0 forks source link

Issue with caches of exactly 4000, 8000, 12000, .. particles #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. export exact 4000, 8000, 12000, 16000, .. particles into the icecache

What is the expected output? What do you see instead?
Some of the data gets corrupted. Looks like the icereader starts reading faulty.
(actually PointPosition looks fine but any other data is going wrong)

Please provide any additional information below.
I think it is to do with the chunk size. 
In icereader_util.py if you change ICECACHE_CHUNK_SIZE to e.g. 10000 it will 
work for 4000 particles.

I think in the chunks function (line 765) the second append should happen when 
elemCount != ICECACHE_CHUNK_SIZE. Changing to the following fixed it for me:

outChunks = []
chunks = elemCount / self.ICECACHE_CHUNK_SIZE
for i in xrange(chunks):
    outChunks.append(xrange((i)*self.ICECACHE_CHUNK_SIZE, (i+1)*self.ICECACHE_CHUNK_SIZE))
if not elemCount == self.ICECACHE_CHUNK_SIZE:
    outChunks.append(xrange( (i+1)*self.ICECACHE_CHUNK_SIZE, (i+1)*self.ICECACHE_CHUNK_SIZE + elemCount%self.ICECACHE_CHUNK_SIZE) )

hope this helps somebody bumping into the same issue..

Original issue reported on code.google.com by jo.pla...@gmail.com on 31 May 2013 at 10:35