- v1.41 (Released 6/22/2011)
+ v1.42 (Released 7/12/2011)
This is the README file for the Radar Software Library (RSL).
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
--- /dev/null
- AC_INIT(rsl, 1.41)
+# Process this file with autoconf to produce a configure script.
++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
<title>TRMM Satellite Validation Office Web Site</title>
</head>
<body>
+ <script src="/trmm_gv/header.js"></script>
<center><table BORDER=2 >
<h2><center>TRMM Radar Software Library</center></h2>
<hr></center>
<h2>
- Current RSL Version 1.40, released 10/10/2008<br>
- Supports WSR-88D Level II Build 10 Format</h2>
+ Current RSL Version 1.42, released 7/12/2011<br>
+ Supports WSR-88D Level II Build 12 Format</h2>
In support of the <a href="http://trmm-fc.gsfc.nasa.gov">Tropical Rainfall
Measuring Mission</a>'s (TRMM) <a href="http://trmm-fc.gsfc.nasa.gov/trmm_gv/index.html">Global
<td>Yes</td>
-<td>No</td>
-</tr>
-
-<tr>
-<td>EDGE</td>
-
-<td>Yes</td>
-
<td>No</td>
</tr>
</table></center>
<script src="/trmm_gv/trailer.js"></script>
-
+ </body>
</HTML>
--- /dev/null
- librsl_la_LDFLAGS = -version-info 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: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
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];
*/
#define Vprint
- #undef Vprint
+ /* #undef Vprint */
/* Determine if we need to byte-swap values. */
(void)nsig_endianess(&prod_file->rec1);
/* 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*));
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;
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.
*/
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).
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;
/* ---- 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;
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) */
}
}