[SciPy-dev] Arbitrary n-dimensional rebin routine

Angus McMorland a.mcmorland at auckland.ac.nz
Wed Apr 12 01:57:08 EDT 2006


Angus McMorland wrote:
> Okay, my first reply is to myself, with all the bits I forgot to add.

Make that _some_ of the bits I forgot. Here's the last of them:

def xvals(dims):
    '''Returns a volume with the appropriate x index value in each
    element.'''
    evList = ['n.fromfunction( xi, (%d' % dims[0] ] + \
             [', %d' % dims[i+1] for i in range( len(dims) - 1 )] + \
             [') )']
    return eval( ''.join(evList) )

Apologies for the multiple postings.
-- 
Angus McMorland
email a.mcmorland at auckland.ac.nz
mobile +64-21-155-4906

PhD Student, Neurophysiology / Multiphoton & Confocal Imaging
Physiology, University of Auckland
phone +64-9-3737-599 x89707

Armourer, Auckland University Fencing
Secretary, Fencing North Inc.




More information about the SciPy-Dev mailing list