to block read/writes

Do block read/writes instead of detector-by-detector, since input data file
is stored with detector index varying more quickly. Reading full detector at
once is expensive. Doing read/writes by block splits the difference.
move 'print' message outside of samp loop

too many prints!
fix whitespace