Skip to content

.peek() function for LYRALightCurve object not working #871

Closed

Description

@DanRyanIrish

Hi guys,
I've started using sunpy to do some LYRA analysis and I've noticed that the .peek() function for the LYRA object doesn't appear to work. Is this a known problem or have misunderstood something in the installation process etc.? The error I get is

>>>lc = sunpy.lightcurve.LYRALightCurve.create(file)
>>>lc.peek()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-96-48ba98674805> in <module>()
----> 1 lc.peek()

/Users/danielr/anaconda/lib/python2.7/site-packages/sunpy/lightcurve/sources/lyra.pyc in peek(self, names, **kwargs)
     57         axes = plt.gca()
     58 
---> 59         axes = self.data.plot(ax=axes, subplots=True, sharex=True, **kwargs)
     60         #plt.legend(loc='best')
     61 

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in plot_frame(frame, x, y, subplots, sharex, sharey, use_index, figsize, grid, legend, rot, ax, style, title, xlim, ylim, logx, logy, xticks, yticks, kind, sort_columns, fontsize, secondary_y, **kwds)
   1733                              secondary_y=secondary_y, **kwds)
   1734 
-> 1735     plot_obj.generate()
   1736     plot_obj.draw()
   1737     if subplots:

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in generate(self)
    903         self._compute_plot_data()
    904         self._setup_subplots()
--> 905         self._make_plot()
    906         self._post_plot_logic()
    907         self._adorn_subplots()

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _make_plot(self)
   1319             lines = []
   1320             labels = []
-> 1321             x = self._get_xticks(convert_period=True)
   1322 
   1323             plotf = self._get_plot_function()

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _get_xticks(self, convert_period)
   1067                 x = index._mpl_repr()
   1068             elif is_datetype:
-> 1069                 self.data = self.data.sort_index()
   1070                 x = self.data.index._mpl_repr()
   1071             else:

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/frame.pyc in sort_index(self, axis, by, ascending, inplace, kind)
   2626             self._update_inplace(new_data)
   2627         else:
-> 2628             return self.take(indexer, axis=axis, convert=False, is_copy=False)
   2629 
   2630     def sortlevel(self, level=0, axis=0, ascending=True, inplace=False):

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/generic.pyc in take(self, indices, axis, convert, is_copy)
   1173                                                axis=baxis)
   1174         else:
-> 1175             new_data = self._data.take(indices, axis=baxis)
   1176 
   1177         result = self._constructor(new_data).__finalize__(self)

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/internals.pyc in take(self, indexer, new_index, axis, verify)
   3421                           ref_items=new_axes[0],
   3422                           new_axis=new_axes[axis],
-> 3423                           axis=axis)
   3424 
   3425     def merge(self, other, lsuffix=None, rsuffix=None):

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/internals.pyc in apply(self, f, *args, **kwargs)
   2373 
   2374             else:
-> 2375                 applied = getattr(blk, f)(*args, **kwargs)
   2376 
   2377             if isinstance(applied, list):

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/internals.pyc in take(self, indexer, ref_items, new_axis, axis)
    890             raise AssertionError('axis must be at least 1, got %d' % axis)
    891         new_values = com.take_nd(self.values, indexer, axis=axis,
--> 892                                  allow_fill=False)
    893 
    894         # need to preserve the ref_locs and just shift them

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/common.pyc in take_nd(arr, indexer, axis, out, fill_value, mask_info, allow_fill)
    675     func = _get_take_nd_function(arr.ndim, arr.dtype, out.dtype,
    676                                  axis=axis, mask_info=mask_info)
--> 677     func(arr, indexer, out, fill_value)
    678     return out
    679 

/Users/danielr/anaconda/lib/python2.7/site-packages/pandas/algos.so in pandas.algos.take_2d_axis1_float64_float64 (pandas/algos.c:80824)()

ValueError: Big-endian buffer not supported on little-endian compiler

Many thanks
Dan Ryan

Activity

  1. wafels commented on Feb 27, 2014

    @wafels
    Member

    This seems to be a pandas issue:

    https://groups.google.com/forum/#!topic/pydata/ksIPthf2NJI
    http://pandas.pydata.org/pandas-docs/dev/faq.html?highlight=endian#byte-ordering-issues

    jack

    On Thu, Feb 27, 2014 at 11:06 AM, DanRyanIrish [email protected]:

    Hi guys,
    I've started using sunpy to do some LYRA analysis and I've noticed that
    the .peek() function for the LYRA object doesn't appear to work. Is this a
    known problem or have misunderstood something in the installation process
    etc.? The error I get is

    lc = sunpy.lightcurve.LYRALightCurve.create(file)
    lc.peek()

    ValueError Traceback (most recent call last)
    in ()
    ----> 1 lc.peek()

    /Users/danielr/anaconda/lib/python2.7/site-packages/sunpy/lightcurve/sources/lyra.pyc
    in peek(self, names, *_kwargs)
    57 axes = plt.gca()
    58
    ---> 59 axes = self.data.plot(ax=axes, subplots=True, sharex=True,
    *_kwargs)
    60 #plt.legend(loc='best')
    61

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc
    in plot_frame(frame, x, y, subplots, sharex, sharey, use_index, figsize,
    grid, legend, rot, ax, style, title, xlim, ylim, logx, logy, xticks,
    yticks, kind, sort_columns, fontsize, secondary_y, *_kwds)
    1733 secondary_y=secondary_y, *_kwds)
    1734
    -> 1735 plot_obj.generate()
    1736 plot_obj.draw()
    1737 if subplots:

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc
    in generate(self)
    903 self._compute_plot_data()
    904 self._setup_subplots()
    --> 905 self._make_plot()
    906 self._post_plot_logic()
    907 self._adorn_subplots()

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc
    in _make_plot(self)
    1319 lines = []
    1320 labels = []
    -> 1321 x = self._get_xticks(convert_period=True)
    1322
    1323 plotf = self._get_plot_function()

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc
    in _get_xticks(self, convert_period)
    1067 x = index._mpl_repr()
    1068 elif is_datetype:
    -> 1069 self.data = self.data.sort_index()
    1070 x = self.data.index._mpl_repr()
    1071 else:

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/frame.pyc
    in sort_index(self, axis, by, ascending, inplace, kind)
    2626 self._update_inplace(new_data)
    2627 else:
    -> 2628 return self.take(indexer, axis=axis, convert=False, is_copy=False)
    2629
    2630 def sortlevel(self, level=0, axis=0, ascending=True, inplace=False):

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/generic.pyc
    in take(self, indices, axis, convert, is_copy)
    1173 axis=baxis)
    1174 else:
    -> 1175 new_data = self.

    data.take(indices, axis=baxis) 1176 1177 result = self.
    constructor(new_data).finalize(self)

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/internals.pyc
    in take(self, indexer, new_index, axis, verify)
    3421 ref_items=new_axes[0],
    3422 new_axis=new_axes[axis],
    -> 3423 axis=axis)
    3424
    3425 def merge(self, other, lsuffix=None, rsuffix=None):

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/internals.pyc
    in apply(self, f, _args, *_kwargs)
    2373
    2374 else:
    -> 2375 applied = getattr(blk, f)(_args, *_kwargs)
    2376
    2377 if isinstance(applied, list):

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/internals.pyc
    in take(self, indexer, ref_items, new_axis, axis)
    890 raise AssertionError('axis must be at least 1, got %d' % axis)
    891 new_values = com.take_nd(self.values, indexer, axis=axis,
    --> 892 allow_fill=False)
    893
    894 # need to preserve the ref_locs and just shift them

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/core/common.pyc
    in take_nd(arr, indexer, axis, out, fill_value, mask_info, allow_fill)
    675 func = _get_take_nd_function(arr.ndim, arr.dtype, out.dtype,
    676 axis=axis, mask_info=mask_info)
    --> 677 func(arr, indexer, out, fill_value)
    678 return out
    679

    /Users/danielr/anaconda/lib/python2.7/site-packages/pandas/algos.so in
    pandas.algos.take_2d_axis1_float64_float64 (pandas/algos.c:80824)()

    ValueError: Big-endian buffer not supported on little-endian compiler

    Many thanks
    Dan Ryan

    Reply to this email directly or view it on GitHubhttps://github.com//issues/871
    .

  2. Cadair commented on Feb 27, 2014

    @Cadair
    SponsorMember

    Oh holy cow! I had this issue the other day I thought it was something I was doing not an actual bona fide bug.

    Thanks a lot for reporting it Dan, I will patch it tomorrow.

    P.S. Seriously LYRA, little endian data?

  3. self-assigned this
    on Feb 27, 2014
  4. aringlis commented on Apr 10, 2014

    @aringlis
    Member

    This seems to be specifically an issue with pandas 0.13. I reproduce the error with 0.13 but the peek method works normally on pandas 0.12.

  5. aringlis commented on Apr 30, 2014

    @aringlis
    Member

    I think this issue has been resolved now.

  6. DanRyanIrish commented on May 5, 2014

    @DanRyanIrish
    MemberAuthor

    Cheers!

    On 30 Apr 2014, at 16:09, Stuart Mumford [email protected] wrote:

    Closed #871.

    —
    Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions