In [1]:
from iuvs import io

In [9]:
g = io.l1b_filenames()
g


/Users/klay6683/data/iuvs/level1b
Out[9]:
<map at 0x10d026518>

In [10]:
data = io.L1BReader(list(g)[0])

In [12]:
%matplotlib notebook

In [18]:
ax = data.plot_raw_spectrogram(-1)



In [19]:
ax.get_im


Out[19]:
matplotlib.axes._subplots.AxesSubplot

In [49]:
skip_cards = ['SIMPLE','COMMENT', 'KERNEL']

In [50]:
tuples = []
for card in data.img_header.cards:
    if not card[0] in skip_cards:
        tuples.append(card)

In [54]:
pd.DataFrame(np.array([i[1] for i in tuples]).T, columns = [i[0] for i in tuples])


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/internals.py in create_block_manager_from_blocks(blocks, axes)
   3562             blocks = [make_block(values=blocks[0],
-> 3563                                  placement=slice(0, len(axes[0])))]
   3564 

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/internals.py in make_block(values, placement, klass, ndim, dtype, fastpath)
   2138     return klass(values, ndim=ndim, fastpath=fastpath,
-> 2139                  placement=placement)
   2140 

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/internals.py in __init__(self, values, ndim, fastpath, placement)
   1438                                           fastpath=fastpath,
-> 1439                                           placement=placement)
   1440 

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/internals.py in __init__(self, values, placement, ndim, fastpath)
     75                              ' placement implies %d' % (
---> 76                                  len(self.values), len(self.mgr_locs)))
     77 

ValueError: Wrong number of items passed 1, placement implies 21

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-54-f90393bb9ed6> in <module>()
----> 1 pd.DataFrame(np.array([i[1] for i in tuples]).T, columns = [i[0] for i in tuples])

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
    237             else:
    238                 mgr = self._init_ndarray(data, index, columns, dtype=dtype,
--> 239                                          copy=copy)
    240         elif isinstance(data, (list, types.GeneratorType)):
    241             if isinstance(data, types.GeneratorType):

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/frame.py in _init_ndarray(self, values, index, columns, dtype, copy)
    397 
    398         index, columns = _get_axes(*values.shape)
--> 399         return create_block_manager_from_blocks([values.T], [columns, index])
    400 
    401     @property

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/internals.py in create_block_manager_from_blocks(blocks, axes)
   3570         blocks = [getattr(b, 'values', b) for b in blocks]
   3571         tot_items = sum(b.shape[0] for b in blocks)
-> 3572         construction_error(tot_items, blocks[0].shape[1:], axes, e)
   3573 
   3574 

/Users/maye/miniconda3/envs/py34/lib/python3.4/site-packages/pandas/core/internals.py in construction_error(tot_items, block_shape, axes, e)
   3551         raise e
   3552     raise ValueError("Shape of passed values is {0}, indices imply {1}".format(
-> 3553         passed,implied))
   3554 
   3555 

ValueError: Shape of passed values is (1, 21), indices imply (21, 21)

In [ ]:
pd.