Skip to content
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

Normalised intensities, was get_ring_current_per_scan does not work for fscan2d data #315

Open
jonwright opened this issue Jul 29, 2024 · 3 comments

Comments

@jonwright
Copy link
Member

Probably: we should be reading a monitor via the sparse file anyway.

"""

KeyError Traceback (most recent call last)
Cell In[42], line 6
4 correct_sinos_with_ring_current = True
5 if correct_sinos_with_ring_current:
----> 6 ds.get_ring_current_per_scan()
8 for gs in grainsinos:
9 gs.correct_ring_current(is_half_scan=is_half_scan)

File ~/git/ImageD11_clean/ImageD11/sinograms/dataset.py:490, in DataSet.get_ring_current_per_scan(self)
488 with h5py.File(self.masterfile, "r") as h5in:
489 for scan in self.scans:
--> 490 ring_current = float(h5in[scan]["instrument/machine/current"][()])
491 ring_currents.append(ring_current)
493 self.ring_currents_per_scan = np.array(ring_currents)

File h5py/_objects.pyx:54, in h5py._objects.with_phil.wrapper()

File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()

File /cvmfs/hpc.esrf.fr/software/packages/linux/x86_64/jupyter-slurm/2023.10.7/envs/jupyter-slurm/lib/python3.11/site-packages/h5py/_hl/group.py:357, in Group.getitem(self, name)
355 raise ValueError("Invalid HDF5 object reference")
356 elif isinstance(name, (bytes, str)):
--> 357 oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
358 else:
359 raise TypeError("Accessing a group is done with bytes or str, "
360 "not {}".format(type(name)))

File h5py/_objects.pyx:54, in h5py._objects.with_phil.wrapper()

File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()

File h5py/h5o.pyx:189, in h5py.h5o.open()

KeyError: "Unable to synchronously open object (object '1.1::[0:7200]' doesn't exist)"
"""

@jonwright
Copy link
Member Author

#316 reads the monitor data

To apply to a sinogram there are a couple of options:

  • normalise the pixel intensities to the monitor during peak integration (properties.py)
  • normalise the sinogram during sinogram generation (sinogram.py -> build_sinogram)

@jonwright
Copy link
Member Author

#332 gives a column to apply to the pk2d file.

To be decided:

  • either add a "raw_intensity" column and correct the numbers in the "sum_intensity" column (nasty - in place overwrite)
  • or apply the monitor later when doing build sinogram

@jonwright
Copy link
Member Author

Further thought... We also have the Lorentz and Polarisation factor for each reflection to add. There can be long tails on peaks, so it is not the same to have sum( (intensity/monitor) ) versus (sum of intensity)/(sum of monitor) for an integrated peak intensity.

  • make the sinogram of raw_intensity / monitor
  • make a sinogram of tth / eta to be able to get Lorentz * Polarisation

Or, we could apply the Lorentz + Polarisation directly on the raw_intensity.

@jonwright jonwright changed the title get_ring_current_per_scan does not work for fscan2d data Normalised intensities, was get_ring_current_per_scan does not work for fscan2d data Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant