#include #include #include "../iolib/message.h" #include "cmplx.h" float **farray2(); complex *cmplxarray1(); void rotharm(a,lmax,jump,conven,alpha,beta,gamma) float *a; /* real harmonics to be transformed */ int lmax; /* max degree of spherical harmonics */ int jump; /* block size of each harmonic order */ char *conven; /* "X^",etc. spherical harmonic convention */ float alpha,beta,gamma; /* Euler angles */ { float fac,sign; float **d; complex *c2,*c1,sum; double arg; int i,t,m,l; float save; if(!strcmp(conven,"X^")) { fac=1.4142136; } else STOP(rotharm: to be fixed); for(l=0;l<=lmax;l++) { if(l) { free_farray2(d,-l+1,l-1,-l+1); free_cmplxarray1(c2,-l+1); free_cmplxarray1(c1,-l+1); } d=farray2(-l,l,-l,l); c2=cmplxarray1(-l,l); c1=cmplxarray1(-l,l); rotmatrix(l,l,beta,d); for(i=0;i