Reciprocal space

Ok I will fix that


On Aug 9, 2014, at 12:40 PM, "Thomas A Caswell" <notifications@github.com<mailto:notifications@github.com>> wrote:


In nsls2/recip.py:

>      """
>
> -    if ROI is not None and len(ROI) == 4:
> -        # slice the image based on the desired ROI
> -        img=img[ROI[0]:ROI[1], ROI[2]:ROI[3]]
> +
> +    if ROI is not None:
> +        if len(ROI) == 4:
> +            # slice the image based on the desired ROI
> +            img = np.meshgrid(img[ROI[0]:ROI[1]], img[ROI[2]:ROI[3]], sprase=True)
> +        else:
> +            logger.error(" ROI has to be 4 element array : len(ROI) = 4")
> +            raise ValueError(" ROI has to be 4 elment array : len(ROI) = 4")


You shouldn't do logging if you are raising an exception. You should do logging if you are catching an exception. See: https://docs.python.org/2/howto/logging.html#when-to-use-logging

—
Reply to this email directly or view it on GitHub<https://github.com/NSLS-II/NSLS2/pull/59/files#r16026597>.