Skip to content
Snippets Groups Projects
Commit 289a7ff7 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

included Laurent's suggestions

parent d90a7d6c
No related branches found
No related tags found
1 merge request!228Add documentation for hRIXS
......@@ -395,6 +395,10 @@ class hRIXS:
**kwargs):
"""find the curvature correction coefficients
The hRIXS has some abberations which leads to the spectroscopic lines
being curved on the detector. We approximate these abberations with
a parabola for later correction.
Load a run and determine the curvature. The curvature is set in `self`,
and returned as a pair of floats.
......@@ -413,7 +417,7 @@ class hRIXS:
Example
-------
h.find_curvature(155) # use run 155 to fit the curvature
h.find_curvature(155) # use run 155 to fit the curvature
"""
data = self.from_run(runNB, proposal)
......@@ -431,9 +435,9 @@ class hRIXS:
def centroid(self, data, bins=None):
"""calculate a spectrum by finding the centroid of individual photons
This takes the `xarray` `data` and returns a copy of it, with a new
dataarray named `spectrum` added, which contains the energy spectrum
calculated for each hRIXS image.
This takes the `xarray.Dataset` `data` and returns a copy of it, with
a new `xarray.DataArray` named `spectrum` added, which contains the
energy spectrum calculated for each hRIXS image.
Example
-------
......@@ -481,6 +485,7 @@ class hRIXS:
Example
-------
data = h.integrate(data) # create spectrum by summing pixels
data.spectrum[0, :].plot() # plot the spectrum of the first image
"""
......@@ -514,13 +519,14 @@ class hRIXS:
def aggregate(self, ds, dim="trainId"):
"""aggregate (i.e. mostly sum) all data within one dataset
talk all images in a dataset and aggregate them and their metadata.
take all images in a dataset and aggregate them and their metadata.
For images, spectra and normalizations that means adding them, for
others (e.g. delays) adding would not make sense, so we treat them
properly.
Example
-------
data = h.centroid(data) # create spectra from finding photons
agg = h.aggregate(data) # sum all spectra
agg.spectrum.plot() # plot the resulting spectrum
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment