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
The Voronoi binning example in the tutorial contains the following code:
# First we need to make lists of pixel Coordinates# note this will be stupid big with large data cubes# in that case find a smartter way to make these arrays# ... X is a 1D list of length 150**2X= []
forxinnp.arange(0, cube.shape[2]):
X+=[x]*cube.shape[2]
x=np.array(X)
# ... Y is a 1D list of length 150**2Y=[]
foryinnp.arange(0,cube.shape[1]):
Y+=list(np.arange(0,cube.shape[1]))
y=np.array(Y)
I don't know if finding a smarter way was meant an exercise for the reader, but I certainly think there is a more efficient way provided by numpy to do this.
The Voronoi binning example in the tutorial contains the following code:
I don't know if finding a smarter way was meant an exercise for the reader, but I certainly think there is a more efficient way provided by numpy to do this.
https://heloises.github.io/hoki/Voronoi_binning_of_SED_data.html#Book-keeping---creating-the-pixel-coordinate,-signal-and-noise-arrays
This does the trick:
Can provide PR if you want.
The text was updated successfully, but these errors were encountered: