S2kit
1.1
Toolkit for working with functions defined on the sphere
|
Example of source code to computie forward spherical harmonic transform using the seminaive and naive algorithms. More...
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <fftw3.h>
#include "s2kit/FST_semi_memo.h"
#include "s2kit/cospml.h"
#include "s2kit/weights.h"
#include "s2kit/util.h"
#include "util/csecond.h"
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
Example of source code to computie forward spherical harmonic transform using the seminaive and naive algorithms.
Computes the spherical coefficients of the function, whose sample values are given in the named input file, and writes those coefficients in the named output file.
The code will pre-compute associated Legendre functions before doing transform. This won't a be part of what's being timed.
In its current state, assuming that will seminaive at all orders. If you wish to change this, modify the cutoff
variable in this file, i.e. cutoff = ...
at what order to switch from seminaive to naive algorithm.
Sample call:
The format of the input sample file will be an interleaved real/imaginary parts of the function samples arranged in "latitude-major" format, i.e. the function will be sampled in this order:
output_format
is an optional argument:
0
- coefficients in "code" order (interleaved real/imaginary), i.e. suitable for test_s2_semi_memo_inv.c;
1
- coefficients in prettier "human" order (verbose), i.e. if f_{l,m}
is the coefficient of degree l
, order m
, then the coefficients will be arranged this way:
The default output format is "code" order. To help you out, there is a function IndexOfHarmonicCoeff() which returns the array index of the coefficient f_{l,m}
.
Definition in file test_s2_semi_memo_fwd.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 71 of file test_s2_semi_memo_fwd.c.