Skip to content
Snippets Groups Projects
Commit a8629280 authored by Cammille Carinan's avatar Cammille Carinan
Browse files

Integrate hRIXS functions to module

parent f5ad640d
No related branches found
No related tags found
1 merge request!170hRIXS functions
......@@ -5,6 +5,7 @@ from .dssc import *
from .dssc_data import *
from .dssc_misc import *
from .dssc_processing import *
from .hrixs import *
from .pes import *
from .xgm import *
......@@ -16,6 +17,7 @@ __all__ = (
+ dssc_data.__all__
+ dssc_misc.__all__
+ dssc_processing.__all__
+ hrixs.__all__
+ pes.__all__
+ xgm.__all__
)
......@@ -3,6 +3,17 @@ from scipy.optimize import curve_fit
from scipy.signal import fftconvolve
__all__ = [
'find_curvature',
'correct_curvature',
'get_spectrum',
'energy_calibration',
'calibrate',
'gaussian_fit',
'to_fwhm'
]
# -----------------------------------------------------------------------------
# Curvature
......@@ -60,7 +71,7 @@ def correct_curvature(image, factor=None, axis=1):
return ret if axis == 1 else ret.T
def get_spectrum(image, cal_factor=None, axis=0,
def get_spectrum(image, factor=None, axis=0,
pixel_range=None, energy_range=None, ):
start, stop = (0, image.shape[axis - 1])
if pixel_range is not None:
......@@ -70,9 +81,9 @@ def get_spectrum(image, cal_factor=None, axis=0,
edge = image.sum(axis=axis)[start:stop]
bins = np.arange(start, stop + 1)
centers = (bins[1:] + bins[:-1]) * 0.5
if cal_factor is not None:
if factor is not None:
centers, edge = calibrate(centers, edge,
factor=cal_factor,
factor=factor,
range_=energy_range)
return centers, edge
......
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