]> Pileus Git - ~andy/rsl/blob - doc/internal_routines.html
Initial import
[~andy/rsl] / doc / internal_routines.html
1 <head>
2 </head>
3
4 <body>
5 <a HREF="index.html"> <IMG SRC="rsl.gif"> </a>
6 <hr>
7 <center>
8
9 <h1>RSL Internal Routines</h1>
10 </center>
11 <hr>RSL internal routines are routines used within the library and not meant for use in RSL application programs. Most of these routines are used only within the source code file that they exist, but a few are used in several different source code files. 
12
13 <p>The routines are listed by the RSL source code file in which they can be found. 
14
15 <p>As of version 0.39, the source code for the wsr88d (v1.14), lassen (v1.1), nsig (v1.3), tg (v1.1), and mcgill (v1.1) libraries are included in RSL. This precludes the need to specify a long list of additional libraries during the link step when building application. Also, it simplifies the RSL installation procedure. Still needed are two routines: ppmtogif and ppmtopict, from the pbmplus package. 
16 <hr>
17
18 <h2>New in v0.41</h2>
19
20
21 <h2>gzip.c</h2>
22 int no_command(char *cmd);<br>
23 FILE *uncompress_pipe(FILE *fp);<br>
24 FILE *compress_pipe(FILE *fp); 
25 <hr>
26
27 <h2>column.c</h2>
28
29 <dl>
30 <dt><b>Column *compute_column_products(Column *c);</b> 
31 <dd>Compute the vertical structure values within the Column passed in the parameter list using the data values stored in the Column. Vertical_structure values computed are zmax,hzmax and the eth array (echo tops). The dBz, slant range and height values must exist within the Column before this routine is called. The array for echo top values must be allocated as well. 
32
33 <p>
34 <dt><b>Column *get_column_dbz(Volume *v,Column *c,float azim);</b> 
35 <dd>Retrieve the dBz values from the Volume v using the nearest neighbor technique along a straight vertical line. The vertical line is positioned at the azimuth passed in the parameter list and the ground range that should already exist in Column c. The slant range array, height array and memory allocation for the dBz array should already exist as well. 
36
37 <p>
38 <dt><b>Column *get_column_range_coord(Volume *v,Column *c, float grange);</b> 
39 <dd>Using the elevation angles from Volume v and the ground range (grange), calculate the slant ranges and heights for all points at the intersections of the Sweeps in Volume v and a straight vertical line at the ground range value grange. 
40
41 <p>
42 <dt><b>Column *new_column(int nsteps,float ett_start,float ett_int,int num_ett);</b> 
43 <dd>Allocate space for a Column data structure and arrays within the Column. The value nsteps is the length of the dbz,height and slant range arrays. The lenght of the echo top array, and thus the number of thresholds, is num_ett. The first echo top threshold is ett_start followed by additional thresholds every ett_int. 
44
45 <p>
46 <dt><b>void copy_column_range_coord(Column *from,Column *to);</b> 
47 <dd>Copy the range dependent coordinates from Column from to Column to. Range dependent variables in the Column data structure are ground_range, the h array (height) and slant_range array. No memory space is allocated for the Column to. </dl>
48
49
50 <p>
51 <hr>
52
53 <h2>endian.c</h2>
54 int big_endian(void);<br>
55 int little_endian(void);<br>
56 void swap_4_bytes(void *word);<br>
57 void swap_2_bytes(void *word); 
58 <hr>
59
60 <h2>image_gen.c</h2>
61 None. 
62 <hr>
63
64 <h2>interp.c</h2>
65
66 <b>double dir_angle_diff(float x,float y);</b> Returns signed difference between angles x and y. Returns a positive value if y &gt; x and a negative value if y 
67 <b>double from_dB(double db);</b> 
68 Convert a decibel scale value to a linear scale value. 
69
70 <p>
71 <b>double get_linear_value_from_sweep(Sweep *sweep,float srange,float azim,float limit);</b> 
72 Return an interpolate value between two rays within a sweep. Interpolation is done along the azimuth coordinate. No interpolation is done in the range direction. The routine expects to work with values that are in a decibel scale (reflectivity data), but it <b>returns values in linear scale</b>. 
73
74 <p>
75 <b>double to_dB(double value);</b> 
76 Convert a linear scale value to a decibel scale value. 
77
78 <p>
79 <b>float get_dist(float r1,float a1,float e1,float r2,float a2,float e2);</b> 
80 Compute the distence between two points in space given their spherical coordinates. r1 (range),a1 (azimuth angle) and e1 (elevation angle) are the coordinates for the first point. Angles are measured in degrees. 
81
82 <p>
83 <b>void get_surrounding_ray(Ray **ccwise,Ray **cwise,Sweep *s,float ray_angle);</b> 
84 Return the two rays within a sweep that surround the angle ray_angle. The ray that is counter-clockwise to ray_angle is returned in ccwise. The ray that is clockwise to ray_angle is returned in cwise. **ccise and **cwise are pointers to ray pointers. For example, if r is of type *Ray, then &amp;r should be passed for either **ccwise or **cwise. 
85
86 <p>
87 <b>void get_surrounding_sweep(Sweep **below,Sweep **above, Volume *v,float elev);</b> 
88 Return the sweeps that are above and below the elevation angle elev. **below and **above are pointers to Sweep pointers. if s is of type *Sweep, pass &amp;s as either **above or **below. If the conditionexist where a sweep does not exist for either the above or below case, then a the appropriate pointer is set to NULL. 
89
90 <p>
91 <b>void get_xyz_coord(double *x,double *y,double *z,double range,double azim,double elev);</b> 
92 Convert a set of spherical coordinates to a set of cartesian coordinates. 
93
94 <p>
95 <hr>
96
97 <h2>lassen_to_radar.c</h2>
98 void lassen_load_sweep(Sweep *s, int isweep_num, unsigned int mask, int early, s truct sweep_index *ptr); 
99 <hr>
100
101 <h2>mcgill.c</h2>
102 mcgFile_t *mcgFileOpen(int *code, char *filename);<br>
103 int mcgFileClose(mcgFile_t *file);<br>
104 int mcgRecordRead(mcgRecord_t *record, mcgFile_t *file);<br>
105 mcgSegmentID mcgSegmentKeyIdentify(int key);<br>
106 int mcgRayBuild(mcgRay_t *ray, mcgFile_t *file); 
107 <hr>
108
109 <h2>mcgill_to_radar.c</h2>
110 void RayFill(Ray *rsl_ray, mcgRay_t *mcg_ray);<br>
111 void Ray_headerInit(Ray *ray, mcgHeader_t *head, mcgRay_t *mcg_ray, int ray_num, int num_bins_rsl);<br>
112 void Sweep_headerInit(Sweep *sweep, mcgRay_t *mcg_ray, int nrays);<br>
113 void Volume_headerInit(Volume *volume, short vol_scan_format);<br>
114 void Radar_headerInit(Radar *radar, mcgHeader_t *mcg_head); 
115 <hr>
116
117 <h2>nsig_to_radar.c</h2>
118 Radar * nsig_to_radar_headers_only(char * filename);<br>
119 Radar * n2r(char * filename, int data_flag, int misc_flag);<br>
120 int Rset_header(Radar * Radptr, nsig_file * nsfile);<br>
121 int Vset_header( Volume * volptr, int n, char * string);<br>
122 int Swset_header( Sweep * sweepptr, int sweepnum, float elev, float beam_width, int nrays);<br>
123 int set_mask(int k, int * array);<br>
124 void sec2dhms(long sec, int * d, int * h, int * m, int *s);<br>
125 int rtype2ntype( int j );<br>
126 int ntype2rtype( int j );<br>
127 char * get_type_string(int j);<br>
128 int Rayset_header(Ray * rayptr, nsig_ray_data * ray_data_ptr, nsig_ingest_data_header * idhdptr, Fixed_Header * fhptr);<br>
129 void Set_FixedHeader(Fixed_Header * FHptr, nsig_file * nsfile); 
130 <hr>
131
132 <h2>print_histogram_catelog.c</h2>
133 void print_histogram_catalog(Histogram *histogram, int min_range, int max_range, char *da te, char *filename); 
134 <hr>
135
136 <h2>radar.c</h2>
137 void print_vect(float v[], int istart, int istop);<br>
138 void radar_load_date_time(Radar *radar); 
139
140 <p>
141 <hr>
142
143 <h2>radar_to_uf.c</h2>
144 none. 
145 <hr>
146
147 <h2>range.c</h2>
148 none. 
149 <hr>
150
151 <h2>ray_indexes.c</h2>
152 static void set_high_and_low_pointers(Sweep *s);<br>
153 static Azimuth_hash *hash_add_node(Azimuth_hash *node, Ray *ray); 
154 <hr>
155
156 <h2>read_write.c</h2>
157 Radar *set_default_function_pointers(Radar *radar); 
158 <hr>
159
160 <h2>sort_rays.c</h2>
161 static int ray_sort_compare(Ray **r1, Ray **r2);<br>
162 static int ray_sort_compare_by_time(Ray **r1, Ray **r2);<br>
163 static int sweep_sort_compare(Sweep **s1, Sweep **s2); 
164 <hr>
165
166 <h2>toga_to_radar.c</h2>
167 void fill_ray(Ray *ray, tg_file_str *tg_file, int datatype);<br>
168 void fill_ray_header(Ray *ray, tg_file_str *tg_file, int elev_num, int datatype);<br>
169 void fill_sweep_header(Radar *radar, tg_map_head_str *map_head, int sweep_num, int nrays);<br>
170 void fill_volume_header(Radar *radar, tg_map_head_str *map_head);<br>
171 void fill_radar_header(Radar *radar, tg_map_head_str *map_head); 
172 <hr>
173
174 <h2>uf_to_radar.c</h2>
175 Volume *reset_nsweeps_in_volume(Volume *volume);<br>
176 Radar *reset_nsweeps_in_all_volumes(Radar *radar);<br>
177 Volume *copy_sweeps_into_volume(Volume *new_volume, Volume *old_volume);<br>
178 void uf_into_radar(UF_buffer uf, Radar **the_radar);<br>
179 void swap_uf_buffer(UF_buffer uf);<br>
180 static enum UF_type type_of_uf_file(char *infile); 
181 <hr>
182
183 <h2>volume.c</h2>
184
185 <dl>
186 <dt><b>Azimuth_hash *the_closest_hash(Azimuth_hash *hash, float ray_angle);</b> 
187 <dd>Return the hash pointer that contains the closest Ray to the angle ray_angle. The hash passed to this routine can be any hash within the a Sweep's hashing table, but for the quickest search it should be the hash pointer with the index returned by the internal routine hash_bin. 
188
189 <p>
190 <dt><b>double angle_diff(float x, float y);</b> 
191 <dd>Return the absolute value of the difference between angle x and angle y. Angles are measure in degrees and the return value has a range from 0 to 180. 
192
193 <p>
194 <dt><b>double ccwise_angle_diff(float x,float y);</b> 
195 <dd>Returns the counter-clockwise angle difference of x to y. Values returned will always be positive and exist in the range from 0 to 360. Examples: if x = 345 and y = 355 the value returned will be 350. On the other hand if x = 345 and y = 335 then the value returned will be 10. 
196
197 <p>
198 <dt><b>double cwise_angle_diff(float x,float y);</b> 
199 <dd>Returns the clockwise angle difference of x to y. Values returned will always be positive and exist in the range from 0 to 360. 
200
201 <p>
202 <dt><b>int get_closest_sweep_index(Volume *v,float sweep_angle);</b> 
203 <dt><b>int hash_bin(Sweep *s,float angle);</b> </dl>
204
205 <hr>
206
207 <h2>wsr88d_to_radar.c </h2>
208 void float_to_range(float *x, Range *c, int n, Range (*function)(float x) );<br>
209 int wsr88d_load_sweep_into_volume(Wsr88d_sweep ws, Volume *v, int nsweep, unsigned int vmask); 
210 <hr>
211
212 <h2>WSR88D library (v1.14)</h2>
213 wsr88d.c<br>
214 wsr88d.h<br>
215 wsr88d_get_site.c<br>
216 wsr88d_locations.dat 
217 <hr>
218
219 <h2>Lassen library (v1.1)</h2>
220 accessvolhead.c<br>
221 cvrt.h<br>
222 freevol.c<br>
223 lassen.h<br>
224 portable.h<br>
225 radar.h <br>
226 radinfo.h<br>
227 raw.h<br>
228 read_head.c<br>
229 readvol.c<br>
230 sunrise_head.h<br>
231 sunrise_time.h<br>
232 xdr.h 
233 <hr>
234
235 <h2>NSIG library (v1.3)</h2>
236 nsig.c<br>
237 nsig.h 
238
239 <h2>
240 TG library (v1.1)</h2>
241 toga.c<br>
242 toga.h 
243
244 <h2>
245 McGill library (v1.1)</h2>
246 mcgill.c<br>
247 mcgill.h 
248 </body>