|
From: Russell E. O. <ro...@ce...> - 2005-11-02 22:52:29
|
In article <113...@lo...>, Francesc Altet <fa...@ca...> wrote: > El dl 31 de 10 del 2005 a les 16:53 -0800, en/na Russell E. Owen va > escriure: > > I've got a module that can send array data to ds9. It screws up on > > byteswapped data and I'm trying to fix it. > > I don't exactly know what a ds9 is, but I'm supposing here that it is > kind of an exotic computer. It's an image display program. > > I need to know if the order is bigendian or littleendian, and I can't > > find a documented way to get that, just an undocumented attribute > > byteorder. > > Yes, it's undocumented, but as far as I can tell, this works flawlessly > in numarray. I'm sure it works now. I was hoping to know if it would continue working in future versions. It'd be nice to have a documented way to get at the info. >... > In general, copy() will return you a well-behaved (native-byte ordered, > non-strided and non-offsetted) array. The manual promises that a copy will be contiguous but I didn't see a promise of native byte order. I have submitted a documentation PR on sourceforge. ... Thanks for the explanation of what byteswapped was doing. That was very helpful. To use documented interfaces (i.e. not arra._byteorder) and to avoid byteswapping the input array, I think I'm going to be stuck doing something like: import sys if sys.byteorder == 'big': isBigendian = not arr.isbyteswapped() else: isBigendian = arr.isbyteswapped() I also submitted a request for a documented direct way to get the info on sourceforge. Regards, -- Russell |