]> Pileus Git - ~andy/rsl/commitdiff
Merge branch 'master' into aweather
authorAndy Spencer <andy753421@gmail.com>
Fri, 24 Jun 2011 06:02:58 +0000 (06:02 +0000)
committerAndy Spencer <andy753421@gmail.com>
Fri, 24 Jun 2011 07:26:41 +0000 (07:26 +0000)
Conflicts:
Makefile.am
configure.ac
data/wsr88d_locations.dat
src/gzip.c
src/rsl.h
src/wsr88d_m31.c

126 files changed:
.gitignore
Makefile.am
autogen.sh [new file with mode: 0755]
colors/Makefile.am [deleted file]
configure.ac [moved from configure.in with 75% similarity]
data/Makefile.am [new file with mode: 0644]
data/colors/blu_dz.clr [moved from colors/blu_dz.clr with 100% similarity]
data/colors/blu_height.clr [moved from colors/blu_height.clr with 100% similarity]
data/colors/blu_hh.clr [moved from colors/blu_hh.clr with 100% similarity]
data/colors/blu_rainfall.clr [moved from colors/blu_rainfall.clr with 100% similarity]
data/colors/blu_reflectivity.clr [moved from colors/blu_reflectivity.clr with 100% similarity]
data/colors/blu_reflectivity1.clr [moved from colors/blu_reflectivity1.clr with 100% similarity]
data/colors/blu_spectral_width.clr [moved from colors/blu_spectral_width.clr with 100% similarity]
data/colors/blu_sw.clr [moved from colors/blu_sw.clr with 100% similarity]
data/colors/blu_velocity.clr [moved from colors/blu_velocity.clr with 100% similarity]
data/colors/blu_vr.clr [moved from colors/blu_vr.clr with 100% similarity]
data/colors/blu_zdr.clr [moved from colors/blu_zdr.clr with 100% similarity]
data/colors/grn_dz.clr [moved from colors/grn_dz.clr with 100% similarity]
data/colors/grn_height.clr [moved from colors/grn_height.clr with 100% similarity]
data/colors/grn_hh.clr [moved from colors/grn_hh.clr with 100% similarity]
data/colors/grn_rainfall.clr [moved from colors/grn_rainfall.clr with 100% similarity]
data/colors/grn_reflectivity.clr [moved from colors/grn_reflectivity.clr with 100% similarity]
data/colors/grn_reflectivity1.clr [moved from colors/grn_reflectivity1.clr with 100% similarity]
data/colors/grn_spectral_width.clr [moved from colors/grn_spectral_width.clr with 100% similarity]
data/colors/grn_sw.clr [moved from colors/grn_sw.clr with 100% similarity]
data/colors/grn_velocity.clr [moved from colors/grn_velocity.clr with 100% similarity]
data/colors/grn_vr.clr [moved from colors/grn_vr.clr with 100% similarity]
data/colors/grn_zdr.clr [moved from colors/grn_zdr.clr with 100% similarity]
data/colors/red_dz.clr [moved from colors/red_dz.clr with 100% similarity]
data/colors/red_height.clr [moved from colors/red_height.clr with 100% similarity]
data/colors/red_hh.clr [moved from colors/red_hh.clr with 100% similarity]
data/colors/red_rainfall.clr [moved from colors/red_rainfall.clr with 100% similarity]
data/colors/red_reflectivity.clr [moved from colors/red_reflectivity.clr with 100% similarity]
data/colors/red_reflectivity1.clr [moved from colors/red_reflectivity1.clr with 100% similarity]
data/colors/red_spectral_width.clr [moved from colors/red_spectral_width.clr with 100% similarity]
data/colors/red_sw.clr [moved from colors/red_sw.clr with 100% similarity]
data/colors/red_velocity.clr [moved from colors/red_velocity.clr with 100% similarity]
data/colors/red_vr.clr [moved from colors/red_vr.clr with 100% similarity]
data/colors/red_zdr.clr [moved from colors/red_zdr.clr with 100% similarity]
data/wsr88d_locations.dat [moved from wsr88d_locations.dat with 100% similarity]
doc/Makefile.am
examples/Makefile.am
examples/any_to_gif.c
examples/any_to_uf.c
examples/any_to_ufgz.c
examples/bscan.c
examples/cappi_image.c
examples/killer_sweep.c
examples/kwaj_subtract_one_day.c
examples/print_hash_table.c
examples/print_header_info.c
examples/qlook.c
examples/sector.c
examples/test_get_win.c
examples/wsr_hist_uf_test.c
gen-win32.sh [new file with mode: 0755]
gen.sh [new file with mode: 0755]
mkinstalldirs [deleted file]
src/Makefile.am [new file with mode: 0644]
src/africa.c [moved from africa.c with 100% similarity]
src/africa.h [moved from africa.h with 100% similarity]
src/africa_to_radar.c [moved from africa_to_radar.c with 100% similarity]
src/anyformat_to_radar.c [moved from anyformat_to_radar.c with 100% similarity]
src/cappi.c [moved from cappi.c with 100% similarity]
src/carpi.c [moved from carpi.c with 100% similarity]
src/cube.c [moved from cube.c with 100% similarity]
src/dorade.c [moved from dorade.c with 89% similarity]
src/dorade.h [moved from dorade.h with 100% similarity]
src/dorade_print.c [moved from dorade_print.c with 100% similarity]
src/dorade_to_radar.c [moved from dorade_to_radar.c with 99% similarity]
src/edge_to_radar.c [moved from edge_to_radar.c with 100% similarity]
src/endian.c [moved from endian.c with 100% similarity]
src/farea.c [moved from farea.c with 100% similarity]
src/fix_headers.c [moved from fix_headers.c with 100% similarity]
src/fraction.c [moved from fraction.c with 100% similarity]
src/get_win.c [moved from get_win.c with 100% similarity]
src/gts.c [moved from gts.c with 100% similarity]
src/gzip.c [moved from gzip.c with 89% similarity]
src/hdf_to_radar.c [moved from hdf_to_radar.c with 100% similarity]
src/histogram.c [moved from histogram.c with 100% similarity]
src/image_gen.c [moved from image_gen.c with 98% similarity]
src/interp.c [moved from interp.c with 100% similarity]
src/lassen.c [moved from lassen.c with 100% similarity]
src/lassen.h [moved from lassen.h with 100% similarity]
src/lassen_to_radar.c [moved from lassen_to_radar.c with 100% similarity]
src/mcgill.c [moved from mcgill.c with 100% similarity]
src/mcgill.h [moved from mcgill.h with 100% similarity]
src/mcgill_to_radar.c [moved from mcgill_to_radar.c with 100% similarity]
src/nsig.c [moved from nsig.c with 99% similarity]
src/nsig.h [moved from nsig.h with 100% similarity]
src/nsig2_to_radar.c [moved from nsig2_to_radar.c with 100% similarity]
src/nsig_to_radar.c [moved from nsig_to_radar.c with 99% similarity]
src/prune.c [moved from prune.c with 100% similarity]
src/radar.c [moved from radar.c with 99% similarity]
src/radar_to_hdf_1.c [moved from radar_to_hdf_1.c with 100% similarity]
src/radar_to_hdf_2.c [moved from radar_to_hdf_2.c with 100% similarity]
src/radar_to_uf.c [moved from radar_to_uf.c with 97% similarity]
src/radtec.c [moved from radtec.c with 100% similarity]
src/radtec.h [moved from radtec.h with 100% similarity]
src/radtec_to_radar.c [moved from radtec_to_radar.c with 100% similarity]
src/rainbow.c [moved from rainbow.c with 99% similarity]
src/rainbow.h [moved from rainbow.h with 100% similarity]
src/rainbow_to_radar.c [moved from rainbow_to_radar.c with 96% similarity]
src/range.c [moved from range.c with 100% similarity]
src/rapic_parse.y [moved from rapic.y with 100% similarity]
src/rapic_routines.c [moved from rapic_routines.c with 100% similarity]
src/rapic_routines.h [moved from rapic_routines.h with 100% similarity]
src/rapic_scan.l [moved from rapic-lex.l with 98% similarity]
src/rapic_to_radar.c [moved from rapic_to_radar.c with 87% similarity]
src/ray_indexes.c [moved from ray_indexes.c with 100% similarity]
src/read_write.c [moved from read_write.c with 91% similarity]
src/reverse.c [moved from reverse.c with 100% similarity]
src/rsl.h [moved from rsl.h with 97% similarity]
src/sort_rays.c [moved from sort_rays.c with 100% similarity]
src/toga.c [moved from toga.c with 100% similarity]
src/toga.h [moved from toga.h with 100% similarity]
src/toga_to_radar.c [moved from toga_to_radar.c with 100% similarity]
src/toolkit_1BC-51_appl.h [moved from toolkit_1BC-51_appl.h with 100% similarity]
src/toolkit_memory_mgt.c [moved from toolkit_memory_mgt.c with 100% similarity]
src/uf_to_radar.c [moved from uf_to_radar.c with 95% similarity]
src/volume.c [moved from volume.c with 100% similarity]
src/wsr88d.c [moved from wsr88d.c with 100% similarity]
src/wsr88d.h [moved from wsr88d.h with 99% similarity]
src/wsr88d_get_site.c [moved from wsr88d_get_site.c with 100% similarity]
src/wsr88d_m31.c [moved from wsr88d_m31.c with 98% similarity]
src/wsr88d_to_radar.c [moved from wsr88d_to_radar.c with 100% similarity]

index 80ea0acd59931df0a72ca329a376eb82d8e29771..7cb2cb54837c2bdfc835bf0c21a60ce39405e264 100644 (file)
@@ -1,8 +1,10 @@
 *.bz2
+*.exe
 *.gz
 *.la
 *.lo
 *.o
+*.swp
 *~
 .deps/
 .libs/
@@ -26,10 +28,11 @@ install-sh
 libtool
 local
 ltmain.sh
+m4/
 missing
-rapic-lex.c
-rapic.c
-rapic.h
+src/rapic_parse.c
+src/rapic_parse.h
+src/rapic_scan.c
 stamp-h1
 tags
 valgrind.out
index 3c106a8e4f2bffdd291a1c4f2f935b72645e3229..95595fa8d0d86cb7b349d7e0b53fffea64d66494 100644 (file)
@@ -1,73 +1,5 @@
-## Process w/ automake.  Or, autoreconf; make ##
-AUTOMAKE_OPTIONS = foreign
-SUBDIRS = . colors doc examples
-INCLUDES = -I. -I$(srcdir) -I$(prefix)/include -I$(prefix)/toolkit/include
+SUBDIRS = src examples data doc
 
-includedir = $(prefix)/include 
-colordir = $(libdir)/colors
+ACLOCAL_AMFLAGS = -I m4
 
-lib_LTLIBRARIES = librsl.la
-
-librsl_la_LDFLAGS = -version-info 1:41
-librsl_la_SOURCES = \
-$(rapic_c) $(radtec_c)\
-dorade.c dorade_print.c dorade_to_radar.c\
-lassen.c lassen_to_radar.c \
-edge_to_radar.c \
- radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
- range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
- carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
- ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
- mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
- gzip.c prune.c reverse.c fix_headers.c \
- nsig_to_radar.c nsig.c nsig2_to_radar.c \
- africa_to_radar.c africa.c \
- radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
- radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
-
-librsl_la_DEPENDENCIES = $(build_headers)
-
-build_headers = rsl.h wsr88d.h toolkit_1BC-51_appl.h
-
-headers = africa.h dorade.h lassen.h \
-          mcgill.h nsig.h radtec.h rainbow.h \
-          rapic_routines.h toga.h \
-                 $(build_headers)
-
-rapic_c =  rapic_to_radar.c rapic.y rapic-lex.l rapic_routines.c
-radtec_c = radtec_to_radar.c radtec.c
-
-
-rsl.h: Makefile
-       @for h in $(build_headers); do \
-       echo -n "Checking substitutions in header file $$h ... "; \
-       cp $$h $$h.in; \
-       sed -e 's/RSL_VERSION_STR.*/RSL_VERSION_STR \"$(VERSION)\"/' \
-         -e 's|#define COLORDIR.*|#define COLORDIR \"$(colordir)\"|' \
-         -e 's|#define WSR88D_SITE_INFO_FILE.*|#define WSR88D_SITE_INFO_FILE \"$(libdir)/wsr88d_locations.dat\"|' \
-    < $$h.in > $$h.new; \
-       if cmp -s $$h $$h.new; then \
-       rm $$h.new; \
-       echo "$$h remains untouched."; \
-    else \
-       mv $$h.new $$h; \
-       echo "substitutions made in $$h."; \
-    fi; \
-       rm -f $$h.in; \
-    done
-
-PREFIX = rapic
-LFLAGS = -P$(PREFIX)
-YFLAGS = -d -p $(PREFIX)
-LEX_OUTPUT_ROOT = lex.$(PREFIX)
-
-
-install-exec-hook:
-       $(INSTALL) -d  $(includedir)
-       $(INSTALL) -m 644 rsl.h $(includedir)
-       $(INSTALL) -m 644 toolkit_1BC-51_appl.h $(includedir)
-       $(INSTALL) -m 644 wsr88d_locations.dat $(libdir)
-
-EXTRA_DIST = CHANGES Copyright GPL LGPL wsr88d_locations.dat rapic.h
-
-DISTCLEANFILES = rapic.c rapic-lex.c
+EXTRA_DIST = CHANGES Copyright GPL LGPL
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..69c7d86
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+libtoolize
+aclocal
+autoheader
+automake -f -a -c
+autoconf
+
+# Run configure
+./configure "$@"
diff --git a/colors/Makefile.am b/colors/Makefile.am
deleted file mode 100644 (file)
index 709a367..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-colordir = $(prefix)/lib/colors
-color_DATA = *.???
-
-EXTRA_DIST = $(color_DATA)
similarity index 75%
rename from configure.in
rename to configure.ac
index 2791831873f6c3393eca4b5fc383dcf9ea74b354..aadd299edc6e0e4f2d773aefd04858fd6ed33294 100644 (file)
@@ -1,41 +1,38 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(rsl, v1.41)
-AC_CONFIG_SRCDIR(volume.c)
+# Process this file with autoconf to produce a configure script.
+AC_INIT(rsl, 1.41)
+AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign])
 
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
+AC_CONFIG_MACRO_DIR([m4])
 
-dnl Default for GVS and friends.
-AC_PREFIX_DEFAULT(/usr/local/trmm/GVBOX)
-
-dnl Checks for programs.
+# Checks for programs.
 AC_PROG_CC
 AM_PROG_LIBTOOL
-AC_PROG_YACC
 AM_PROG_LEX
+AC_PROG_YACC
 AC_PROG_LN_S
-AC_PROG_RANLIB
 
-dnl Checks for header files.
+# Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h malloc.h strings.h unistd.h)
 
-dnl Checks for typedefs, structures, and compiler characteristics.
+# Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_SIZE_T
 AC_STRUCT_TM
 
-dnl Checks for library functions.
-dnl AC_FUNC_SETVBUF_REVERSED
+# Checks for library functions.
+# AC_FUNC_SETVBUF_REVERSED
 AC_CHECK_FUNCS(mktime strdup strstr)
 
-dnl I would like lassen to be defined.  Override this in config.h.
+# I would like lassen to be defined.  Override this in config.h.
 AC_DEFINE(HAVE_LASSEN, 1,
     [For LASSEN capability.  Change this to '#undef HAVE_LASSEN', if you
-     don't want LASSEN.])
+     dont want LASSEN.])
 
-dnl Checks for libraries.
+# Checks for libraries.
 if test $prefix = NONE; then
   prefix=$ac_default_prefix
 fi
@@ -58,7 +55,7 @@ AC_CHECK_LIB(tsdistk,  TKopen,             ,,$LIBDIR)
 # Because -letor may depend on RSL being installed, just check for
 # the library libetor.a in a couple of places.
 
-dnl For autoheader, generate template for HAVE_LIBETOR.
+# For autoheader, generate template for HAVE_LIBETOR.
 AH_TEMPLATE(HAVE_LIBETOR,[For EDGE capability.  Change this
     to '#define HAVE_LIBETOR 1', if you have libetor -- the EDGE decoding
     library.])
@@ -86,5 +83,5 @@ if test "$YYWRAP" = ""; then
 fi
 
 AC_MSG_RESULT(LIBS = $LIBS)
-AC_CONFIG_FILES([Makefile colors/Makefile doc/Makefile examples/Makefile])
+AC_CONFIG_FILES([Makefile doc/Makefile data/Makefile examples/Makefile src/Makefile])
 AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644 (file)
index 0000000..816e2de
--- /dev/null
@@ -0,0 +1,5 @@
+colordir = $(datadir)/rsl/colors
+dist_color_DATA = colors/*.clr
+
+wsr88ddir = $(datadir)/rsl/
+dist_wsr88d_DATA = wsr88d_locations.dat
similarity index 100%
rename from colors/blu_dz.clr
rename to data/colors/blu_dz.clr
similarity index 100%
rename from colors/blu_hh.clr
rename to data/colors/blu_hh.clr
similarity index 100%
rename from colors/blu_sw.clr
rename to data/colors/blu_sw.clr
similarity index 100%
rename from colors/blu_vr.clr
rename to data/colors/blu_vr.clr
similarity index 100%
rename from colors/blu_zdr.clr
rename to data/colors/blu_zdr.clr
similarity index 100%
rename from colors/grn_dz.clr
rename to data/colors/grn_dz.clr
similarity index 100%
rename from colors/grn_hh.clr
rename to data/colors/grn_hh.clr
similarity index 100%
rename from colors/grn_sw.clr
rename to data/colors/grn_sw.clr
similarity index 100%
rename from colors/grn_vr.clr
rename to data/colors/grn_vr.clr
similarity index 100%
rename from colors/grn_zdr.clr
rename to data/colors/grn_zdr.clr
similarity index 100%
rename from colors/red_dz.clr
rename to data/colors/red_dz.clr
similarity index 100%
rename from colors/red_hh.clr
rename to data/colors/red_hh.clr
similarity index 100%
rename from colors/red_sw.clr
rename to data/colors/red_sw.clr
similarity index 100%
rename from colors/red_vr.clr
rename to data/colors/red_vr.clr
similarity index 100%
rename from colors/red_zdr.clr
rename to data/colors/red_zdr.clr
similarity index 100%
rename from wsr88d_locations.dat
rename to data/wsr88d_locations.dat
index cc67354761f64977cc09af49fa7466f8504f42cd..36f5ef71695b92435d84ffcd72dcdbc074cc17d3 100644 (file)
@@ -28,6 +28,7 @@
 93235  KDAX    SACRAMENTO      CA      38      30      4       -121    40      40      9
 13985  KDDC    DODGE_CITY      KS      37      45      39      -99     58      7       789
 22015  KDFX    LAUGHLIN_AFB    TX      29      16      22      -100    16      50      345
+33771  KDGX    JACKSON         MS      32      16      33      -89     58      48      151
 93771  KDIX    PHILADELPHIA    PA      39      56      49      -74     24      39      45
 14913  KDLH    DULUTH          MN      46      50      13      -92     12      35      435
 94984  KDMX    DES_MOINES      IA      41      43      53      -93     43      22      299
 53839  KHPX    FORT_CAMPBELL   KY      36      44      12      -87     17      6       176
 53857  KHTX    HUNTSVILLE      AL      34      55      50      -86     05      00      537
 3928   KICT    WICHITA         KS      37      39      17      -97     26      34      407
+53118  KICX    CEDAR_CITY      UT      37      35      9       -112    51      21      3231
 13841  KILN    CINCINNATI      OH      39      25      13      -83     49      18      322
 4833   KILX    LINCOLN         IL      40      9       2       -89     20      13      177
 93819  KIND    INDIANAPOLIS    IN      39      42      27      -86     16      49      241
 3984   KINX    TULSA           OK      36      10      30      -95     33      53      204
 23104  KIWA    PHOENIX         AZ      33      17      21      -111    40      12      412
+4844   KIWX    N_INDIANA       IN      41      21      0       -85     42      0       293
 3940   KJAN    JACKSON         MS      32      19      4       -90     4       48      91
 13889  KJAX    JACKSONVILLE    FL      30      29      5       -81     42      7       10
 53824  KJGX    ROBINS_AFB      GA      32      40      30      -83     21      4       159
 13957  KSHV    SHREVEPORT      LA      32      27      3       -93     50      29      83
 23034  KSJT    SAN_ANGELO      TX      31      22      17      -100    29      33      576
 53117  KSOX    SANTA_ANA_MT    CA      33      49      4       -117    38      9       923
+53906  KSRX    W_ARKANSAS      AR      35      16      48      -94     21      0       195
 92801  KTBW    TAMPA           FL      27      42      20      -82     24      6       12
 4102   KTFX    GREAT_FALLS     MT      47      27      35      -111    23      7       1132
 93805  KTLH    TALLAHASSEE     FL      30      23      51      -84     19      44      19
 3979   KTLX    OKLAHOMA_CITY   OK      35      19      59      -97     16      40      370
 3986   KTWX    TOPEKA          KS      38      59      49      -96     13      57      417
+54776  KTYX    MONTAGUE        NY      43      45      3       -75     40      30      563
 94047  KUDX    RAPID_CITY      SD      44      7       30      -102    49      47      919
 94981  KUEX    HASTINGS        NE      40      19      15      -98     26      31      602
 53856  KVAX    MOODY_AFB       GA      30      53      25      -83     0       6       54
 94234  KVBX    VANDENBRG_AFB   CA      34      50      17      -120    23      45      376
 3995   KVNX    VANCE_AFB       OK      36      44      27      -98     7       40      369
 53101  KVTX    LOS_ANGELES     CA      34      24      42      -119    10      47      831
+0      KVWX    EVANSVILLE      IN      38      16      12      -87     43      12      190
 53116  KYUX    YUMA            AZ      32      29      43      -114    39      24      53
 26548  PAHG    ANCHORAGE       AK      60      43      33      -151    21      5       74
 25404  PAIH    MIDDLETON_IS    AK      59      27      41      -146    18      11      20
 24690  PAPD    FAIRBANKS       AK      65      2       6       -147    30      6       790
 41417  PGUA    ANDERSEN_AFB    GU      13      27      16      144     48      30      80
 22548  PHKI    SOUTH_KAUAI     HI      21      53      39      -159    33      8       55
-43216  RKSG    CMP_HUMPHRYS    KOR     36      57      21      127     1       16      16
-42219  RODN    KADENA          OKI     26      18      7       127     54      35      66
-33771  KDGX    JACKSON         MS      32      16      33      -89     58      48      151
-53118  KICX    CEDAR_CITY      UT      37      35      9       -112    51      21      3231
-4844   KIWX    N_INDIANA       IN      41      21      0       -85     42      0       293
-53906  KSRX    W_ARKANSAS      AR      35      16      48      -94     21      0       195
-54776  KTYX    MONTAGUE        NY      43      45      3       -75     40      30      563
-0      KVWX    EVANSVILLE      IN      38      16      12      -87     43      12      190
 0      PHKM    KOHALA          HI      20      7       12      -155    46      12      1162
 0      PHMO    MOLOKAI         HI      21      7       12      -157    10      12      415
 0      PHWA    HAWAII          HI      19      4       48      -155    34      12      421
+43216  RKSG    CMP_HUMPHRYS    KOR     36      57      21      127     1       16      16
+42219  RODN    KADENA          OKI     26      18      7       127     54      35      66
 0      TJUA    SAN_JUAN        PR      18      7       12      -66     4       48      931
index 6acc059974902c3220ecd7d80fd85a1d01791a95..d4fc3fd6aa90fbba6a5f72f44a3631f30e6e6cf7 100644 (file)
@@ -1,12 +1,3 @@
 AUTOMAKE_OPTIONS = foreign
 
-docdir = $(prefix)/doc/$(PACKAGE)
-doc_DATA = *.html *.gif *.jpg
-
-EXTRA_DIST = $(doc_DATA) *.fig 
-
-install-exec-hook:
-       -mkdir $(prefix)/doc
-       -mkdir $(docdir)
-       $(INSTALL) -m 444 ../README $(docdir)
-       $(INSTALL) -m 444 ../CHANGES $(docdir)
+dist_doc_DATA = *.html *.gif *.jpg *.fig ../README ../CHANGES
index 7bcf7454152aedbaeef1a972079ed9e2fae7e854..6fcfdc503572e3f9ac43502f8a07da34f81242fd 100644 (file)
@@ -1,24 +1,16 @@
-## Use automake to generate Makefile.in from this file ##
+LIBS = $(top_srcdir)/src/librsl.la
+AM_CFLAGS = -I$(top_srcdir)/src
 
-AUTOMAKE_OPTIONS = foreign
-
-INCLUDES = -I$(prefix)/include
-LOCAL_LIB = ../.libs/librsl.a
-LDADD = @LIBS@ $(LOCAL_LIB) 
 bin_PROGRAMS = any_to_gif any_to_uf qlook
-any_to_gif_LDFLAGS = -static
-any_to_uf_LDFLAGS = -static
+
 # Additional program to build but not install
 noinst_PROGRAMS = any_to_ppm any_to_ufgz bscan \
- cappi_image dorade_main killer_sweep \
- kwaj_subtract_one_day lassen_to_gif print_hash_table \
- print_header_info sector test_get_win \
- wsr88d_to_gif wsr_hist_uf_test 
-
-
-# Only this one has more than one source.  All the others use the
-# default *.c format.
+       cappi_image dorade_main killer_sweep \
+       kwaj_subtract_one_day lassen_to_gif print_hash_table \
+       print_header_info sector test_get_win \
+       wsr88d_to_gif wsr_hist_uf_test 
 
+# qlook has multiple sources, the otherss use the default *.c format
 qlook_SOURCES = qlook.c qlook_usage.c adjust_gate_size.c
 
 EXTRA_DIST = run_tests
index 0ce222b27e362ad4d0d1336bbaeac77fdbf5c6db..7493029364379efe1f7181ab490bb2f79b3ffe60 100644 (file)
@@ -43,7 +43,7 @@ int usage(char **argv)
   fprintf(stderr, "       -b x = Make black for dbz below x. Default = 0 (no action).\n");
   exit(-1);
 }
-process_args(int argc, char **argv,
+void process_args(int argc, char **argv,
                         char **in_file, char **callid, int *verbose, int *wholevolume,
                         int *xdim, float *range, int *dbz_black)
 {
index eecca35ab41def6ff515bce3f0381c1dc9da0108..754aba90f4ce0b7522aa1db6f9a330f1c323f927 100644 (file)
@@ -12,7 +12,7 @@ void usage(char **argv)
   exit(-1);
 }
 
-process_args(int argc, char **argv,
+void process_args(int argc, char **argv,
                         char **in_file, char **out_file, char **first_file)
 {
   int c;
@@ -35,7 +35,7 @@ process_args(int argc, char **argv,
 }
 
 
-main (int argc, char **argv)
+int main (int argc, char **argv)
 {
 
   Radar *radar;
@@ -46,7 +46,7 @@ main (int argc, char **argv)
   RSL_radar_verbose_on();
   radar = RSL_anyformat_to_radar(infile, first_file);
   RSL_radar_to_uf(radar, outfile);
-
+  return 0;
 }
 
   
index cd8af70e47e430134026f5b6a5d57593d8cf7470..f01649e361020cf1f60f85bea5e210ae048e7821 100644 (file)
@@ -12,7 +12,7 @@ void usage(char **argv)
   exit(-1);
 }
 
-process_args(int argc, char **argv,
+void process_args(int argc, char **argv,
                         char **in_file, char **out_file, char **first_file)
 {
   int c;
@@ -35,7 +35,7 @@ process_args(int argc, char **argv,
 }
 
 
-main (int argc, char **argv)
+int main (int argc, char **argv)
 {
 
   Radar *radar;
@@ -46,7 +46,7 @@ main (int argc, char **argv)
 
   radar = RSL_anyformat_to_radar(infile, first_file);
   RSL_radar_to_uf_gzip(radar, outfile);
-
+  return 0;
 }
 
   
index 7f4dd415a547e7a9f48e45a8b464413f937ec949..62d58546fcff15fbc1506d2c4436f87cf3468dee 100644 (file)
 
 #include "rsl.h"
 
-usage()
+void usage()
 {
   fprintf(stderr,"Usage: bscan infile [callid]\n");
   exit(-1);
 }
 
-process_args(int argc, char **argv,
+void process_args(int argc, char **argv,
                         char **in_file, char **callid)
 {
  
@@ -38,12 +38,11 @@ process_args(int argc, char **argv,
 }
 
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
   char *infile, *callid;
 
   Radar *radar;
-  Volume *cappi_vol;
   char *index_str[] = {"DZ", "VR", "SW"};
 
   int i;
@@ -83,6 +82,5 @@ main(int argc, char **argv)
   RSL_bscan_volume((Volume *) radar->v[i], "bscan.ppm");
   printf("----> BSCAN complete.\n");
 
-  exit(0);
-
+  return 0;
 }
index 6cc6c3caef9031316764365cf7ac9391a367a69a..32ad7701f751da8dab1eb57d295e6eea2cc3d32f 100644 (file)
 #include <string.h>
 #include "rsl.h"
 
-usage(int argc, char **argv)
+void usage(int argc, char **argv)
 {
   fprintf(stderr,"Usage: %s infile [firstfile | callid]\n", argv[0]);
   exit(-1);
 }
 
-process_args(int argc, char **argv,
+void process_args(int argc, char **argv,
                         char **in_file, char **out_file)
 {
  
@@ -33,7 +33,7 @@ process_args(int argc, char **argv,
 }
 
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
   char *infile, *firstfile;
   char outfile[100];
@@ -77,7 +77,5 @@ main(int argc, char **argv)
        RSL_free_cappi(cappi);
   }
 
-
-  exit(0);
-
+  return 0;
 }
index dba5f14f30fb30a6ca773a24a1b584f1bf91faaa..d70766c84a347c1b4b0f96901e284fc310b87c7f 100644 (file)
@@ -42,6 +42,7 @@ void print_hash_table (Sweep *s)
   Azimuth_hash *index;
   float azim;
   float res;
+  int SWEEP_INDEX(Sweep *s); // From Volume.c
 
   if (s == NULL) return;
   sweep_index = SWEEP_INDEX(s);
index 5cf60111c50b9937a60572c9d3549101372e9d36..f35497865f78719af3f8df8b529302ad3a51cde5 100644 (file)
@@ -21,8 +21,8 @@ void usage(char **argv)
 /*                                                                    */
 /**********************************************************************/
 #include<time.h>
-void    *subtract_one_day(int month, int day, int year,
-                                                 int *m, int *d, int *y)
+void subtract_one_day(int month, int day, int year,
+       int *m, int *d, int *y)
 {
   /* Connocialize and subtract. */
   struct tm *t;
@@ -37,7 +37,6 @@ void    *subtract_one_day(int month, int day, int year,
   *m = t->tm_mon+1;
   *d = t->tm_mday;
   *y = t->tm_year+1900;
-  return;
 }
 
 /**********************************************************************/
index bfc12e406a5d058b4457936dc53b5074db549a6c..33537b24b2f5fb27d31a7acccf89e7c6dbf41630 100644 (file)
@@ -48,6 +48,7 @@ void print_hash_table (Sweep *s)
   Azimuth_hash *index;
   float azim;
   float res;
+  int SWEEP_INDEX(Sweep *s); // From Volume.c
 
   if (s == NULL) return;
   sweep_index = SWEEP_INDEX(s);
index 991ec75b72bf2ed797e9e2b3d9b2c28ac6579136..c5084161b598ba247355794c3166df4c8246d9c8 100644 (file)
@@ -8,13 +8,13 @@
 
 int qprint_ray;
 
-usage(char **argv)
+void usage(char **argv)
 {
   fprintf(stderr,"Usage: %s [-v] [-f nexrad_id] [infile]\n", argv[0]);
   exit(-1);
 }
 
-process_args(int argc, char **argv,
+void process_args(int argc, char **argv,
                         char **in_file, int *qprint_ray,
                         char **site)
 {
@@ -120,7 +120,7 @@ void print_header_for_volume(Volume *v)
 }
 
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
   char *infile;
 
@@ -183,6 +183,6 @@ for (i=0; i<radar->h.nvolumes; i++) {
        print_header_for_volume(radar->v[i]);
   }
 }
-exit(0);
 
+return 0;
 }
index f304da0482842abf94e2619b7be4dd8a65f4b55b..ec533738cf2aa8f0ec817d2900fa5ea1e961b226 100644 (file)
@@ -47,45 +47,38 @@ void make_pathname(char *filename, char *dir, char *pathname)
 /***********************************************************************/
 /*** DBW ***************************************************************/
 /***********************************************************************/
-main(int argc, char **argv) {
+int main(int argc, char **argv) {
 
     Radar       *radar;
     Volume      *dz_volume, *vr_volume;
     Volume      *dr_volume, *zt_volume;
-    Volume      *sw_volume, *qc_volume, *volume;
+    Volume      *sw_volume, *qc_volume;
 
     Sweep       *sweep;
-    Sweep       *dz_sweep, *qc_sweep;
-    Sweep       *dr_sweep, *zt_sweep;
-    Sweep       *vr_sweep, *sw_sweep;
 
     Ray         *ray;
-    int         reflectivity, qc_reflectivity, nvolumes;
+    int         reflectivity, qc_reflectivity;
     int         differential_reflectivity, total_reflectivity;
     int         velocity, spectral_width;
     int         make_catalog, make_gif, make_pgm; 
     int         make_uf, make_bscan;
     int         xdim, ydim, num_sweeps;
-    int         i,j,k,l,n, verbose, kk;
-    int         month, day, year, hour, min;
+    int         i,j, verbose;
     int         ncbins, width;
     int         print_azim;
     float       scale, dbz_offset;
     float       latitude, longitude;
 
-    float       sec;
     float       maxr;
-    float       nyquist, max_range, gate_size_adjustment;
+    float       max_range, gate_size_adjustment;
 
     char        tape_id[100];
     char        in_file[100], site_id[100];
-    char        filename[100], outfile[100], nexfile[100];
-    char        command[100], file_prefix[100], file_suffix[3];
-    char        dir_string[100], red[120], grn[120], blu[120];
-    char        time_string[14], site_string[10],img_base[20];
+    char        filename[100];
+    char        file_suffix[10];
+    char        time_string[14];
     char        pathname[256], gifdir[100], pgmdir[100], ufdir[100];
     char        *inpath;
-    FILE        *fp;
 
 /* Set default values */
 
@@ -734,7 +727,7 @@ main(int argc, char **argv) {
 
     if(verbose)
         printf("Finished!\n");
-    exit (0);
 
+    return 0;
 } /* End of main */
 
index a1527457c5adbf0bb38649bb6610104acb1f1950..017340b9c7b24e03b489b0b8636d0348d21ea760 100644 (file)
@@ -39,6 +39,7 @@ void print_hash_table (Sweep *s)
   Azimuth_hash *index;
   float azim;
   float res;
+  int SWEEP_INDEX(Sweep *s); // From Volume.c
 
   if (s == NULL) return;
   sweep_index = SWEEP_INDEX(s);
@@ -60,7 +61,6 @@ Sweep * get_sector(Sweep *s, float lo_azimuth, float hi_azimuth)
 {
   int   i, j;
   Sweep *new_sweep;
-  Ray   *saved_ray;
 
   if (s == NULL) return NULL;
 
index f01b8ccab46d53a096dced9905e2e51f47bf641b..4dcc6433729b721a3ff314f8bf404c4ebd8e31d3 100644 (file)
@@ -30,7 +30,7 @@ Sweep *load_sweep(Sweep *s)
 }
 
 
-main (int argc, char **argv)
+int main (int argc, char **argv)
 {
 
   Radar *new_radar, *tmp_radar, *radar;
@@ -122,7 +122,7 @@ main (int argc, char **argv)
   }
   RSL_free_radar(radar);
   printf("done\n");
-  exit (0);
 
+  return 0;
 }
 
index c7b129ae054202b0eeba22370389c9caeb7a1135..80849d259a116b8c762c8519d349dc9b9d251a09 100644 (file)
 #include "rsl.h"
 
 
-usage()
+void usage()
 {
   fprintf(stderr,"Usage: wsr_hist_uf_test infile [-s site_id]\n");
   exit(-1);
 }
 
-process_args(int argc, char **argv, char **in_file, char **site)
+void process_args(int argc, char **argv, char **in_file, char **site)
 {
   int c;
   
@@ -46,7 +46,7 @@ process_args(int argc, char **argv, char **in_file, char **site)
 }
 
 
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
   char *infile;
   char *site = NULL;
@@ -91,6 +91,5 @@ main(int argc, char **argv)
                                                                                 histogram, -30, 70, 0, 200);
   RSL_print_histogram(histogram, 0, 200, "hist_uf_to_radar.dat");
 
-  exit(0);
-
+  return 0;
 }
diff --git a/gen-win32.sh b/gen-win32.sh
new file mode 100755 (executable)
index 0000000..dc69c84
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+./autogen.sh \
+       --enable-shared \
+       --disable-static \
+       --host=i686-pc-mingw32 \
+       --prefix=/ \
+       CFLAGS="-g -Wall -Wno-unused -O3"
diff --git a/gen.sh b/gen.sh
new file mode 100755 (executable)
index 0000000..ad65a16
--- /dev/null
+++ b/gen.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+./autogen.sh \
+       --enable-shared \
+       --disable-static \
+       CFLAGS="-g -Wall -O3"
diff --git a/mkinstalldirs b/mkinstalldirs
deleted file mode 100644 (file)
index 5b16fbe..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $Id: mkinstalldirs,v 1.1 1999/12/06 05:21:06 merritt Exp $
-
-errstatus=0
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
-
-     if test ! -d "$pathcomp"; then
-        echo "mkdir $pathcomp"
-
-        mkdir "$pathcomp" || lasterr=$?
-
-        if test ! -d "$pathcomp"; then
-         errstatus=$lasterr
-        fi
-     fi
-
-     pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..e37d4d2
--- /dev/null
@@ -0,0 +1,41 @@
+AM_CPPFLAGS = -I. -I..
+AM_YFLAGS = -d
+
+lib_LTLIBRARIES = librsl.la
+
+include_HEADERS = rsl.h toolkit_1BC-51_appl.h
+
+headers = africa.h dorade.h lassen.h \
+         mcgill.h nsig.h radtec.h rainbow.h \
+         rapic_routines.h toga.h \
+         wsr88d.h \
+         $(include_HEADERS)
+
+librsl_la_LDFLAGS  = -version-info 1:41
+librsl_la_CPPFLAGS = -DDATADIR="\"$(datadir)/rsl\"" 
+librsl_la_SOURCES  = \
+       rapic_parse.y rapic_scan.l rapic_to_radar.c rapic_routines.c \
+       radtec.c radtec_to_radar.c \
+       dorade.c dorade_print.c dorade_to_radar.c \
+       lassen.c lassen_to_radar.c \
+       edge_to_radar.c \
+       radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
+       range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
+       carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
+       ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
+       mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
+       gzip.c prune.c reverse.c fix_headers.c \
+       nsig_to_radar.c nsig.c nsig2_to_radar.c \
+       africa_to_radar.c africa.c \
+       radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
+       radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
+
+# This should be speciifc to rapic,
+# but I'm not sure how to do that with autofoo
+AM_LFLAGS  = -P rapic
+AM_YFLAGS += -p rapic
+LEX_OUTPUT_ROOT = lex.rapic
+
+BUILT_SOURCES = rapic_parse.h
+
+DISTCLEANFILES = rapic_scan.c rapic_parse.c
similarity index 100%
rename from africa.c
rename to src/africa.c
similarity index 100%
rename from africa.h
rename to src/africa.h
similarity index 100%
rename from africa_to_radar.c
rename to src/africa_to_radar.c
similarity index 100%
rename from cappi.c
rename to src/cappi.c
similarity index 100%
rename from carpi.c
rename to src/carpi.c
similarity index 100%
rename from cube.c
rename to src/cube.c
similarity index 89%
rename from dorade.c
rename to src/dorade.c
index bf78a1c18d625aa6bfdbca998d8b866252e958df..7cd137f5cabfb66b75ffff9db25b32e6e2495fcf 100644 (file)
--- a/dorade.c
@@ -77,8 +77,14 @@ Comment_block *dorade_read_comment_block(FILE *in)
        perror("dorade_read_comment_block");
        return NULL;
   }
-  fread(cb->code, sizeof(cb->code), 1, in);
-  fread(&cb->len, sizeof(cb->len), 1, in);
+  if (fread(cb->code, sizeof(cb->code), 1, in) != 1) {
+       perror("dorade_read_comment_block: fread");
+       return NULL;
+  }
+  if (fread(&cb->len, sizeof(cb->len), 1, in) != 1) {
+       perror("dorade_read_comment_block: fread");
+       return NULL;
+  }
 
   /* Check for big endian data on little endian platform.  The smallest value
    * cb->len could have is 8 (length of cb->code + cb->len), so we put that in
@@ -96,7 +102,10 @@ Comment_block *dorade_read_comment_block(FILE *in)
        perror("dorade_read_comment_block: cb->comment");
        return cb;
   }
-  fread(cb->comment, sizeof(char), cb->len-8, in);
+  if (fread(cb->comment, sizeof(char), cb->len-8, in) != cb->len){
+       perror("dorade_read_comment_block: fread");
+       return NULL;
+  }
   return cb;
 }
 
@@ -115,7 +124,11 @@ Volume_desc    *dorade_read_volume_desc    (FILE *in)
        return NULL;
   }
 
-  fread(vd, sizeof(Volume_desc), 1, in);
+  if (fread(vd, sizeof(Volume_desc), 1, in) != 1) {
+       perror("dorade_read_volume_desc: fread");
+       return NULL;
+  }
+
   /* Now, convert from Big Endian. */
   if (do_swap) {
       vd->len = ntohl(vd->len);
@@ -158,7 +171,10 @@ Radar_desc     *dorade_read_radar_desc     (FILE *in)
        return NULL;
   }
 
-  fread(rd, sizeof(Radar_desc), 1, in);
+  if (fread(rd, sizeof(Radar_desc), 1, in) != 1) {
+       perror("dorade_read_radar_desc: fread");
+       return NULL;
+  }
   /* Now, convert from Big Endian. */
   if (do_swap) {
        swap_4_bytes(&rd->len);
@@ -217,7 +233,10 @@ Parameter_desc *dorade_read_parameter_desc (FILE *in)
        return NULL;
   }
 
-  fread(pd, sizeof(Parameter_desc), 1, in);
+  if (fread(pd, sizeof(Parameter_desc), 1, in) != 1) {
+       perror("dorade_read_parameter_desc: fread");
+       return NULL;
+  }
   /* Now, convert from Big Endian. */
   if (do_swap) {
        swap_4_bytes(&pd->len);
@@ -259,9 +278,12 @@ Cell_range_vector      *dorade_read_cell_range_vector     (FILE *in)
        return NULL;
   }
 
-  fread(&cv->code, sizeof(cv->code), 1, in);
-  fread(&cv->len, sizeof(cv->len), 1, in);
-  fread(&cv->ncells, sizeof(cv->ncells), 1, in);
+  if (fread(&cv->code, sizeof(cv->code), 1, in) != 1 ||
+      fread(&cv->len, sizeof(cv->len), 1, in) != 1 ||
+      fread(&cv->ncells, sizeof(cv->ncells), 1, in) != 1) {
+       perror("dorade_read_cell_range_vector: fread");
+       return NULL;
+  }
   if (do_swap) {
        swap_4_bytes(&cv->len);
        swap_4_bytes(&cv->ncells);
@@ -271,7 +293,10 @@ Cell_range_vector      *dorade_read_cell_range_vector     (FILE *in)
        perror("dorade_read_cell_range_vector: cv->range_cell");
        return cv;
   }
-  fread(cv->range_cell, sizeof(float), cv->ncells, in);
+  if (fread(cv->range_cell, sizeof(float), cv->ncells, in) != cv->ncells) {
+       perror("dorade_read_cell_range_vector: fread");
+       return NULL;
+  }
 
   if (do_swap) {
        for (i=0; i<cv->ncells; i++)
@@ -289,7 +314,10 @@ Cell_range_vector      *dorade_read_cell_range_vector     (FILE *in)
        - cv->ncells*4;
   buff = (char *)malloc(i);
   if (!buff) return cv;
-  fread(buff, sizeof(char), i, in);
+  if (fread(buff, sizeof(char), i, in) != i) {
+       perror("dorade_read_cell_range_vector: fread");
+       return NULL;
+  }
   free(buff);
   return cv;
 }
@@ -313,11 +341,17 @@ Correction_factor_desc *dorade_read_correction_factor_desc(FILE *in)
 
   /* Make sure we have Correction Factor Descriptor. */
   while (!is_cfac) {
-      fread(cf->code, sizeof(cf->code), 1, in);
+      if (fread(cf->code, sizeof(cf->code), 1, in) != 1) {
+         perror("dorade_read_correction_factor_desc: fread");
+         return NULL;
+      }
       if (strncmp(cf->code, "CFAC", 4) == 0)
          is_cfac = 1;
       else {
-         fread(&cf->len, sizeof(cf->len), 1, in);
+         if (fread(&cf->len, sizeof(cf->len), 1, in) != 1) {
+             perror("dorade_read_correction_factor_desc: fread");
+             return NULL;
+         }
          if (do_swap) swap_4_bytes(&cf->len);
          remaining = (char *) malloc(cf->len-8);
          if (!remaining) {
@@ -325,11 +359,17 @@ Correction_factor_desc *dorade_read_correction_factor_desc(FILE *in)
              fprintf(stderr,"cf->len = %d\n\n", cf->len);
              return NULL;
          }
-         fread(remaining, sizeof(char), cf->len-8, in);
+         if (fread(remaining, sizeof(char), cf->len-8, in) != 1) {
+             perror("dorade_read_correction_factor_desc: fread");
+             return NULL;
+         }
          free(remaining);
       }
   }
-  fread(&cf->len, sizeof(Correction_factor_desc)-4, 1, in);
+  if (fread(&cf->len, sizeof(Correction_factor_desc)-4, 1, in) != 1) {
+      perror("dorade_read_correction_factor_desc: fread");
+      return NULL;
+  }
   /* Now, convert from Big Endian. */
   if (do_swap) {
        swap_4_bytes(&cf->len);
@@ -404,7 +444,10 @@ Sweep_info *dorade_read_sweep_info(FILE *in)
        return NULL;
   }
 
-  fread(si, sizeof(Sweep_info), 1, in);
+  if (fread(si, sizeof(Sweep_info), 1, in) != 1) {
+       perror("dorade_read_sweep_info: fread");
+       return NULL;
+  }
   /* FIXME: ?? For now, VOLD is what we expect when there
    *           are no more SWIB.  This is a data driven EOF.
    *           Returning NULL should suffice.
@@ -446,7 +489,10 @@ Ray_info       *dorade_read_ray_info      (FILE *in)
        return NULL;
   }
 
-  fread(ri, sizeof(Ray_info), 1, in);
+  if (fread(ri, sizeof(Ray_info), 1, in) != 1) {
+       perror("dorade_read_ray_info: fread");
+       return NULL;
+  }
   /* Now, convert from Big Endian. */
   if (do_swap) {
        swap_4_bytes(&ri->len);
@@ -489,13 +535,19 @@ Platform_info  *dorade_read_platform_info (FILE *in)
    * the place of ASIB when radar is grounded.
    */
 
-  fread(pi->code, sizeof(pi->code), 1, in);
-  fread(&pi->len, sizeof(pi->len), 1, in);
+  if (fread(pi->code, sizeof(pi->code), 1, in) != 1 ||
+      fread(&pi->len, sizeof(pi->len), 1, in) != 1) {
+      perror("dorade_read_platform_info: fread");
+      return NULL;
+  }
   if (do_swap) swap_4_bytes(&pi->len);
   len_first_two = sizeof(pi->code) + sizeof(pi->len);
     
   if (strncmp(pi->code, "ASIB", 4) == 0) {
-      fread(&pi->longitude, sizeof(Platform_info)-len_first_two, 1, in);
+      if (fread(&pi->longitude, sizeof(Platform_info)-len_first_two, 1, in) != 1) {
+         perror("dorade_read_platform_info: fread");
+         return NULL;
+      }
       /* Read past any extra bytes. */
       if (pi->len > sizeof(Platform_info)) {
          if (read_extra_bytes(pi->len - sizeof(Platform_info), in) <= 0)
@@ -551,9 +603,12 @@ Parameter_data *dorade_read_parameter_data(FILE *in)
        return NULL;
   }
 
-  fread(&pd->code, sizeof(pd->code), 1, in);
-  fread(&pd->len, sizeof(pd->len), 1, in);
-  fread(&pd->name, sizeof(pd->name), 1, in);
+  if (fread(&pd->code, sizeof(pd->code), 1, in) != 1 ||
+      fread(&pd->len, sizeof(pd->len), 1, in) != 1 ||
+      fread(&pd->name, sizeof(pd->name), 1, in) != 1) {
+       perror("dorade_read_parameter_data: fread");
+       return NULL;
+  }
   if (do_swap) swap_4_bytes(&pd->len);
   /* Length is in parameter data block? or calculate if from pd->len. */
 
@@ -566,7 +621,10 @@ Parameter_data *dorade_read_parameter_data(FILE *in)
        perror("dorade_read_parameter_data: pd->data");
        return pd;
   }
-  fread(pd->data, sizeof(char), len, in);
+  if (fread(pd->data, sizeof(char), len, in) != len) {
+       perror("dorade_read_parameter_data: fread");
+       return NULL;
+  }
   
   /* FIXME: Big endian conversion in caller?  Is that the right place? */
 
similarity index 100%
rename from dorade.h
rename to src/dorade.h
similarity index 100%
rename from dorade_print.c
rename to src/dorade_print.c
similarity index 99%
rename from dorade_to_radar.c
rename to src/dorade_to_radar.c
index 27de1ece0827681b9818c25fb2a2b6ec2f143416..4af897a856bd08185c46b9a6c50bf4ace9ff2199 100644 (file)
@@ -161,9 +161,6 @@ Radar *RSL_dorade_to_radar(char *infile)
   int datum, missing_data_flag;
   float prf;
 
-  float (*f)(Range x);
-  Range (*invf)(float x);
-
   FILE  *fp;
   Comment_block   *cb;
   Volume_desc     *vd;
similarity index 100%
rename from edge_to_radar.c
rename to src/edge_to_radar.c
similarity index 100%
rename from endian.c
rename to src/endian.c
similarity index 100%
rename from farea.c
rename to src/farea.c
similarity index 100%
rename from fix_headers.c
rename to src/fix_headers.c
similarity index 100%
rename from fraction.c
rename to src/fraction.c
similarity index 100%
rename from get_win.c
rename to src/get_win.c
diff --git a/gts.c b/src/gts.c
similarity index 100%
rename from gts.c
rename to src/gts.c
similarity index 89%
rename from gzip.c
rename to src/gzip.c
index 5b8f9022bf684c829469fae919e85b1c4419fb93..b2c76371d0a98834696db7643841f637771c16a7 100644 (file)
--- a/gzip.c
@@ -77,12 +77,18 @@ FILE *uncompress_pipe (FILE *fp)
   if (no_command("gzip --version > /dev/null 2>&1")) return fp;
   save_fd = dup(0);
   close(0); /* Redirect stdin for gzip. */
-  dup(fileno(fp));
+  if (dup(fileno(fp)) < 0) {
+    perror("decompress_pipe");
+    return NULL;
+  }
 
   fpipe = popen("gzip -q -d -f --stdout", "r");
   if (fpipe == NULL) perror("uncompress_pipe");
   close(0);
-  dup(save_fd);
+  if (dup(save_fd) < 0) {
+    perror("decompress_pipe");
+    return NULL;
+  }
   close(save_fd);
   return fpipe;
 }
@@ -98,12 +104,18 @@ FILE *compress_pipe (FILE *fp)
   fflush(NULL); /* Flush all buffered output before opening this pipe. */
   save_fd = dup(1);
   close(1); /* Redirect stdout for gzip. */
-  dup(fileno(fp));
+  if (dup(fileno(fp)) < 0) {
+    perror("compress_pipe");
+    return NULL;
+  }
 
   fpipe = popen("gzip -q -1 -c", "w");
   if (fpipe == NULL) perror("compress_pipe");
   close(1);
-  dup(save_fd);
+  if (dup(save_fd) < 0) {
+    perror("compress_pipe");
+    return NULL;
+  }
   return fpipe;
 }
 
similarity index 100%
rename from hdf_to_radar.c
rename to src/hdf_to_radar.c
similarity index 100%
rename from histogram.c
rename to src/histogram.c
similarity index 98%
rename from image_gen.c
rename to src/image_gen.c
index cfedc8c8e3ef3dbc33769703486cc273155025a4..ba968c2413b606809ca17d871e267333f479b1c7 100644 (file)
@@ -279,7 +279,8 @@ void RSL_bscan_ray(Ray *r, FILE *fp)
          outvect[i] = (unsigned char) (255 + f(r->range[i]));
   
   for(i=0; i<r->h.nbins; i++)
-       (void)fwrite(color_table[outvect[i]], sizeof(char), 3, fp);
+       if (fwrite(color_table[outvect[i]], sizeof(char), 3, fp) != 3)
+               fprintf(stderr, "RSL_bscan_ray: short write\n");
   
 }
 void RSL_bscan_sweep(Sweep *s, char *outfile)
@@ -311,7 +312,8 @@ void RSL_bscan_sweep(Sweep *s, char *outfile)
        else {
          memset(outvect, 0, nbins);
          for(i=0; i<nbins; i++)
-               (void)fwrite(color_table[outvect[i]], sizeof(char), 3, fp);
+               if (fwrite(color_table[outvect[i]], sizeof(char), 3, fp) != 3)
+                       fprintf(stderr, "RSL_bscan_sweep: short write\n");
        }
   }
   
@@ -563,7 +565,9 @@ void RSL_write_pict(char *outfile, unsigned char *image, int xdim, int ydim, cha
   (void)sprintf(pipecmd, "ppmtopict > %s 2>/dev/null", outfile);
   fpipe = popen(pipecmd, "w");  /* Global FILE * */
   fprintf(fpipe, "P6\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
-  for (i=0; i<nbytes; i++) (void)fwrite(c_table[image[i]], sizeof(char), 3, fpipe);
+  for (i=0; i<nbytes; i++)
+         if (fwrite(c_table[image[i]], sizeof(char), 3, fpipe) != 3)
+               fprintf(stderr, "RSL_write_pict: short write\n");
   (void)pclose(fpipe);
 }
 /**********************************************************************/
@@ -587,7 +591,9 @@ void RSL_write_ppm(char *outfile, unsigned char *image, int xdim, int ydim, char
   nbytes = xdim*ydim;
   fpipe = fopen(outfile, "w");  /* Global FILE * */
   fprintf(fpipe, "P6\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
-  for (i=0; i<nbytes; i++) (void)fwrite(c_table[image[i]], sizeof(char), 3, fpipe);
+  for (i=0; i<nbytes; i++)
+         if (fwrite(c_table[image[i]], sizeof(char), 3, fpipe) != 3)
+               fprintf(stderr, "RSL_write_ppm: short write\n");
   (void)fclose(fpipe);
 }
 /**********************************************************************/
@@ -612,7 +618,8 @@ void RSL_write_pgm(char *outfile, unsigned char *image, int xdim, int ydim)
   (void)sprintf(pipecmd, "gzip > %s.gz 2>/dev/null", outfile);
   fpipe = popen(pipecmd, "w");  /* Global FILE * */
   fprintf(fpipe, "P5\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
-  (void)fwrite(image, sizeof(char), nbytes, fpipe);
+  if (fwrite(image, sizeof(char), nbytes, fpipe) != nbytes)
+       fprintf(stderr, "RSL_write_pgm: short write\n");
   (void)pclose(fpipe);
 
 /*  The following is commented and is for non compressed. */
similarity index 100%
rename from interp.c
rename to src/interp.c
similarity index 100%
rename from lassen.c
rename to src/lassen.c
similarity index 100%
rename from lassen.h
rename to src/lassen.h
similarity index 100%
rename from lassen_to_radar.c
rename to src/lassen_to_radar.c
similarity index 100%
rename from mcgill.c
rename to src/mcgill.c
similarity index 100%
rename from mcgill.h
rename to src/mcgill.h
similarity index 100%
rename from mcgill_to_radar.c
rename to src/mcgill_to_radar.c
similarity index 99%
rename from nsig.c
rename to src/nsig.c
index 7e5c3c1281d60ffd719e11d5824a97a1c4412a2d..c00b5ed44257065c2c072c8610aff04a22bb5fb6 100644 (file)
--- a/nsig.c
@@ -391,12 +391,15 @@ NSIG_Ray *nsig_read_ray(FILE *fp)
 NSIG_Sweep **nsig_read_sweep(FILE *fp, NSIG_Product_file *prod_file)
 {
   NSIG_Sweep **s;
-  int i, j, n;
+  int i, n;
   static NSIG_Ingest_data_header **idh = NULL;
   static NSIG_Raw_prod_bhdr *bhdr = NULL;
   NSIG_Ray *nsig_ray;
   int data_mask, iray, nrays[12], max_rays;
+#ifdef NSIG_VER2
+  int j;
   int masks[5];
+#endif
   int nparams;
   int is_new_ray;
   int idtype[12];
similarity index 100%
rename from nsig.h
rename to src/nsig.h
similarity index 100%
rename from nsig2_to_radar.c
rename to src/nsig2_to_radar.c
similarity index 99%
rename from nsig_to_radar.c
rename to src/nsig_to_radar.c
index 6ce808183a7f0c14db53f6a04312a3039a244eb6..5dda3ffb3450bdab18a8b46c098107cfb510ca1e 100644 (file)
@@ -181,7 +181,9 @@ RSL_nsig_to_radar
   NSIG_Product_file *prod_file;
   short id;
   int data_mask, nrays;
+#ifdef NSIG_VER2 
   int masks[5];
+#endif
   int nparams, nsweeps;
   NSIG_Sweep **nsig_sweep;
   NSIG_Ray *ray_p;
similarity index 100%
rename from prune.c
rename to src/prune.c
similarity index 99%
rename from radar.c
rename to src/radar.c
index 4078f173f9d2f7b1c6558f419befb23d361a7d7c..7c07d01e622042be73a3aaca7e780a69d7b458e9 100644 (file)
--- a/radar.c
@@ -60,7 +60,7 @@
 
 void RSL_print_version()
 {
-  printf("RSL version %s.\n", RSL_VERSION_STR);
+  printf("RSL version %s.\n", VERSION);
 }
 
 /* Debug printing global variable: radar_verbose_flag */
similarity index 100%
rename from radar_to_hdf_1.c
rename to src/radar_to_hdf_1.c
similarity index 100%
rename from radar_to_hdf_2.c
rename to src/radar_to_hdf_2.c
similarity index 97%
rename from radar_to_uf.c
rename to src/radar_to_uf.c
index 0d3af56a2311e6496895e3bb56b8a4fb7777ff3a..b5ca2d4bb4409702588d629354f02b28d146ef42 100644 (file)
@@ -211,9 +211,10 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
     ray_num = 0;
   if (radar_verbose_flag) 
     fprintf(stderr,"Processing sweep %d for %d rays.", i, nrays);
-  if (radar_verbose_flag)
+  if (radar_verbose_flag) {
     if (little_endian()) fprintf(stderr," ... On Little endian.\n");
     else fprintf(stderr,"\n");
+  }
 
 
 /* Now LOOP for all rays within this particular sweep (i).
@@ -321,7 +322,7 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
         uf_ma[37] = tm->tm_year % 100; /* Same format as data year */
         uf_ma[38] = tm->tm_mon+1;
         uf_ma[39] = tm->tm_mday;
-        memcpy(&uf_ma[40], "RSL" RSL_VERSION_STR, 8);
+        memcpy(&uf_ma[40], "RSL" VERSION, 8);
         if (little_endian()) swap2(&uf_ma[40], 8/2);
         uf_ma[44] = (signed short)UF_NO_DATA;
         len_ma = 45;
@@ -497,11 +498,16 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
         rec_len =(int)uf_ma[1]*2;
         save_rec_len = rec_len;  /* We destroy 'rec_len' when making it
                         big endian on a little endian machine. */
-        if (little_endian()) swap_4_bytes(&rec_len);
-        (void)fwrite(&rec_len, sizeof(int), 1, fp);
-        if (little_endian()) swap_uf_buffer(uf);
-        (void)fwrite(uf, sizeof(char), save_rec_len, fp);
-        (void)fwrite(&rec_len, sizeof(int), 1, fp);
+       if (little_endian())
+           swap_4_bytes(&rec_len);
+       if (fwrite(&rec_len, sizeof(int), 1, fp) != 1)
+           perror("RSL_radar_to_uf_fp: short write");
+       if (little_endian())
+           swap_uf_buffer(uf);
+       if (fwrite(uf, sizeof(char), save_rec_len, fp) != 1)
+           perror("RSL_radar_to_uf_fp: short write");
+       if (fwrite(&rec_len, sizeof(int), 1, fp) != 1)
+           perror("RSL_radar_to_uf_fp: short write");
       } /* if (ray) */
     }
   }
similarity index 100%
rename from radtec.c
rename to src/radtec.c
similarity index 100%
rename from radtec.h
rename to src/radtec.h
similarity index 100%
rename from radtec_to_radar.c
rename to src/radtec_to_radar.c
similarity index 99%
rename from rainbow.c
rename to src/rainbow.c
index 49d81908a1b804df40ea57b6d072fa2c8f6748f4..7d5862c00f525cfc2fe1eba141c3b9d9046421ba 100644 (file)
--- a/rainbow.c
@@ -158,7 +158,6 @@ void W_label(Rainbow_hdr *rainbow_hdr, char* buf)
     int labelnum, az_start, az_stop, pw_code, prf_high, prf_low, zdata;
     int vdata, wdata, unfolding, cdata, ddata, uzdata;
     float elev, az_step, az_rate, range_stop;
-    char label;
 
     sscanf(buf, "%*c%d : %f %d %d %f %f %d %d %d %d %d %d %d %f %d %d %d",
            &labelnum, &elev, &az_start, &az_stop, &az_step,
similarity index 100%
rename from rainbow.h
rename to src/rainbow.h
similarity index 96%
rename from rainbow_to_radar.c
rename to src/rainbow_to_radar.c
index 7887063038cf23e4b3ae08f5e159b6f95b3c6bb0..5dc0a28269081c3f9a0010cdcffe3d5e07aa0780 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include "rsl.h"
 #include "rainbow.h"
 
@@ -74,6 +75,8 @@ Radar *RSL_rainbow_to_radar(char *infile)
     Rainbow_hdr rainbow_hdr;
     struct dms latdms, londms;
 
+    void read_rainbow_header(Rainbow_hdr *, FILE *);
+
     /* These next lines allow program to read from a regular file, a
      * compressed file, or standard input.  I lifted them from RSL_uf_to_radar
      * by John Merritt.
@@ -175,13 +178,14 @@ int rainbow_data_to_radar(Radar *radar, Rainbow_hdr rainbow_hdr, FILE *fp)
      * and sweeps continues for the remainder of sweeps in the volume scan.
      */
 
-    int iray, isweep, nread, nsweeps, nrays, nbins, vol_index;
+    int iray, isweep, nread, nsweeps, nrays, nbins;
     unsigned char *rainbow_ray;
     Volume *v;
     Sweep *sweep;
     Ray *ray;
     int i;
     float azim_rate, beam_width, dz, elev_angle, prf, unam_rng;
+    int vol_index = VR_INDEX;
 
     beam_width = 1.0; /* for now */
 
@@ -226,8 +230,9 @@ int rainbow_data_to_radar(Radar *radar, Rainbow_hdr rainbow_hdr, FILE *fp)
     if (nrays != 360) {
        fprintf(stderr,"WARNING: number of rays computed is not the number "
                "expected.\n");
-       fprintf(stderr,"Computed = nrays: azstart = %d, az_stop = %d, "
-               "az_step = %f\n");
+       fprintf(stderr,"Computed = nrays: "
+           "azstart = %d, az_stop = %d, az_step = %f\n",
+           rainbow_hdr.az_start, rainbow_hdr.az_stop, rainbow_hdr.az_step);
        fprintf(stderr,"Expected 360\n");
     }
     radar->v[vol_index] = RSL_new_volume(nsweeps);
similarity index 100%
rename from range.c
rename to src/range.c
similarity index 100%
rename from rapic.y
rename to src/rapic_parse.y
similarity index 100%
rename from rapic_routines.c
rename to src/rapic_routines.c
similarity index 100%
rename from rapic_routines.h
rename to src/rapic_routines.h
similarity index 98%
rename from rapic-lex.l
rename to src/rapic_scan.l
index 280d2cd1875b56285e4d9dd491fec87c185173a2..002aacd6874b614340b55e977b73757dc27f7a3e 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <stdio.h>
 #include "rapic_routines.h"
-#include "rapic.h"
+#include "rapic_parse.h"
 #include <string.h>
 
 /*
@@ -42,7 +42,8 @@
 
 %}
 
-
+%option nounput
+%option noinput
 %x ATMODE
 
 %%
similarity index 87%
rename from rapic_to_radar.c
rename to src/rapic_to_radar.c
index 36a1afa7a17a8dd550d70093839c3bf30b78a405..7d9b7cae7de54f278ea6bfb30681adac5085022b 100644 (file)
@@ -23,7 +23,9 @@ Radar *RSL_rapic_to_radar(char *infile)
        }
   }
   fp = uncompress_pipe(fp); /* Transparently gunzip. */
-  close(0); dup(fileno(fp)); /* Redirect stdin. */
+  close(0);
+  if (dup(fileno(fp)) < 0) /* Redirect stdin. */
+       return NULL;
 
   rapicparse();
   radar = rapic_radar;
similarity index 100%
rename from ray_indexes.c
rename to src/ray_indexes.c
similarity index 91%
rename from read_write.c
rename to src/read_write.c
index 644a7b2dc1a88b8727949562650418a973af9133..8c9398799b433d0c54dab4289cf0acf251309a30 100644 (file)
@@ -56,8 +56,11 @@ Ray *RSL_read_ray(FILE *fp)
   Ray *r;
   int nbins;
 
-  (void)fread(header_buf, sizeof(char), sizeof(header_buf), fp);
-  (void)fread(&nbins, sizeof(int), 1, fp);
+  if (fread(header_buf, sizeof(header_buf), 1, fp) != 1 ||
+      fread(&nbins, sizeof(int), 1, fp) != 1) {
+        perror("RSL_read_ray: fread");
+        return NULL;
+  }
   if (nbins == 0) return NULL;
 
   memcpy(&ray_h, header_buf, sizeof(Ray_header));
@@ -65,7 +68,10 @@ Ray *RSL_read_ray(FILE *fp)
   r = RSL_new_ray(ray_h.nbins);
   r->h = ray_h;
 
-  (void)fread(r->range, sizeof(Range), r->h.nbins, fp);
+  if (fread(r->range, sizeof(Range), r->h.nbins, fp) != r->h.nbins) {
+    perror("RSL_read_ray: fread");
+    return NULL;
+  }
   return r;
 }
 Sweep *RSL_read_sweep(FILE *fp)
@@ -76,9 +82,11 @@ Sweep *RSL_read_sweep(FILE *fp)
   Sweep *s;
   int nrays;
 
-  (void)fread(header_buf, sizeof(char), sizeof(header_buf), fp);
-
-  (void)fread(&nrays, sizeof(int), 1, fp);
+  if (fread(header_buf, sizeof(header_buf), 1, fp) != 1 ||
+      fread(&nrays, sizeof(int), 1, fp) != 1) {
+        perror("RSL_read_sweep: fread");
+        return NULL;
+  }
   if (nrays == 0) return NULL;
 
   if (radar_verbose_flag)
@@ -101,10 +109,11 @@ Volume *RSL_read_volume(FILE *fp)
   Volume *v;
   int nsweeps;
 
-
-
-  (void)fread(header_buf, sizeof(char), sizeof(header_buf), fp);
-  (void)fread(&nsweeps, sizeof(int), 1, fp);
+  if (fread(header_buf, sizeof(header_buf), 1, fp) != 1 ||
+      fread(&nsweeps, sizeof(int), 1, fp) != 1) {
+        perror("RSL_read_volume: fread");
+        return NULL;
+  }
   if (nsweeps == 0)    return NULL;
 
   if (radar_verbose_flag)
@@ -190,15 +199,24 @@ Radar *RSL_read_radar(char *infile)
        return NULL;
   }
   fp = uncompress_pipe(fp);
-  (void)fread(title, sizeof(char), sizeof(title), fp);
+  if (fread(title, sizeof(title), 1, fp) != 1) {
+       perror("RSL_read_radar: fread");
+       return NULL;
+  }
   if (strncmp(title, "RSL", 3) != 0) return NULL;
 
-  (void)fread(header_buf, sizeof(char), sizeof(header_buf), fp);
+  if (fread(header_buf, sizeof(header_buf), 1, fp) != 1) {
+       perror("RSL_read_radar: fread");
+       return NULL;
+  }
   memcpy(&radar_h, header_buf, sizeof(Radar_header));
   radar = RSL_new_radar(MAX_RADAR_VOLUMES);
   radar->h = radar_h;
 
-  (void)fread(&nradar, sizeof(int), 1, fp);
+  if (fread(&nradar, sizeof(int), 1, fp) != 1) {
+       perror("RSL_read_radar: fread");
+       return NULL;
+  }
   if (radar_verbose_flag)
        fprintf(stderr,"Reading %d volumes.\n", nradar);
 
@@ -314,7 +332,7 @@ int RSL_write_radar_fp(Radar *radar, FILE *fp)
   if (radar == NULL) return 0;
   
   memset(title, 0, sizeof(title));
-  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", RSL_VERSION_STR, sizeof(Range));
+  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", VERSION, sizeof(Range));
   n += fwrite(title, sizeof(char), sizeof(title), fp);
   
   memset(header_buf, 0, sizeof(header_buf));
similarity index 100%
rename from reverse.c
rename to src/reverse.c
diff --git a/rsl.h b/src/rsl.h
similarity index 97%
rename from rsl.h
rename to src/rsl.h
index a8217656b9d42f3a2a822165314947076ef33100..597069c83933392f6e499d594b7fd4f1bbba3d35 100644 (file)
--- a/rsl.h
+++ b/src/rsl.h
@@ -27,8 +27,6 @@
 #include "config.h"
 #endif
 
-#define RSL_VERSION_STR "v1.41"
-
 /**********************************************************************/
 /* Configure: Define USE_TWO_BYTE_PRECISION to have RSL store internal*/
 /*            values with two bytes.  Otherwise, use one byte.        */
@@ -46,7 +44,7 @@
 /*            so you shouldn't have to modify anything here.          */
 /**********************************************************************/
 #ifndef COLORDIR
-#define COLORDIR "/usr/local/trmm/GVBOX/lib/colors"
+#define COLORDIR DATADIR "/colors"
 #endif
 
 /* These are the color table indexes. See RSL_set/get_color_table. */
 /* The default color tables for reflectivity, velocity, spectral width,
  * height, rainfall, and zdr.
  */
-#define REFL_RED_FILE   COLORDIR "/red_reflectivity.clr"
-#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
-#define REFL_BLUE_FILE  COLORDIR "/blu_reflectivity.clr"
-#define VEL_RED_FILE    COLORDIR "/red_velocity.clr"
-#define VEL_GREEN_FILE  COLORDIR "/grn_velocity.clr"
-#define VEL_BLUE_FILE   COLORDIR "/blu_velocity.clr"
-#define SW_RED_FILE     COLORDIR "/red_spectral_width.clr"
-#define SW_GREEN_FILE   COLORDIR "/grn_spectral_width.clr"
-#define SW_BLUE_FILE    COLORDIR "/blu_spectral_width.clr"
-#define HEIGHT_RED_FILE   COLORDIR "/red_height.clr"
-#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
-#define HEIGHT_BLUE_FILE  COLORDIR "/blu_height.clr"
+#define REFL_RED_FILE       COLORDIR "/red_reflectivity.clr"
+#define REFL_GREEN_FILE     COLORDIR "/grn_reflectivity.clr"
+#define REFL_BLUE_FILE      COLORDIR "/blu_reflectivity.clr"
+#define VEL_RED_FILE        COLORDIR "/red_velocity.clr"
+#define VEL_GREEN_FILE      COLORDIR "/grn_velocity.clr"
+#define VEL_BLUE_FILE       COLORDIR "/blu_velocity.clr"
+#define SW_RED_FILE         COLORDIR "/red_spectral_width.clr"
+#define SW_GREEN_FILE       COLORDIR "/grn_spectral_width.clr"
+#define SW_BLUE_FILE        COLORDIR "/blu_spectral_width.clr"
+#define HEIGHT_RED_FILE     COLORDIR "/red_height.clr"
+#define HEIGHT_GREEN_FILE   COLORDIR "/grn_height.clr"
+#define HEIGHT_BLUE_FILE    COLORDIR "/blu_height.clr"
 #define RAINFALL_RED_FILE   COLORDIR "/red_rainfall.clr"
 #define RAINFALL_GREEN_FILE COLORDIR "/grn_rainfall.clr"
 #define RAINFALL_BLUE_FILE  COLORDIR "/blu_rainfall.clr"
similarity index 100%
rename from sort_rays.c
rename to src/sort_rays.c
similarity index 100%
rename from toga.c
rename to src/toga.c
similarity index 100%
rename from toga.h
rename to src/toga.h
similarity index 100%
rename from toga_to_radar.c
rename to src/toga_to_radar.c
similarity index 95%
rename from uf_to_radar.c
rename to src/uf_to_radar.c
index e87b68d4d1bfcee179e005115bc7b9e9bf94b8fa..870f5ed2ad0b8ccb13880750508317032ee97d31 100644 (file)
@@ -503,18 +503,22 @@ Radar *RSL_uf_to_radar_fp(FILE *fp)
     nbytes = magic.word;
     if (little_endian()) swap_4_bytes(&nbytes);
     memcpy(uf, &magic.buf[4], 2);
-    (void)fread(&uf[1], sizeof(char), nbytes-2, fp);
+    if (fread(&uf[1], sizeof(char), nbytes-2, fp) !=  nbytes-2)
+       perror("RSL_uf_to_radar_fp: short read");
     if (little_endian()) swap_uf_buffer(uf);
-    (void)fread(&nbytes, sizeof(int), 1, fp);
+    if (fread(&nbytes, sizeof(int), 1, fp) !=  1)
+       perror("RSL_uf_to_radar_fp: short read");
     if (uf_into_radar(uf, &radar) == UF_DONE) break;
     /* Now the rest of the file. */
     while(fread(&nbytes, sizeof(int), 1, fp) > 0) {
       if (little_endian()) swap_4_bytes(&nbytes);
       
-      (void)fread(uf, sizeof(char), nbytes, fp);
+      if (fread(uf, sizeof(char), nbytes, fp) !=  nbytes)
+       perror("RSL_uf_to_radar_fp: short read");
       if (little_endian()) swap_uf_buffer(uf);
       
-      (void)fread(&nbytes, sizeof(int), 1, fp);
+      if (fread(&nbytes, sizeof(int), 1, fp) !=  1)
+       perror("RSL_uf_to_radar_fp: short read");
       
       if (uf_into_radar(uf, &radar) == UF_DONE) break;
     }
@@ -526,18 +530,22 @@ Radar *RSL_uf_to_radar_fp(FILE *fp)
     sbytes = magic.sword;
     if (little_endian()) swap_2_bytes(&sbytes);
     memcpy(uf, &magic.buf[2], 4);
-    (void)fread(&uf[2], sizeof(char), sbytes-4, fp);
+    if (fread(&uf[2], sizeof(char), sbytes-4, fp) !=  sbytes-4)
+       perror("RSL_uf_to_radar_fp: short read");
     if (little_endian()) swap_uf_buffer(uf);
-    (void)fread(&sbytes, sizeof(short), 1, fp);
+    if (fread(&sbytes, sizeof(short), 1, fp) !=  1)
+       perror("RSL_uf_to_radar_fp: short read");
     uf_into_radar(uf, &radar);
     /* Now the rest of the file. */
     while(fread(&sbytes, sizeof(short), 1, fp) > 0) {
       if (little_endian()) swap_2_bytes(&sbytes);
       
-      (void)fread(uf, sizeof(char), sbytes, fp);
+      if (fread(uf, sizeof(char), sbytes, fp) !=  sbytes)
+       perror("RSL_uf_to_radar_fp: short read");
       if (little_endian()) swap_uf_buffer(uf);
       
-      (void)fread(&sbytes, sizeof(short), 1, fp);
+      if (fread(&sbytes, sizeof(short), 1, fp) !=  1)
+       perror("RSL_uf_to_radar_fp: short read");
       
       if (uf_into_radar(uf, &radar) == UF_DONE) break;
     }
@@ -550,7 +558,8 @@ Radar *RSL_uf_to_radar_fp(FILE *fp)
     if (little_endian()) swap_2_bytes(&sbytes); /* # of 2 byte words. */
 
     memcpy(uf, &magic.buf[0], 6);
-    (void)fread(&uf[3], sizeof(short), sbytes-3, fp);
+    if (fread(&uf[3], sizeof(short), sbytes-3, fp) !=  sbytes-3)
+       perror("RSL_uf_to_radar_fp: short read");
     if (little_endian()) swap_uf_buffer(uf);
     uf_into_radar(uf, &radar);
     /* Now the rest of the file. */
@@ -558,7 +567,8 @@ Radar *RSL_uf_to_radar_fp(FILE *fp)
       memcpy(&sbytes, &uf[1], 2);  /* Record length is in word #2. */
       if (little_endian()) swap_2_bytes(&sbytes);
       
-      (void)fread(&uf[2], sizeof(short), sbytes-2, fp);  /* Have words 1,2. */
+      if (fread(&uf[2], sizeof(short), sbytes-2, fp) !=  sbytes-2)
+       perror("RSL_uf_to_radar_fp: short read");  /* Have words 1,2. */
       if (little_endian()) swap_uf_buffer(uf);
       
       if (uf_into_radar(uf, &radar) == UF_DONE) break;
similarity index 100%
rename from volume.c
rename to src/volume.c
similarity index 100%
rename from wsr88d.c
rename to src/wsr88d.c
similarity index 99%
rename from wsr88d.h
rename to src/wsr88d.h
index ecad6205d44aabc38491fafd7af8770e1dc398e8..7d22427a15cbbd8dcfefe5e0d6dd822410887665 100644 (file)
--- a/wsr88d.h
@@ -7,7 +7,7 @@
  * The directory should be the same as the LIBDIR in the makefile.
  */
 #ifndef WSR88D_SITE_INFO_FILE
-#define WSR88D_SITE_INFO_FILE "/usr/local/trmm/GVBOX/lib/wsr88d_locations.dat"
+#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
 #endif
 /*===============================================================*/
 typedef struct {
similarity index 100%
rename from wsr88d_get_site.c
rename to src/wsr88d_get_site.c
similarity index 98%
rename from wsr88d_m31.c
rename to src/wsr88d_m31.c
index 9e4c5b198603b7172bafd659ed092e1dba08ec44..4325407d6403f8dabc0b32eed73b992227097b07 100644 (file)
@@ -380,7 +380,7 @@ void wsr88d_load_ray_into_radar(Wsr88d_ray_m31 *wsr88d_ray, int isweep,
     int *field_offset;
     int ifield, nfields;
     int iray;
-    const nconstblocks = 3;
+    const int nconstblocks = 3;
 
     Data_moment_hdr data_hdr;
     int ngates, do_swap;
@@ -388,11 +388,11 @@ void wsr88d_load_ray_into_radar(Wsr88d_ray_m31 *wsr88d_ray, int isweep,
     unsigned short item;
     float value, scale, offset;
     unsigned char *data;
-    Range (*invf)(float x);
-    float (*f)(Range x);
     Ray *ray;
     int vol_index, waveform;
-    char *type_str;
+    Range (*invf)(float x) = DZ_INVF;
+    float (*f)(Range x) = DZ_F;
+    char *type_str = "Unknown type";
 
     int keep_hi_prf_dz = 0; /* TODO: make this an argument. */
 
@@ -471,13 +471,11 @@ void wsr88d_load_ray_into_radar(Wsr88d_ray_m31 *wsr88d_ray, int isweep,
        if (data_hdr.scale == 0) scale = 1.0; 
        data = &wsr88d_ray->data[data_index];
        for (i = 0; i < ngates; i++) {
-           if (data_hdr.datasize_bits != 16) {
-               item = *data;
-               data++;
-           } else {
-               item = *(unsigned short *)data;
+           if (data_hdr.datasize_bits == 16) {
+               item = ((unsigned short *)data)[i];
                if (do_swap) swap_2_bytes(&item);
-               data += 2;
+           } else {
+               item = ((unsigned char  *)data)[i];
            }
            if (item > 1)
                value = (item - offset) / scale;
similarity index 100%
rename from wsr88d_to_radar.c
rename to src/wsr88d_to_radar.c