You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dermen I agree this function is a good idea. I got rid of it in the memory branch temporarily, but I think we should add it back in with a few tweaks. Curious what you think about the following:
Have it automatically deal with the mask (should be possible)
Have an option to discard shots (by index) as well as phi values
Adding a unit test
Original Code:
def reduce_rings ( self, factor ):
""" reduce self.num_phi by factor; WARNING: removes the mask; must make a new one """
if self.num_phi % factor != 0:
raise NotImplementedError( 'As of now, *factor* must be a multiple of *self.num_phi*' )
rp = np.copy( self.polar_intensities)
new_rp = np.zeros(( rp.shape[0], rp.shape[1],rp.shape[2] / factor ) )
# convolve algor. taken from stack overflow
for q in self.q_values:
for i in xrange( rp.shape[0] ) :
d = rp[ i,self.q_index(q),:]
d = np.convolve( d + [d[-1]], [1./factor]*factor,mode='valid' )[::factor]
new_rp[i,self.q_index(q),:] = d
return Rings( self.q_values, new_rp, self.k )
The text was updated successfully, but these errors were encountered:
@dermen I agree this function is a good idea. I got rid of it in the memory branch temporarily, but I think we should add it back in with a few tweaks. Curious what you think about the following:
Original Code:
The text was updated successfully, but these errors were encountered: