Commit 2c310593 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Remove masked rows from CC diffcal instead of PD

parent 7fa68223
......@@ -152,10 +152,10 @@ def pdcalibration_groups(data_ws,
cc_and_pd_diffcal = CloneWorkspace(f'{output_basename}_pd_diffcal', OutputWorkspace=f'{output_basename}_cc_pd_diffcal')
# remove masked detectors
# remove PD masked detectors from CC diffcal
mask_ws = mtd[f'{output_basename}_pd_diffcal_mask']
rows_to_remove = []
detid_list = cc_and_pd_diffcal.column('detid')
detid_list = cc_diffcal.column('detid')
for n in range(mask_ws.getNumberHistograms()):
if mask_ws.readY(n)[0] == 1:
try:
......@@ -164,7 +164,7 @@ def pdcalibration_groups(data_ws,
pass
if rows_to_remove:
DeleteTableRows(cc_and_pd_diffcal, Rows=rows_to_remove)
DeleteTableRows(cc_diffcal, Rows=rows_to_remove)
cc_det_to_difc = dict(zip(cc_diffcal.column('detid'), cc_diffcal.column('difc')))
......
......@@ -87,9 +87,11 @@ class TestGroupCalibration(unittest.TestCase):
[starting_difc[0],
starting_difc[1]/0.95,
starting_difc[2]/1.05,
0,
starting_difc[4]/0.95,
starting_difc[5]/(0.95*0.98),
starting_difc[6]/(0.95*1.02)], rtol=0.005)
starting_difc[6]/(0.95*1.02),
0], rtol=0.005)
def test_from_prev_cal(self):
......@@ -146,9 +148,11 @@ class TestGroupCalibration(unittest.TestCase):
[starting_difc[0],
starting_difc[1]/0.95,
starting_difc[2]/1.05,
starting_difc[3]*1.01,
starting_difc[4]/0.95,
starting_difc[5]/(0.95*0.98),
starting_difc[6]/(0.95*1.02)], rtol=0.005)
starting_difc[6]/(0.95*1.02),
starting_difc[7]*1.01], rtol=0.005)
def test_di_group_calibration(self):
ws, groups = create_test_ws_and_group()
......@@ -191,9 +195,11 @@ class TestGroupCalibration(unittest.TestCase):
[starting_difc[0],
starting_difc[1]/0.95,
starting_difc[2]/1.05,
starting_difc[3]*1.01,
starting_difc[4]/0.95,
starting_difc[5]/(0.95*0.98),
starting_difc[6]/(0.95*1.02)], rtol=0.005)
starting_difc[6]/(0.95*1.02),
starting_difc[7]*1.01], rtol=0.005)
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment