Skip to content
Snippets Groups Projects
Commit 4a15d598 authored by Benjamin van Kuiken's avatar Benjamin van Kuiken
Browse files

Merge branch 'hrixs_construct' into 'master'

hRIXS Constructor

See merge request !243
parents ee247989 f2e30876
No related branches found
No related tags found
1 merge request!243hRIXS Constructor
Pipeline #96444 passed
......@@ -197,6 +197,9 @@ class hRIXS:
use None if you want to give it in standard deviations instead.
STD_THRESHOLD:
same as THRESHOLD, in standard deviations.
DBL_THRESHOLD:
threshold controling whether a detected hit is considered to be a
double hit.
BINS: int
the number of bins used in centroiding
CURVE_A, CURVE_B: float
......@@ -212,9 +215,9 @@ class hRIXS:
Example
-------
h = hRIXS()
h.PROPOSAL = 3145
proposal = 3145
h = hRIXS(proposal)
h.Y_RANGE = slice(700, 900)
h.CURVE_B = -3.695346575286939e-07
h.CURVE_A = 0.024084479232443695
......@@ -222,31 +225,34 @@ class hRIXS:
h.ENERGY_INTERCEPT = 498.27
h.STD_THRESHOLD = 3.5
"""
def __init__(self, proposalNB):
self.PROPOSAL=proposalNB
# image range
X_RANGE = np.s_[:]
Y_RANGE = np.s_[:]
# image range
self.X_RANGE = np.s_[:]
self.Y_RANGE = np.s_[:]
# centroid
THRESHOLD = None # pixel counts above which a hit candidate is assumed
STD_THRESHOLD = 3.5 # same as THRESHOLD, in standard deviations
DBL_THRESHOLD = 0.1 # factor used for double hits in centroid_one
CURVE_A = 0 # curvature parameters as determined elsewhere
CURVE_B = 0
# centroid
self.THRESHOLD = None # pixel counts above which a hit candidate is assumed
self.STD_THRESHOLD = 3.5 # same as THRESHOLD, in standard deviations
self.DBL_THRESHOLD = 0.1 # factor used for double hits in centroid_one
self.CURVE_A = 0 # curvature parameters as determined elsewhere
self.CURVE_B = 0
# integral
BINS = 100
# integral
self.BINS = 100
METHOD = 'centroid' # ['centroid', 'integral']
USE_DARK = False
self.METHOD = 'centroid' # ['centroid', 'integral']
self.USE_DARK = False
# Ignore double hits
AVOID_DBL = False
# Ignore double hits
self.AVOID_DBL = False
ENERGY_INTERCEPT = 0
ENERGY_SLOPE = 1
self.ENERGY_INTERCEPT = 0
self.ENERGY_SLOPE = 1
FIELDS = ['hRIXS_det', 'hRIXS_index', 'hRIXS_delay', 'hRIXS_norm','nrj']
self.FIELDS = ['hRIXS_det', 'hRIXS_index', 'hRIXS_delay', 'hRIXS_norm','nrj']
def set_params(self, **params):
for key, value in params.items():
......@@ -255,7 +261,8 @@ class hRIXS:
def get_params(self, *params):
if not params:
params = ('proposal', 'x_range', 'y_range',
'threshold', 'curve_a', 'curve_b',
'threshold', 'std_threshold', 'dbl_threshold',
'curve_a', 'curve_b',
'bins', 'method', 'fields')
return {param: getattr(self, param.upper()) for param in params}
......
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