[cctbxbb] modulo operation on flex.double

Pavel Afonine pafonine at lbl.gov
Thu Apr 11 10:08:30 PDT 2019


Hi Rob,

I don't really know the answer but instead of

"If not I guess I'll have to numpy the problem :-)"

I'd rather add a functionality to do this to flex or miller.

Pavel

On Thu, Apr 11, 2019, 10:00 AM Robert Oeffner <rdo20 at cam.ac.uk> wrote:

> Hi,
>
> I have a flex.double array of phase values between -360 and 360 degrees
> I would like to cast them all in one go to lie within 0 to 360. Does
> anybody know if there is a nice way of doing this with flex arrays? The
> modulo operator doesn't seem to be supported for flex arrays unlike the
> +, -, * and the / operators. This would otherwise be handy as I could
> then convert the array in one line of code like
>
> phases = phases % 360.0
>
> If not I guess I'll have to numpy the problem :-)
>
> Many thanks,
>
> Rob
>
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20190411/bc2a47e8/attachment-0001.htm>


More information about the cctbxbb mailing list