Skip to content

Commit

Permalink
Merge branch 'master' into feature/new_smalldata_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vespos committed Jan 23, 2025
2 parents 130a311 + 58c8163 commit 383c59c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion smalldata_tools/ana_funcs/roi_rebin.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(self, **kwargs):
def process(self, data):
# masked array????
newArray = rebin(data, self.shape)
ret_dict = {"data": newArray}
ret_dict = {"data": newArray.data}
return ret_dict


Expand Down
19 changes: 12 additions & 7 deletions smalldata_tools/lcls1/default_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def data(self, evt):
class ttRawDetector(DefaultDetector):
def __init__(self, name="ttRaw", env=None):
self.name = name
self.detname = ""
self.detname = "have_no_tt"
self.kind = "stepDown"
self.weights = None
self.ttROI_signal = None
Expand All @@ -631,7 +631,17 @@ def __init__(self, name="ttRaw", env=None):
self.subtract_sideband = False
self.ttCalib = [0.0, 1.0]
ttCfg = None
self.evrdet = psana.Detector("NoDetector.0:Evr.0")
evrName = None
ievr = 99
for key in env.configStore().keys():
if key.src().__repr__().find("Evr") > 0:
if int(key.src().__repr__()[-2]) < ievr:
ievr = int(key.src().__repr__()[-2])
evrName = (key.src().__repr__().split("(")[1])[:-1]
if evrName is None:
print("did not find EVR, cannot define ttraw detector ")
return None
self.evrdet = psana.Detector(evrName)
if env is None:
env = psana.Env
# getting the env this way unfortunatly does not work. Find out how psana.DetNames() does it.
Expand Down Expand Up @@ -687,11 +697,6 @@ def __init__(self, name="ttRaw", env=None):
else:
super().__init__(self.detname, "ttRaw")

def in_run(self):
if self.detname == "":
return False
return super().in_run(self)

def setPars(self, ttPars):
parsList = [
"ttProj",
Expand Down

0 comments on commit 383c59c

Please sign in to comment.