Would not shifting by 360 and dividing by 2 do the job?

Cheers,
Oleg.

From: [email protected] <[email protected]> on behalf of Robert Oeffner <[email protected]>
Sent: 11 April 2019 17:46
To: [email protected]
Subject: [cctbxbb] modulo operation on flex.double
 
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
[email protected]
http://phenix-online.org/mailman/listinfo/cctbxbb