]> Pileus Git - ~andy/rsl/commitdiff
Merge branch 'master' into aweather
authorAndy Spencer <andy753421@gmail.com>
Sun, 28 Aug 2011 20:24:04 +0000 (20:24 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 28 Aug 2011 20:32:45 +0000 (20:32 +0000)
Conflicts:
Makefile.am
configure.in
src/rsl.h

1  2 
README
configure.ac
doc/index.html
src/Makefile.am
src/nsig.c
src/nsig_to_radar.c
src/radar_to_uf.c

diff --combined README
index 9062c340cd7b6857a4bf2e40218cde4a811b948c,679b8f458fef03bb83688e2bd8946f3af23838c9..6ec254dbbf481d147400754e4aa1de892e590e6d
--- 1/README
--- 2/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 fd7d07255f73b2f7194901a0ebb62fa0dd6b0f71,0000000000000000000000000000000000000000..2b59634bc41bb6c6f5606535bd38bd123923cbed
mode 100644,000000..100644
--- /dev/null
@@@ -1,64 -1,0 +1,64 @@@
- 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
diff --combined doc/index.html
index a28468a425b3f7670839542220c52d4f7850cc67,2063d1730f7f18cea3772a9a74dc542b9cf547c1..903b49a13122f8e2a639af5ad803d774adf4e7a1
@@@ -6,6 -6,7 +6,7 @@@
     <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>
@@@ -21,8 -22,8 +22,8 @@@
  <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
@@@ -143,6 -144,14 +144,6 @@@ Supported Radar Data Formats</h1
  
  <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>
  
diff --combined src/Makefile.am
index 511b83028c2aca082a61097059f911168933b51c,0000000000000000000000000000000000000000..dbc3fd391b6c684210e2d2ac81690dcd1b994a33
mode 100644,000000..100644
--- /dev/null
@@@ -1,40 -1,0 +1,40 @@@
- 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
diff --combined src/nsig.c
index c00b5ed44257065c2c072c8610aff04a22bb5fb6,256f26501fffc4d5037dc0876ca8bb2e956b2e7b..9ae591356cbd02b6d50b82377f452aef2e44cf31
--- 2/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];
     */
  
  #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*));
diff --combined src/nsig_to_radar.c
index 5dda3ffb3450bdab18a8b46c098107cfb510ca1e,03d739f75fe5b339ae31f5945bfde81e7e422d52..166aced2537babc0478a92edcc087b03f1747da8
@@@ -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;
    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 b5ca2d4bb4409702588d629354f02b28d146ef42,e281486ef5bc388d62b3ee243386cb8b581d8ac3..f5a18abf3821d494808486cfbf8c3ce89cca5021
@@@ -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).
          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) */
      }
    }