*.la
*.lo
*.o
+*.swp
*~
- m4/
.deps/
.libs/
Makefile
libtool
local
ltmain.sh
++m4/
missing
- rapic_scan.c
- rapic_parse.c
- rapic_parse.h
-rapic-lex.c
-rapic.c
-rapic.h
++src/rapic_parse.c
++src/rapic_parse.h
++src/rapic_scan.c
stamp-h1
tags
valgrind.out
-## 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
- EXTRA_DIST = CHANGES CHECK_LIST Copyright GPL LGPL
-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
-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.40)
++AC_INIT(rsl, 1.41)
+AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
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
- 0 KICX CEDAR_CITY NA 37 35 9 -112 51 21 3231
++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
- 0 KIWX N_INDIANA NA 41 21 0 -85 42 0 293
++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
- 0 KSRX W_ARKANSAS NA 35 16 48 -94 21 0 195
++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
- 0 KTYX MONTAGUE NA 43 45 3 -75 40 30 562
++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 NA 38 16 12 -87 43 12 190
++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
- 0 PHKM KOHALA NA 20 7 12 -155 46 12 1162
- 0 PHMO MOLOKAI NA 21 7 12 -157 10 12 415
- 0 PHWA HAWAII NA 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
-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 NA 18 7 12 -66 4 48 931
+ 0 TJUA SAN_JUAN PR 18 7 12 -66 4 48 931
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;
}
#define MAXRAYS_M31 800
#define MAXSWEEPS 20
- void wsr88d_load_ray(Wsr88d_ray_m31 *wsr88d_ray,
- Data_moment_hdr *hdr, void *data,
- int isweep, int iray, Radar *radar)
+ void wsr88d_load_ray_into_radar(Wsr88d_ray_m31 *wsr88d_ray, int isweep,
+ Radar *radar)
{
- /* Load data into ray structure for this field or data moment. */
-
- int ngates;
- int i;
+ /* Load data into ray structure for each data field. */
+
+ int data_index;
+ int *field_offset;
+ int ifield, nfields;
+ int iray;
- const nconstblocks = 3;
++ const int nconstblocks = 3;
+
+ Data_moment_hdr data_hdr;
+ int ngates, do_swap;
+ int i, hdr_size;
+ unsigned short item;
float value, scale, offset;
- Range (*invf)(float x);
- float (*f)(Range x);
+ unsigned char *data;
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";
++ char *type_str = "Unknown type";
+
+ int keep_hi_prf_dz = 0; /* TODO: make this an argument. */
enum waveforms {surveillance=1, doppler_w_amb_res, doppler_no_amb_res,
batch};
* means range folded.
*/
- offset = hdr->offset;
- scale = hdr->scale;
- if (hdr->scale == 0) scale = 1.0;
+ offset = data_hdr.offset;
+ scale = data_hdr.scale;
+ if (data_hdr.scale == 0) scale = 1.0;
+ data = &wsr88d_ray->data[data_index];
for (i = 0; i < ngates; i++) {
- unsigned short datan = 0;
- switch (hdr->datasize_bits) {
- case 8: datan = ((unsigned char *)data)[i]; break;
- case 16: datan = ((unsigned short *)data)[i]; break;
- 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 (little_endian() && hdr->datasize_bits == 16)
- swap_2_bytes(&datan);
-
- if (datan > 1)
- value = (datan - offset) / scale;
- else value = (datan == 0) ? BADVAL : RFVAL;
-
+ if (item > 1)
+ value = (item - offset) / scale;
+ else value = (item == 0) ? BADVAL : RFVAL;
ray->range[i] = invf(value);
ray->h.f = f;
ray->h.invf = invf;