next up previous contents
Next: Function: read_real_data_file() Up: GRASP Routines: Waveforms from Previous: Function: minustwoSlm()   Contents

Function: read_modes()

0 int read_modes(const char *filename, float **x, float **ReA, float **ImA, int *number_of_points, int *MaxL, int ReadX)
Read the modes $A_{lm}(v)$ from a data file. The data file is assumed to be of the form
2 1  
$v_0$ (Re$(A_{21})_0$,Im$(A_{21})_0$)
$v_1$ (Re$(A_{21})_1$,Im$(A_{21})_1$)
   
2 2  
$v_0$ (Re$(A_{22})_0$,Im$(A_{22})_0$)
   
2 1  
$v_0$ (Re$(A_{31})_0$,Im$(A_{31})_0$)
   

There is some consistency checking done during the reading of the file (e.g. the number of points per mode have to agree for all modes, etc.).

filename: The name of the file containing the modes $A_{lm}$. If NULL then the default file is use.
x: Input/Output. The array *v[0..number_of_points-1] will contain the values $v_0$ .... If **x == NULL allocate the memory. If ReadX is false do not read the v-values (they still have to be in the data file though).
ReA: Input/Output. The array *ReA will contain the real parts of the $A_{lm}$'s. If set to NULL memory is allocated and a pointer to it will be returned.
ImA: Input/Output. The array *ReA will contain the imaginary parts of the $A_{lm}$'s. If NULL allocate memory.
number_of_points: Input/Output. The number of points read. If zero the routine reads all available data points. If memory is provided by the user for any of the arrays mentioned above, this must be the maximum number of points you can store.
MaxL: Input/Output. The number of $l$ modes to read. If zero read all of them (currently five). The output value is the number of successfully read $l$'s.
ReadX: Input. If false (=0) don't save the v-values in *x.
Return value: An error code described in Section [*].
Author: Serge Droz, droz@physics.uoguelph.ca
Comments: You must set the environment variable GRASP_PARAMETERS to the name of the GRASP parameter directory.


next up previous contents
Next: Function: read_real_data_file() Up: GRASP Routines: Waveforms from Previous: Function: minustwoSlm()   Contents
Bruce Allen 2000-11-19