- Notifications
You must be signed in to change notification settings - Fork 3
Timedependens #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Timedependens #11
Conversation
rettigl left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you consider the data as I(kx, ky, t, E) or I(kx, ky, E, t)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this also assumes I(kx, ky, E, t)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different etas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are indices and not 1d arrays, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i will change this.
| Name of the colormap. | ||
| figsize: list/tuple | [9, 9] | ||
| Size of the figure produced. | ||
| equal_axes: bool | False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add parameter
| if time is None: | ||
| t = 0 | ||
| if time is not None: | ||
| t = time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this should be a time rather than an index like for the function above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use one variable
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it matter if you use getEb or just Eb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: