]> Pileus Git - ~andy/rsl/blob - doc/RSL_new.html
Initial import
[~andy/rsl] / doc / RSL_new.html
1 <head>
2 </head>
3
4 <body>
5 <a HREF="index.html"> <IMG SRC="rsl.gif"> </a>
6 <hr>
7
8
9 <h1>RSL_new_...</h1>
10
11 <hr>
12
13 <h3>Synopsis</h3>
14 <b>#include &quot;rsl.h&quot;</b> <br>
15 <b><a href=RSL_ray_struct.html>Ray</a> *RSL_new_ray(int max_bins);<br>
16 <a href=RSL_sweep_struct.html>Sweep</a> *RSL_new_sweep(int max_rays);<br>
17 <a href=RSL_volume_struct.html>Volume</a> *RSL_new_volume(</b><b>int max_sweeps);</b><br>
18 <b><a href=RSL_radar_struct.html>Radar</a> *RSL_new_radar(int nvolumes);</b> 
19
20 <h3>
21 <hr>Description</h3>
22 <b>RSL_new_radar</b> allocates memory for a <b>Radar</b>. It allocates space for it's header and space for <b>nvolumes</b> pointers to <b>Volume</b>, it does not assign anything to the new header. It does not allocate any volumes, just the pointers. You have to perform the allocation of volumes yourself. Do this by looping on <b>nvolumes</b> and calling <b>RSL_new_volume</b>. 
23
24 <p><b>nvolumes</b> does not represent the number of volumes in the radar structure. It represents the number of volume index slots or the maximum volume index. Reserved values DZ_INDEX, VR_INDEX, SW_INDEX, CZ_INDEX, ZT_INDEX, DR_INDEX, and LR_INDEX are the numbers 0 through 6. They are volume indexes. If you have 2 volumes (non NULL pointers) that are SW_INDEX and ZT_INDEX, you must be sure that <b>nvolumes</b> is, at least, ZT_INDEX+1. All the other volume pointers are NULL. It is perfectly valid to have NULL volume pointers. 
25
26 <p><b>RSL_new_volume</b> allocates memory for a <b>Volume</b>. It allocates space for it's header and space for <b>nsweep</b> pointers to <b>Sweep</b>, it does not assign anything to the new header. It does not allocate any sweeps, just the pointers. You have to perform the allocation of sweeps yourself. Do this by looping on <b>nsweeps</b> and calling <b>RSL_new_sweep</b>. 
27
28 <p><b>nsweeps</b> does not represent the number of non NULL sweep pointers. It is the number of index slots or the maximum sweep index. It is valid to have NULL sweep pointers. 
29
30 <p><b>RSL_new_sweep</b> allocates memory for a <b>Sweep</b>. It allocates space for it's header and space for <b>nrays</b> pointers to <b>Ray</b>. It does not allocate any rays, just the pointers, nor does it assign any values to the new header. You have to perform the allocation of rays yourself. Do this by looping on <b>nrays</b> and calling <b>RSL_new_ray</b>. 
31
32 <p><b>nrays</b> does not represent the number of non NULL ray pointers. It is the number of index slots or the maximum ray index. It is valid to have NULL ray pointers. 
33
34 <p><b>RSL_new_ray</b> allocates memory for a <b>Ray</b>. It allocates space for it's header and space for a <b>Range</b> array of size <b>nbins</b>. It does not assign any values to the header. Since, the <b>Range</b> type is not a pointer, this function allocates an array of <b>Range</b> of size <b>nbins</b>. Currently, <b>Range</b> is just an alias for <b>unsigned</b> <b>char</b>. 
35 <hr>
36
37 <h3>Return value</h3>
38 Upon successful completion, a pointer to the appropriate structure is returned. Otherwise, a NULL pointer is returned and errno is set. 
39 <hr>
40
41 <h3>See also</h3>
42 <a href=../examples/Example_RSL_new.c>Example</a><br>
43 <a href=RSL_free.html>RSL_free_volume</a>, <a href=RSL_free.html>RSL_free_sweep</a>, <a href=RSL_free.html>RSL_free_ray</a> <br>
44 <a href=RSL_copy.html>RSL_copy_volume</a>, <a href=RSL_copy.html>RSL_copy_sweep</a>, <a href=RSL_copy.html>RSL_copy_ray</a> 
45 <hr>
46
47 <p>Author: <a href=john.merritt.html>John H. Merritt</a> 
48 </body>