On 4/27/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
>
> Is there really no single method to call on an ndarray that asks: "what
> endian are you"
>
> I know not every two-liner should be made into a convenience method, but
> this seems like a good candidate to me.
+1
I came across this sour
Is there really no single method to call on an ndarray that asks: "what
endian are you"
I know not every two-liner should be made into a convenience method, but
this seems like a good candidate to me.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR
In article <[EMAIL PROTECTED]>,
Francesc Altet <[EMAIL PROTECTED]> wrote:
> El dj 26 de 04 del 2007 a les 11:38 -0700, en/na Russell E. Owen va
> escriure:
> > In converting some code from numarray to numpy I had this:
> > isBigendian = (arr.isbyteswapped() != numarray.isBigEndian)
> >
> > The o
In article <[EMAIL PROTECTED]>,
Christopher Hanley <[EMAIL PROTECTED]> wrote:
> Russell,
>
> This should work as a consistent test for bigendian:
>
> -> isBigEndian = (obj.dtype.str[0] == '>')
>
> Also, I have ported numarray's numdisplay to numpy if you would like to
> directly display an ar
Stefan van der Walt wrote:
>
> Ah, yes, I was confused. What I meant to ask was, couldn't
> dtype.str[0] sometimes be '|'?
>
>
That is true. It would happen for an array of strings.
>>> a = n.array(['1','2','3','4'])
>>> a.dtype.str[0]
'|'
I haven't needed to worry about that case in te
On Fri, Apr 27, 2007 at 08:49:16AM -0400, Christopher Hanley wrote:
> >> -> isBigEndian = (obj.dtype.str[0] == '>')
> >
> > Is this test always safe, even on big endian machines? Couldn't the
> > dtype.str[0] sometimes be '='?
> >
> The test does would on big endian machines. What wouldn't wor
Stefan van der Walt wrote:
> On Thu, Apr 26, 2007 at 05:22:42PM -0400, Christopher Hanley wrote:
>
>> This should work as a consistent test for bigendian:
>>
>> -> isBigEndian = (obj.dtype.str[0] == '>')
>>
>
> Is this test always safe, even on big endian machines? Couldn't the
> dtype.str
On Thu, Apr 26, 2007 at 05:22:42PM -0400, Christopher Hanley wrote:
> This should work as a consistent test for bigendian:
>
> -> isBigEndian = (obj.dtype.str[0] == '>')
Is this test always safe, even on big endian machines? Couldn't the
dtype.str[0] sometimes be '='?
Regards
Stéfan
___
> I really want to know if the array is in big-endian order (I don't care
> whether it's native). This is for sending arrays to the ds9 image viewer
> via xpa (and communicating with ds9 is not easy). To do this reliably I
> need to indicate the byte order of the data.
>
Thanks for the clar
Russell,
This should work as a consistent test for bigendian:
-> isBigEndian = (obj.dtype.str[0] == '>')
Also, I have ported numarray's numdisplay to numpy if you would like to
directly display an array in DS9. We haven't done an official release
yet (sometime soon) but I can forward you a co
In article <[EMAIL PROTECTED]>,
Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Russell E. Owen asked how best to translate some numarray code that
> determines if an array is in big-endian order...
>
> What are you trying to test for (where a data-type is big-endian or not?).
I really want to kno
Russell E. Owen wrote:
> In converting some code from numarray to numpy I had this:
> isBigendian = (arr.isbyteswapped() != numarray.isBigEndian)
>
> The only numpy version I've come up with is:
> isBigEndian = (arr.dtype.descr[0][1][0] == '>')
>
> which is short but very obscure. Has anyone got a
El dj 26 de 04 del 2007 a les 11:38 -0700, en/na Russell E. Owen va
escriure:
> In converting some code from numarray to numpy I had this:
> isBigendian = (arr.isbyteswapped() != numarray.isBigEndian)
>
> The only numpy version I've come up with is:
> isBigEndian = (arr.dtype.descr[0][1][0] == '>'
In converting some code from numarray to numpy I had this:
isBigendian = (arr.isbyteswapped() != numarray.isBigEndian)
The only numpy version I've come up with is:
isBigEndian = (arr.dtype.descr[0][1][0] == '>')
which is short but very obscure. Has anyone got a suggestion for a
clearer test? I f
14 matches
Mail list logo