Skip to content
Snippets Groups Projects
Commit bb8a468c authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

Shift the newton images by 1 train Id earlier in from_run

parent 4a15d598
No related branches found
No related tags found
No related merge requests found
Pipeline #97724 passed
......@@ -165,11 +165,19 @@ class Viking:
data2 = v.from_run(155) # load run 155
data = xarray.concat([data1, data2], 'trainId') # combine both
"""
#separately load newton image and deal with trainId mismatch
roi = {'newton': {'newton': {'roi': (self.Y_RANGE, self.X_RANGE),
'dim': ['newt_y', 'newt_x']}}}
run, data = tb.load(self.PROPOSAL, runNB,
fields=self.FIELDS, rois=roi)
data['newton'] = data['newton'].astype(float)
run, newton = tb.load(self.PROPOSAL, runNB, 'newton', rois=roi)
newton = newton.shift(trainId=-1).astype(float)
#load the rest
fields = [f for f in self.FIELDS if f != 'newton']
if len(fields) == 0:
data = newton
else:
run, data = tb.load(self.PROPOSAL, runNB,
fields=fields)
data = data.merge(newton, join='inner')
data = data.assign_coords(newt_x=np.polyval(self.ENERGY_CALIB,
data['newt_x']))
if add_attrs:
......
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