bluesky / area-detector-handlers

https://pypi.org/project/area-detector-handlers
Other
0 stars 10 forks source link

Express3 handler error at QAS #19

Open gwbischof opened 4 years ago

gwbischof commented 4 years ago
/opt/conda_envs/collection-2020-2.0rc7-1/lib/python3.7/site-packages/dask/utils.py in apply(func=<bound method Xspress3HDF5Handler.__call__ of Su...m/2020/08/17/e7b09d10-7ad4-433c-84d3_000000.h5')>, args=[], kwargs={'frame': 0})
     29 def apply(func, args, kwargs=None):
     30     if kwargs:
---> 31         return func(*args, **kwargs)
        func = <bound method Xspress3HDF5Handler.__call__ of Subclass(filename='/nsls2/xf07bm/data/x3m/2020/08/17/e7b09d10-7ad4-433c-84d3_000000.h5')>
        args = []
        kwargs = {'frame': 0}
     32     else:
     33         return func(*args)

/opt/conda_envs/collection-2020-2.0rc7-1/lib/python3.7/site-packages/area_detector_handlers/_xspress3.py in __call__(self=Subclass(filename='/nsls2/xf07bm/data/x3m/2020/08/17/e7b09d10-7ad4-433c-84d3_000000.h5'), frame=0, channel=None)
     87         # Don't read out the dataset until it is requested for the first time.
     88         self._get_dataset()
---> 89         return self._dataset[frame, channel - 1, :].squeeze()
        self._dataset = array([[[ 1.0022392 ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [27.06106184, 32.07236958, 23.05201564, ...,  0.        ,
          0.        ,  6.0135693 ]],

       [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [24.05472318, 38.08664504, 27.06156358, ...,  0.        ,
          0.        ,  4.00912053]],

       [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [24.05443389, 23.05216581, 33.0748466 , ...,  0.        ,
          0.        ,  6.01360847]],

       ...,

       [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [43.01456008, 46.0155759 , 37.01252844, ...,  0.        ,
          0.        ,  1.00033861]],

       [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 1.00035137,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [44.01525092, 33.01143819, 50.01733059, ...,  0.        ,
          0.        ,  2.00069322]],

       [[ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        , ...,  0.        ,
          0.        ,  0.        ],
        [39.01331298, 40.01365434, 36.0122889 , ...,  0.        ,
          0.        ,  1.00034136]]])
        frame = 0
        channel.squeeze = undefined
     90
     91     def get_file_list(self, datum_kwarg_gen):

TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
gwbischof commented 4 years ago

I think that frame and channel arguments of the call method should be required arguments

mrakitin commented 4 years ago

What does %debug show regarding the values of these parameters?

danielballan commented 4 years ago

Agree. I suspect these have default values due to cargo-culting code from the original handlers (which also had invalid defaults and should not have).

mrakitin commented 4 years ago

I don't remember the exact reason for this custom handler at QAS, but it originally came in from me via https://github.com/NSLS-II-QAS/profile_collection/commit/5903a1ec174d22e032b18633da5539436ca26b4e. I think we needed all channels based on the specified frame number.

.