[cctbxbb] Does cctbx have an easy to access spherical harmonic table?

Graeme.Winter at diamond.ac.uk Graeme.Winter at diamond.ac.uk
Sat May 9 13:07:21 PDT 2015


Hi Folks

Digging around some more found the test for the Zernike stuff, now have

from __future__ import division

def tst_nss_spherical_harmonics():
  from scitbx import math
  from scitbx.array_family import flex
  N=50
  M=20
  lfg =  math.log_factorial_generator(N)
  nsssphe = math.nss_spherical_harmonics(M+5,50000,lfg)
  
  l = 2
  m = 1
  t = 1
  p = 1
  
  print nsssphe.spherical_harmonic(2, 1, 1, 1)
  
tst_nss_spherical_harmonics()  

Not clear what a log factorial generator is, but seems to work

if I am only caring about small integer l for Ylm do I need to have the big numbers above?

Thanks Graeme

> On 9 May 2015, at 20:58, Graeme.Winter at Diamond.ac.uk wrote:
> 
> Hi Folks,
> 
> Looked and something is used from boost but they don’t appear to be clearly wrapped to Python.
> 
> in
> 
> scitbx.math.nss_spherical_harmonics
> 
> found nearly what I was looking for but it seems to be for some other purpose & not really do what I want (and needs mystery things in constructor….)
> 
>>>> _sh = sh(2, 1)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> Boost.Python.ArgumentError: Python argument types in
>    nss_spherical_harmonics.__init__(nss_spherical_harmonics, int, int)
> did not match C++ signature:
>    __init__(_object*, int l_max, int mangle, scitbx::math::zernike::log_factorial_generator<double> lgf)
> 
> 
> Any clues would be welcome, else wise most sensible thing seems to be to wrap up to Python the boost spherical harmonic code…
> 
> Thanks Graeme
> 
> 
> -- 
> This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
> Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
> Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
> Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
> 
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb




More information about the cctbxbb mailing list