def getdata(filename, *args, **kwargs):
 (mode, closed) = _get_file_mode(filename)
 header = kwargs.pop('header', None)
 lower = kwargs.pop('lower', None)
 upper = kwargs.pop('upper', None)
 view = kwargs.pop('view', None)
 (hdulist, extidx) = _getext(filename, mode, *args, **kwargs)
 try:
  hdu = hdulist[extidx]
  data = hdu.data
  if ((data is None) and (extidx == 0)):
   try:
    hdu = hdulist[1]
    data = hdu.data
   except IndexError:
    raise IndexError('No data in this HDU.')
  if (data is None):
   raise IndexError('No data in this HDU.')
  if header:
   hdr = hdu.header
 finally:
  hdulist._close(closed=closed)
 trans = None
 if lower:
  trans = operator.methodcaller('lower')
 elif upper:
  trans = operator.methodcaller('upper')
 if trans:
  if (data.dtype.names is None):
   return
  if (data.dtype.descr[0][0] == ''):
   return
  data.dtype.names = [trans(n) for n in data.dtype.names]
 if (isinstance(view, type) and issubclass(view, np.ndarray)):
  data = data.view(view)
 if header:
  return (data, hdr)
 else:
  return data

def getdata ( filename , * args , ** kwargs ) : ( mode , closed ) = _get_file_mode ( filename ) header = kwargs . pop ( 'header' , None ) lower = kwargs . pop ( 'lower' , None ) upper = kwargs . pop ( 'upper' , None ) view = kwargs . pop ( 'view' , None ) ( hdulist , extidx ) = _getext ( filename , mode , * args , ** kwargs ) try : hdu = hdulist [ extidx ] data = hdu . data if ( ( data is None ) and ( extidx == 0 ) ) : try : hdu = hdulist [ 1 ] data = hdu . data except IndexError : raise IndexError ( 'No data in this HDU.' ) if ( data is None ) : raise IndexError ( 'No data in this HDU.' ) if header : hdr = hdu . header finally : hdulist . _close ( closed = closed ) trans = None if lower : trans = operator . methodcaller ( 'lower' ) elif upper : trans = operator . methodcaller ( 'upper' ) if trans : if ( data . dtype . names is None ) : return if ( data . dtype . descr [ 0 ] [ 0 ] == '' ) : return data . dtype . names = [ trans ( n ) for n in data . dtype . names ] if ( isinstance ( view , type ) and issubclass ( view , np . ndarray ) ) : data = data . view ( view ) if header : return ( data , hdr ) else : return data
return a list of strings representing this image .