astropy/astropy — pull request #744 by astrofrog (2013-02-07 23:23:34+00:00)
Title: Issues with big endian Numpy arrays in Quantity

Example behavior:

```
In [20]: (np.array([1,2,3], dtype='

In [21]: (np.array([1,2,3], dtype='>f4') * u.au).to(u.cm)
ERROR: ValueError: Value not scalar compatible or convertable into a float or integer array [astropy.units.core]
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
----> 1 (np.array([1,2,3], dtype='>f4') * u.au).to(u.cm)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.3.dev3119-py3.2-macosx-10.6-x86_64.egg/astropy/units/quantity.py in to(self, unit, equivalencies)
100 directly convertible. See :ref:`unit_equivalencies`.
101 """
--> 102 new_val = self.unit.to(unit, self.value, equivalencies=equivalencies)
103 new_unit = Unit(unit)
104 return Quantity(new_val, new_unit)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.3.dev3119-py3.2-macosx-10.6-x86_64.egg/astropy/units/core.py in to(self, other, value, equivalencies)
372 other = Unit(other)
373 return self.get_converter(
--> 374 other, equivalencies=equivalencies)(value)
375
376 def in_units(self, other, value=1.0, equivalencies=[]):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.3.dev3119-py3.2-macosx-10.6-x86_64.egg/astropy/units/core.py in (val)
340 return self._apply_equivalences(
341 self, other, equivalencies)
--> 342 return lambda val: scale * _condition_arg(val)
343
344 def to(self, other, value=1.0, equivalencies=[]):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.3.dev3119-py3.2-macosx-10.6-x86_64.egg/astropy/units/core.py in _condition_arg(value)
1419 except ValueError:
1420 raise ValueError(
-> 1421 "Value not scalar compatible or convertable into a float or "
1422 "integer array")

ValueError: Value not scalar compatible or convertable into a float or integer array
```

I'm working on a fix.