]> Pileus Git - ~andy/rsl/blob - reverse.c
RSL v1.44
[~andy/rsl] / reverse.c
1 /*
2     NASA/TRMM, Code 910.1.
3     This is the TRMM Office Radar Software Library.
4     Copyright (C) 1996, 1997
5             John H. Merritt
6             Space Applications Corporation
7             Vienna, Virginia
8
9     This library is free software; you can redistribute it and/or
10     modify it under the terms of the GNU Library General Public
11     License as published by the Free Software Foundation; either
12     version 2 of the License, or (at your option) any later version.
13
14     This library is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17     Library General Public License for more details.
18
19     You should have received a copy of the GNU Library General Public
20     License along with this library; if not, write to the Free
21     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23 #include "rsl.h"
24 /*********************************************************************/
25 /*                                                                   */
26 /*                      RSL_reverse_sweep_order                      */
27 /*                                                                   */
28 /*********************************************************************/
29 Volume *RSL_reverse_sweep_order(Volume *v)
30 {
31 /*
32  *  Reverse the order of the sweeps within the volume.
33  *  This routine modifies the argument and does not allocate memory.
34  */
35
36   int i, j;
37   Sweep *s_tmp;
38
39   if (v == NULL) return v;
40   /* Yes, the follwing is integer divide by 2. */
41   for (i=0, j=v->h.nsweeps-1; i<v->h.nsweeps/2; i++, j--) {
42         s_tmp = v->sweep[i];
43         v->sweep[i] = v->sweep[j];
44         v->sweep[j] = s_tmp;
45   }
46
47   return v;
48 }