twdb / sdi

Reader for Speciality Devices Incorporated (SDI) depth sounder binary format
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Be specific about int sizes in binary.py #5

Closed corranwebster closed 10 years ago

corranwebster commented 10 years ago

Currently integer fields are specified as being type np.int, but this varies depending on whether the platform is 64 or 32 bit. It's probably np.int32 that you want.

There's a similar issue with floats, as well.

dharhas commented 10 years ago

int32 should be more than sufficient.

wilsaj commented 10 years ago

It looks like the types vary depending on the field and it wouldn't be too much work to go through the spec and set the corresponding type per field.

Is there any reason not to use most specific type possible?

dharhas commented 10 years ago

It would reduce the memory footprint of the metadata somewhat to do that but since the the bulk of the space is taken by the image arrays I doubt it would be significant. Numpy should upcast stuff appropriately as needed if we do any calculations on the metadata. I don't have a strong opinion eitehr way.