Closed LMSC-NTappy closed 2 years ago
Ah, furthermore on this: I have noticed that the camera has a Readout Stride Different from Frame Stride or Frame Size only if the binning is set different from 1 in the ROI. See for example:
bintests = [(0,1340,0,100,1,1),
(0,500,0,100,1,1),
(0,500,0,50,1,1),
(0,1340,0,100,2,1),
(0,1340,0,100,1,2),
(0,1340,0,100,2,2),
(0,1024,0,50,2,2),]
for binning in bintests:
cam.set_roi(*binning)
cam._commit_parameters()
print(f"""X0 {binning[0]}, X1 {binning[1]:04d}, Y0 {binning[2]}, Y1 {binning[3]:03d}, BinX {binning[4]} BinY {binning[5]} """
f"""Frame stride {cam.cav['Frame Stride']:06d}, """ \
f"""Frame size {cam.cav['Frame Size']:06d}, """ \
f"""Readout Stride {cam.cav['Readout Stride']:06d}""")
# X0 0, X1 1340, Y0 0, Y1 100, BinX 1 BinY 1 Frame stride 268000, Frame size 268000, Readout Stride 268000
# X0 0, X1 0500, Y0 0, Y1 100, BinX 1 BinY 1 Frame stride 100000, Frame size 100000, Readout Stride 100000
# X0 0, X1 0500, Y0 0, Y1 050, BinX 1 BinY 1 Frame stride 050000, Frame size 050000, Readout Stride 050016
# X0 0, X1 1340, Y0 0, Y1 100, BinX 2 BinY 1 Frame stride 134000, Frame size 134000, Readout Stride 134400
# X0 0, X1 1340, Y0 0, Y1 100, BinX 1 BinY 2 Frame stride 134000, Frame size 134000, Readout Stride 134016
# X0 0, X1 1340, Y0 0, Y1 100, BinX 2 BinY 2 Frame stride 067000, Frame size 067000, Readout Stride 067200
# X0 0, X1 1024, Y0 0, Y1 050, BinX 2 BinY 2 Frame stride 025600, Frame size 025600, Readout Stride 025600
I am starting to suspect pyLabLib.pylablib.devices.PrincetonInstruments.picam.PicamCamera
which does:
https://github.com/AlexShkarin/pyLabLib/blob/8026a79a3241cd2c3ec4cbe30d960b57614eb52d/pylablib/devices/PrincetonInstruments/picam.py#L483
I will try to see if changing this to self.cav['Readout Stride']
solves this.
Cheers
Nicolas
Update: allocating buffer to self.cav['Readout Stride']
fixed my problem. I'll let you decide wether this should be pushed in the main repository or not. It might cause issue with other princeton instrument cameras, I don't know
Best Regards
Nicolas
Hello,
I run into issues when trying to set ROIs with x and/or y binning using the picam library and a PYLon BR Excelon camera. The trace is the following:
Interestingly, if I do the following I am able to grab one single frame correctly and then I get a different error.
Any idea why it should be the case?