new size of bunch pattern table
In proposal 4476 we see that the bunchPatternTable size is 3611 as opposed to the 2700 used before. This makes an error when loading the bam data:
proposal, runNB = 4476, 304
run = tb.open_run(proposal, runNB)
tb.get_bam(run, 'BAM1932M')
Output:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/tmp/ipykernel_217086/103181248.py in <cell line: 3>()
1 proposal, runNB = 4476, 304
2 run = tb.open_run(proposal, runNB)
----> 3 tb.get_bam(run, 'BAM1932M')
~/ToolBox_SCS/src/toolbox_scs/detectors/bam_detectors.py in get_bam(run, mnemonics, merge_with, bunchPattern, pulseIds)
108 da_bam = da_bam.assign_coords(BAMbunchId=np.arange(0, 2700))
109 da_bam = da_bam.rename(BAMbunchId=dim_names[bunchPattern])
--> 110 da_bam = da_bam.where(mask, drop=True)
111 if run_mnemonics[m]['key'] != 'data.lowChargeArrivalTime':
112 da_bam *= 1e-3
/gpfs/exfel/sw/software/mambaforge/22.11/envs/202301/lib/python3.9/site-packages/xarray/core/common.py in where(self, cond, other, drop)
1123 )
1124
-> 1125 self, cond = align(self, cond) # type: ignore[assignment]
1126
1127 def _dataarray_indexer(dim: Hashable) -> DataArray:
/gpfs/exfel/sw/software/mambaforge/22.11/envs/202301/lib/python3.9/site-packages/xarray/core/alignment.py in align(join, copy, indexes, exclude, fill_value, *objects)
785 fill_value=fill_value,
786 )
--> 787 aligner.align()
788 return aligner.results
789
/gpfs/exfel/sw/software/mambaforge/22.11/envs/202301/lib/python3.9/site-packages/xarray/core/alignment.py in align(self)
571 self.assert_no_index_conflict()
572 self.align_indexes()
--> 573 self.assert_unindexed_dim_sizes_equal()
574
575 if self.join == "override":
/gpfs/exfel/sw/software/mambaforge/22.11/envs/202301/lib/python3.9/site-packages/xarray/core/alignment.py in assert_unindexed_dim_sizes_equal(self)
470 add_err_msg = ""
471 if len(sizes) > 1:
--> 472 raise ValueError(
473 f"cannot reindex or align along dimension {dim!r} "
474 f"because of conflicting dimension sizes: {sizes!r}" + add_err_msg
ValueError: cannot reindex or align along dimension 'sa3_pId' because of conflicting dimension sizes: {3611, 2700} (note: an index is found along that dimension with size=2700)