Skip to content
Snippets Groups Projects

hRIXS functions

Merged Cammille Carinan requested to merge hrixs into master
4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
66 66 "M2BEND": ({'source': 'SA3_XTD10_MIRR-2/MOTOR/BENDER',
67 67 'key': 'actualPosition.value',
68 68 'dim': None},),
69 "hRIXS_det": ({'source': 'SCS_HRIXS_DET/CAM/CAMERA:daqOutput',
  • Before merging the changelog.rst in the documentation should be updated. I'm also in favor of increasing the version number and tagging a release for these new hRIXS capabilities. A notebook example in the documentation of how these new features are used would be great to have as well.

  • added 1 commit

    • b64c9318 - Add hRIXS class and centroid/integral methods

    Compare with previous version

  • Martin Teichmann
    Martin Teichmann @teichman started a thread on commit b64c9318
  • 319
    320 @property
    321 def corrected(self):
    322 return decentroid(self._centroid)
    323
    324 def spectrum(self, normalize=True):
    325 spec_func = (self._centroid_spectrum if self.METHOD.lower() == 'centroid'
    326 else self._integral_spectrum)
    327 return spec_func(normalize=normalize)
    328
    329 def __sub__(self, other):
    330 px, py = self.spectrum()
    331 mx, my = other.spectrum()
    332 return (px + mx) / 2, py - my
    333
    334 def __add__(self, other):
    • I don't like that the result of this is directly a spectrum, because this prevents us from adding more than two runs. run3 + run5 already returns a spectrum, doing run3 + run5 + run7 won't fly. So it would be better to require (run3 + run5 + run7).spectrum().

    • Author Maintainer

      Hmmm I have to think about doing it without copying the images.

    • Please register or sign in to reply
  • Cammille Carinan added 2 commits

    added 2 commits

    • 5b7c7ed6 - Add new centroid algorithm by Martin
    • eb1841a8 - Improve SCS_slowTrain call

    Compare with previous version

  • added 1 commit

    • 8b40f020 - Create new class on addition by aggregating list of image views

    Compare with previous version

  • Martin Teichmann
    Martin Teichmann @teichman started a thread on an outdated change in commit 8b40f020
  • 375 norm = ((i_n + j_n) or 1)
    376 374
    377 return ix, (iy + jy) / norm
    375 def split_images(images):
    376 """ Split the images by the number of trains
    377 and return the list of their views. """
    378
    379 # Check if the images has already been splitted
    380 if isinstance(images, list):
    381 return images
    382
    383 # Check if the images is a numpy of of 2d image that follows
    384 # the shape (num, y_dim, x_dim)
    385 assert len(images.shape) == 3
    386
    387 return [np.squeeze(image) for image in np.vsplit(images, images.shape[0])]
  • added 1 commit

    • e9b7b74b - TIL casting list to numpy array returns the sliced view

    Compare with previous version

  • This MR has gotten to long and we are already using the code. I know this is bad style, but I just merge. We can change more later.

  • mentioned in commit ad0907d3

  • Please register or sign in to reply
    Loading