From: Andy Spencer Date: Sun, 28 Aug 2011 20:24:04 +0000 (+0000) Subject: Merge branch 'master' into aweather X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=9672bb9bcdb8975eea937a29be6204c0624c04b3;hp=-c;p=~andy%2Frsl Merge branch 'master' into aweather Conflicts: Makefile.am configure.in src/rsl.h --- 9672bb9bcdb8975eea937a29be6204c0624c04b3 diff --combined README index 9062c34,679b8f4..6ec254d --- a/README +++ b/README @@@ -1,4 -1,4 +1,4 @@@ - v1.41 (Released 6/22/2011) + v1.42 (Released 7/12/2011) This is the README file for the Radar Software Library (RSL). @@@ -89,6 -89,11 +89,6 @@@ without PKWARE support Compression library. Call PKWARE, Inc. at 414-354-8699 or via http://www.pkware.com. - libetor The EDGE libraray to decode the EDGE format. - This is available from Enterprise Electronics - Corporation, Enterprise, Alabama, USA 36330 - 334-347-3478. - Example mainlines are provided in the directory examples. INSTALLATION INSTRUCTIONS diff --combined configure.ac index fd7d072,0000000..2b59634 mode 100644,000000..100644 --- a/configure.ac +++ b/configure.ac @@@ -1,64 -1,0 +1,64 @@@ +# Process this file with autoconf to produce a configure script. - AC_INIT(rsl, 1.41) ++AC_INIT(rsl, 1.42) +AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign]) + +AM_INIT_AUTOMAKE +AM_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([m4]) + +# Checks for programs. +AC_PROG_CC +AM_PROG_LIBTOOL +AM_PROG_LEX +AC_PROG_YACC +AC_PROG_LN_S + +# Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(fcntl.h malloc.h strings.h unistd.h) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_STRUCT_TM + +# Checks for library functions. +# AC_FUNC_SETVBUF_REVERSED +AC_CHECK_FUNCS(mktime strdup strstr) + +# 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 + dont want LASSEN.]) + +# Checks for libraries. +if test $prefix = NONE; then + prefix=$ac_default_prefix +fi +LIBDIR="-L$prefix/lib" +LIBS="-lz -lm" + +# The order of the libraries is important. +# This works: +# -lrsl -limplode -ltsdistk -lmfhdf -ldf -ljpeg -lz -lm +# +# If mounting with shared libraries we may have to specify all possible libraries. +# First check with simple LIBS list, if it fails, then expand the list. + +AC_CHECK_LIB(implode, _implode, ,,$LIBDIR) +AC_CHECK_LIB(jpeg, jpeg_CreateCompress,,,$LIBDIR) +AC_CHECK_LIB(df, DFopen, ,,$LIBDIR) +AC_CHECK_LIB(mfhdf, SDstart, ,,$LIBDIR) +AC_CHECK_LIB(tsdistk, TKopen, ,,$LIBDIR) + +# Check if yywrap is defined in toolkit, and add $LEXLIB to LIBS if not. +YYWRAP="" +AC_CHECK_LIB(tsdistk, yywrap, YYWRAP="yes",,$LIBDIR) +if test "$YYWRAP" = ""; then + LIBS="$LIBS $LEXLIB" +fi + +AC_MSG_RESULT(LIBS = $LIBS) +AC_CONFIG_FILES([Makefile doc/Makefile data/Makefile examples/Makefile src/Makefile]) +AC_OUTPUT diff --combined doc/index.html index a28468a,2063d17..903b49a --- a/doc/index.html +++ b/doc/index.html @@@ -6,6 -6,7 +6,7 @@@ TRMM Satellite Validation Office Web Site +

TRMM Radar Software Library

@@@ -21,8 -22,8 +22,8 @@@

- Current RSL Version 1.40, released 10/10/2008
- Supports WSR-88D Level II Build 10 Format

+ Current RSL Version 1.42, released 7/12/2011
+ Supports WSR-88D Level II Build 12 Format In support of the Tropical Rainfall Measuring Mission's (TRMM) Global @@@ -143,6 -144,14 +144,6 @@@ Supported Radar Data FormatsYes - - - - - - - -
No
EDGEYesNo
@@@ -151,6 -160,6 +152,6 @@@ - + diff --combined src/Makefile.am index 511b830,0000000..dbc3fd3 mode 100644,000000..100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -1,40 -1,0 +1,40 @@@ +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_LDFLAGS = -version-info 1:42 +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 \ + 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 diff --combined src/nsig.c index c00b5ed,256f265..9ae5913 --- a/src/nsig.c +++ b/src/nsig.c @@@ -391,15 -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]; @@@ -445,7 -442,7 +445,7 @@@ */ #define Vprint - #undef Vprint + /* #undef Vprint */ /* Determine if we need to byte-swap values. */ (void)nsig_endianess(&prod_file->rec1); @@@ -514,10 -511,10 +514,10 @@@ /* This is a NEW sweep. */ iray = 0; #ifdef Vprint - {int isweep; + int isweep; isweep = NSIG_I2(idh[0]->sweep_num); printf("Number of rays in sweep %d is %d\n", isweep, max_rays); - } + #endif /* Allocate memory for sweep. */ s = (NSIG_Sweep **) calloc (nparams, sizeof(NSIG_Sweep*)); diff --combined src/nsig_to_radar.c index 5dda3ff,03d739f..166aced --- a/src/nsig_to_radar.c +++ b/src/nsig_to_radar.c @@@ -181,9 -181,7 +181,9 @@@ RSL_nsig_to_rada 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; @@@ -242,17 -240,6 +242,6 @@@ if (radar_verbose_flag) fprintf(stderr, "Read %d bytes for rec2.\n", n); - /** Test for scan mode -- If scan is a RHI will return NULL **/ - /** because RSL can't handle RHI's. In the future, replace **/ - /** NULL will a routine to convert RHI's to RSL Format **/ - ant_scan_mode =NSIG_I2(prod_file->rec2.task_config.scan_info.ant_scan_mode); - if(ant_scan_mode == 2) - { - if (radar_verbose_flag) - fprintf(stderr, "RHI scan detected. Unable to process, returning NULL.\n"); - /* return NULL; */ - } - /* Count the bits set in 'data_mask' to determine the number * of parameters present. */ diff --combined src/radar_to_uf.c index b5ca2d4,e281486..f5a18ab --- a/src/radar_to_uf.c +++ b/src/radar_to_uf.c @@@ -211,10 -211,9 +211,10 @@@ void RSL_radar_to_uf_fp(Radar *r, FILE 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). @@@ -322,7 -321,7 +322,7 @@@ 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; @@@ -432,7 -431,9 +432,9 @@@ /* ---- Begining of FIELD HEADER. */ if (q_fh) { uf_fh = uf+current_fh_index; - uf_fh[1] = scale_factor = 100; + if (k != PH_INDEX) scale_factor = 100; + else scale_factor = 10; + uf_fh[1] = scale_factor; uf_fh[2] = ray->h.range_bin1/1000.0; uf_fh[3] = ray->h.range_bin1 - (1000*uf_fh[2]); uf_fh[4] = ray->h.gate_size; @@@ -498,16 -499,11 +500,16 @@@ 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) */ } }