Conversation
rettigl
left a comment
There was a problem hiding this comment.
Generally, most changes make sense to me, but carefully check the order of your indices. I think the bug could be there.
| Delay: 1D array | None | ||
| Delay along time axis as numpy array. | ||
| I: 4D array | None | ||
| Measured intensity wrt momentum, time and energy, generated if None. |
There was a problem hiding this comment.
Do you consider the data as I(kx, ky, t, E) or I(kx, ky, E, t)?
There was a problem hiding this comment.
right now i only consider I(kx, ky, E, t), i will change the Description. The format I(kx, ky, E, t) comes from the nexus data set.
| ind1d = np.argmin(np.abs(EE - EE0), 1) | ||
| self.indEb = ind1d.reshape(self.E0.shape) | ||
| self.indEb = np.repeat(self.indEb[ :, :, np.newaxis], self.lengthdelay, axis=2) | ||
| # depends on the shape of E0, i assume E0 is the same for all times |
There was a problem hiding this comment.
Describe what you assume in the docstring, and possibly test for the shape
|
|
||
| self.I = ndimage.gaussian_filter(self.I, sigma=sigma) | ||
| for t in range(len(self.delay)): | ||
| self.I[:,:,:,t] = ndimage.gaussian_filter(self.I[:,:,:,t], sigma=sigma) |
There was a problem hiding this comment.
So this also assumes I(kx, ky, E, t)
| for t in range(self.lengthdelay): | ||
| self.I[:,:,:,t] = mclahe( | ||
| self.I[:,:,:,t] , | ||
| kernel_size=kernel_size, | ||
| n_bins=n_bins, | ||
| clip_limit=clip_limit, | ||
| use_gpu=use_gpu, | ||
| ) |
There was a problem hiding this comment.
we should discuss if this makes sense. Maybe generate one set of parameters, and apply everywhere. Not sure if mclahe can do this rn.
There was a problem hiding this comment.
I think i already tried to do this for the 4d intensity. If i remenber correctly i got an error, but i can try again.
| logP -= (ECurv[self.indEb[indx, indy - 2]] - 2 * ECurv[self.indEb[indx, indy - 1]] + ECurv) ** 2 | ||
| if indy < (self.lengthKy - 1): | ||
| logP -= (ECurv[self.indEb[indx, indy - 1]] - 2 * ECurv + ECurv[self.indEb[indx, indy + 1]]) ** 2 | ||
| logP -= (ENN - ENN[self.indEb[indx, indy - 1, indt]]) ** 2 |
There was a problem hiding this comment.
The way this is defined here, it will take the same eta along all directions. This should be extended after testing to provide a len(3) eta array for the three dimensions.
There was a problem hiding this comment.
I did the extention and i am testing the results right now. If everything looks correct i will update this with the testing of len(3).
| logP -= np.sum( | ||
| (Eb[ 0 : (self.lengthKx - 1), :,:] - Eb[1 : self.lengthKx, :,:]) ** 2 | ||
| ) / (2 * self.eta**2) |
There was a problem hiding this comment.
I will update this when i find out were this bug with the "ripples" comes from.
|
|
||
| **Parameters**\n | ||
| kx, ky: 1D array, 1D array | None, None | ||
| kx, ky, time: 1D array, 1D array | None, None |
There was a problem hiding this comment.
They are indices and not 1d arrays, no?
There was a problem hiding this comment.
Yes, i will change this.
| @@ -846,14 +934,19 @@ def plotBands(self, surfPlot=False, cmapName="viridis", figsize=[9, 9], equal_ax | |||
| equal_axes: bool | False | |||
| if time is None: | ||
| t = 0 | ||
| if time is not None: | ||
| t = time |
There was a problem hiding this comment.
I suppose this should be a time rather than an index like for the function above.
| ax.plot_surface(x, y, np.transpose(self.getEb())) | ||
| ax.plot_surface(x, y, np.transpose(Eb[:,:,t])) |
There was a problem hiding this comment.
does it matter if you use getEb or just Eb?
There was a problem hiding this comment.
I did matter in the beginning while i updatet the code for time dependens. I can check again if this is still needed.
2. added time constant
3. added data preprocessing steps
4. added time constant for plotting
5. changed the epochs from 150 to 100
For the mrfRec file: