#include #include #include "Fourier.h" #include "SphericalGrid.h" #include "cmdLineParser.h" #include int main(int argc,char* argv[]){ // Read the parameters in from the command line cmdLineString In,Out; char* paramNames[]={"in","out"}; cmdLineReadable* params[]={&In,&Out}; cmdLineParse(argc-1,&argv[1],paramNames,sizeof(paramNames)/sizeof(char*),params); if(!In.set){ fprintf(stderr,"You must specify an input file\n"); return EXIT_FAILURE; } if(!Out.set){ fprintf(stderr,"You must specify an output file\n"); return EXIT_FAILURE; } SphericalGrid<> in,out,temp; FourierKeyS2<> key,tempKey; HarmonicTransform<> hForm; // Read in the input spherical function if(!in.read(In.value)){ fprintf(stderr,"Failed to read in: %s\n",In.value); return EXIT_FAILURE; } // Kill off the 0th order frequency component and normalize so that // the function has unit norm. hForm.ForwardFourier(in,key); key(0,0)=0; hForm.InverseFourier(key,in); float l=float(sqrt(in.squareNorm())); for(int i=0;i