Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
olaurino committed Jul 15, 2019
1 parent 3e48b74 commit 261c4ed
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sherpa/models/regrid.py
Expand Up @@ -593,14 +593,15 @@ def rebin_2d(y, from_space, to_space):
def rebin_int(array, factorx, factory):
xedge = np.shape(array)[0] % factorx
yedge = np.shape(array)[1] % factory
array_binned1 = array[xedge:, yedge:]
sub_array = array[xedge:, yedge:]
binned_x_shape = np.shape(sub_array)[0]//factorx
binned_y_shape = np.shape(sub_array)[1]//factory

binim = np.reshape(array_binned1,
(np.shape(array_binned1)[0]//factorx,factorx,np.shape(array_binned1)[1]//factory, factory))
binim = np.sum(binim, axis=3)
binim = np.sum(binim, axis=1)
image = np.reshape(sub_array, (binned_x_shape, factorx, binned_y_shape, factory))
image = np.sum(image, axis=3)
image = np.sum(image, axis=1)

return binim
return image


def rebin_no_int(array, dimensions=None, scale=None):
Expand Down

0 comments on commit 261c4ed

Please sign in to comment.