The reason behind this was Line#17 , where we hard coded the 4 which is actually sample_bytes.
Also,
One interesting thing was, PDS file with sample_bits = 64 works fine if it is not compressed, as we use np.fromfile in this case instead of np.fromstring.
Error: