NSLS-II-CSX / csxtools

Useful python tools for CSX (23-ID)
http://nsls-ii-csx.github.io/csxtools
Other
4 stars 13 forks source link

Bug report - get_fastccd_images #38

Closed vivekthampy closed 8 years ago

vivekthampy commented 8 years ago

@stuwilkins The program crashes if the background scan headers have events with different number of images. The crashing function is get_images_to_4D.

https://gist.github.com/vivekthampy/71d110d899f68a61150a

One solution that works for me is using the the function below instead of get_images_to_4D.

def convert_to_3D(images):
    if isinstance(images, np.ndarray):
        if images.ndim == 3 or images.ndim == 2:
            return images
        elif images.ndim == 4:
            shape = images.shape
            return np.reshape(images, (shape[0]*shape[1], shape[2], shape[3]))
    else:
        ims = images[0]
        for im in images[1:]:
            ims = np.vstack((ims, im))
        return ims
stuwilkins commented 8 years ago

Why would you do that? It does't seem consistent with how we take data at CSX

stuwilkins commented 8 years ago

Despite not being the normal CSX workflow, I have fixed this now. This is tagged as v0.1.8. Once it is built I will put it on the jupyter hub for all users. @vivekthampy can you test again? I ran this through your scans and it seems to work.