Changes for RSL in IDL

v1.8 Released May 10, 2017

* rsl_anyformat_to_radar.pro:
  Now recognizes both CfRadial and D3R in netCDF3 and 4.

* rsl_nsig_to_radar.pro:
  Added ability to process Sigmet data types "DBTE" (Total Power Enhanced)
  and "DBZE" (Clutter Corrected Reflectivity Enhanced).

* rsl_cfradial_to_radar.pro (get_cfr_rsl_field_list):
  Fixed problem in which some field variables were overlooked.  Now use
  dimension ids for identification.
  (rsl_cfradial_to_radar):
  Compute "gate_size" and "range_bin1" if not included in range attributes.
  Determine field data dimensions directly instead of relying on attribute
  "n_gates_vary", which has been found not always to be correct.

* rsl_d3r_to_radar.pro: Modified by Stephanie Wingo:
  Modified to handle Olympex campaign data.
  Added new fields.

* rsl_wsr88d_to_radar.pro (open_wsr88d_file):
  Modified to handle files that use internal bzip2 compression: 
    Spawns a process to run external program, "decode_ar2v".
    Runs Makefile to create executable "decode_ar2v", as needed.

  Added software for decoding (subdirectory decode_ar2v):
    decode_ar2v.c: C program to decode the WSR-88D file.
    Makefile:      Compiles decode_ar2v.c to create executable "decode_ar2v",
                   which also stays in subdirectory decode_ar2v.

* rsl_new_ray.pro: Changed "gate_size" data type in ray header to floating
    point.

* rsl_radar_to_uf.pro: Round "gate_size" value before assigning to UF record.


v1.7 Released July 20, 2015

* load_radar_from_wsr88d_m31.pro: Removes MESO-SAILS sweeps unless keyword
  KEEP_SAILS is set.

* rsl_radar_to_cfradial.pro: Added keyword DAT2D. Set it to store data in
  CfRadial as 2-D array.

* rsl_cfradial_to_radar.pro:
  Relaxed the requirements on some required variables.
  Allow for incorrect setting of variable *n_gates_vary*.

* rsl_new_sweep.pro: Added FIXED_ANGLE to sweep header.  Fixed angle may be
  either elevation or azimuth angle, depending on scan mode.

* rsl_remove_sweep.pro: Rewritten to remove multiple sweeps.

* rsl_radar_to_uf.pro: Store fixed angle instead of elevation in the UF
  fixed angle word.  Store RSL-in-IDL version number in UF mandatory header.

* rsl_uf_to_radar.pro: Update the way fixed_angle is used for various scan
  modes.

* rsl_uncompress.pro: Write uncompressed file to user's temporary
  directory. This prevents problem of attempting to uncompress a file in a
  directory not owned by user.

* rsl_plotsweep.pro, rsl_plotrhi_sweep.pro: Changed credit label.


v1.6 Released October 20, 2014

* Added rsl_radar_to_cfradial.pro.

* rsl_cfradial_to_radar.pro (rsl_cfradial_to_radar): Handle unambiguous range
  in km.
  (cfrfields_to_rslfields): Handle additional field names.
  (cfr_prt_to_prf): New function.
  (fr_get_nyquist): New function.
 
* rsl_loadcolortable.pro (rsl_mapcolors): case HC: added 'missing value' to list
  of items to check for setting color to 0.

* load_radar_from_wsr88d_m31.pro: Changed name of common block "indexes" to
  "rsl_wsr88d_indexes" to make it specific.


v1.5 Released August 4, 2014

* Added rsl_cfradial_to_radar.pro to read CfRadial.  It is called by
  rsl_anyformat_to_radar.pro.

* Added rsl_remove_sweep.pro.

* rsl_anyformat_to_radar.pro: Added code for CfRadial. Simplified code for
  handling WSR-88D.

* rsl_fix_time.pro: Bug fix.  This routine is used only in processing Sigmet
  raw files that have the extended header implemented.

* rsl_nsig_to_radar.pro: Modified for new fields: vertical total power (TV),
  vertical reflectivity (ZV), and signal-to-noise ratio (SN).
  Corrected ray elevation computation.  Had been getting elevation from
  extended header when available, otherwise used ending elevation.  It turns
  out that extended header stores elevation as integer, which is less than
  ideal.  Now elevation is computed as average of begin and end elevation.

* rsl_wsr88d_to_radar.pro: Improved method for handling WSR-88D version number
  changes.

* load_radar_from_wsr88d_m31.pro:
  Modified to remove the additional lowest-level sweep inserted in the middle
  of the volume scan in VCPs 12 and 212 when SAILS is in operation.  The
  keyword KEEP_SAILS was added to retain the sweep.
  (load_m31_ray_into_radar, wsr88d_load_sweep_header): Modified to handle
  multiple velocity sweeps in VCP 121 split cuts.  Added two new functions as
  part of this process:
      keep_this_vcp121_refl
      get_vcp121_fieldname
  (get_radar_struct_dimensions): Changed maxbins from 1832 to 1840: that's how
  many were in KDOX20120422_201210.
  (load_radar_from_wsr88d_m31): Added code to handle unexpected end-of-sweep. 
  (load_m31_ray_into_radar): Changed the method for determining when
  reflectivity belongs to a Doppler cut and is therefore discarded: use
  waveform.

* rsl_radar_to_uf.pro: Implemented ray alignment by azimuth for WSR-88D split
  cuts.  Changed scale factor to 10 for rain rate (RR).

* rsl_uf_to_radar.pro: Implemented field selection through FIELDS keyword.
  Fixed a bug in allocating output buffer that occurred when there was only
  one field.  Added CATCH_ERROR keyword and error handler.

* rsl_vslice.pro: Changed to copy radar header members individually to avoid
  "Conflicting data structures" error that occurs on 64-bit machines.

* Added rsl_version.pro to print the RSL-in-IDL version number. 


v1.4 Released September 10, 2011

* rsl_nsig_to_radar.pro: Modified to work correctly with HydroClass parameter.
  nsig_v2_define_structs.pro: Modified nsig structure definitions for
  task_config.dsp_info to agree with manual.  This included adding a data_mask
  structure, where previously it had been a single value.

* rsl_plotsweep.pro: Added the following keywords and functionality:
    range_ring_interval: Specify interval in km between range rings.
    azim_spokes: Specify interval in degrees for azimuth spokes.
    range_azim_spokes: Specify range in km for azimuth spokes.
  See program header or doc file for details.

* load_radar_from_wsr88d_m31.pro (get_wsr88d_unamb_and_nyq_vel): Rewrote
  the routine for clarity.
  (wsr88d_load_sweep_header): Fixed bug which caused incorrect value for
  NSWEEPS in volume header for VR and SW.
  (load_m31_ray_into_radar): incorporated the contents of
  load_data_moment_into_radar here.  This routine now handles processing of
  all data fields, including the Build 12 polarimetric fields.
  (load_data_moment_into_radar): This routine was removed (see preceding).

* rsl_anyformat_to_radar.pro, rsl_nsig_to_radar.pro: Keyword CATCH_ERROR
  is now set by default.  To turn this off, set CATCH_ERROR to zero.
  Also added keyword KEEP_RADAR to these functions.  When set, Radar structure
  is returned when an error occurs, rather than -1.

* rsl_loadcolortable.pro, rsl_colorbar.pro: upgraded to handle increased value
  range in PHI, from 180 degrees to 360.  Thanks to David Wolff.

* rsl_new_radar.pro, rsl_nsig_to_radar.pro: David Wolff added member
  SCHED_SWEEPS to radar header.  This is used only with Sigmet/IRIS data.

* rsl_radar_to_uf_gzip.pro: Added '-f' option to gzip command to prevent prompt
  from gzip when UF already exits.

* rsl_wsr88d_to_radar.pro (load_radar_from_wsr88d_m1): Store VCP number in radar
  header for MSG 1 format.
  Renamed procedure load_radar_from_wsr88d to load_radar_from_wsr88d_m1.

* rsl_radar_to_uf.pro:
  - Changed to use local counters for sweep and ray
    instead of values stored in radar structure.  This became an issue with
    WSR-88D VCP 121 and its multiple VR sweeps at low elevations.
  - Added COMPRESS keyword and code to compress the output UF file (calls
    rsl_radar_to_uf_gzip).
  - Changed scale factor to 10 for PhiDP.  This is necessary when phi > 327.67,
    because when this is multiplied by standard factor of 100 and converted to
    short integer, the result is integer wrap-around.

* rsl_get_sweep.pro: corrected a bug that occurred with WSR-88D VCP 121,
  which contains multiple velocity sweeps in the split cuts.  The function
  sometimes returned a velocity sweep from an elevation other than the
  requested one.  Thanks go to Bob Morris for his discovery and correction of
  this problem.


v1.3 Released October 10, 2008

* rsl_nsig_to_radar.pro: Corrected a problem involving Extended Header
  (ext_hdr), which when present, caused elevation in ray header to be set to 0.

* rsl_new_radar.pro, load_radar_from_wsr88d_m31.pro: Added vcp to radar header.

* load_radar_from_wsr88d_m31.pro (load_data_moment_into_radar): Changed the
  way we determine whether or not to keep the reflectivity field (we don't want
  it from Doppler split cuts).  The previous method was inadequate for VCP 121.


v1.2 Released September 5, 2008

* Added load_radar_from_wsr88d_m31.pro to read WSR-88D Message Type 31 data
  (Level II Build 10).

* rsl_wsr88d_to_radar.pro:
  Set radar.h.scan_mode to 'PPI' as default.
  Updated VCP parameters.  Thanks to Patrick Gatlin.
  Modified for Level II Build 10.

* wsr88d_get_site_info.pro: Improved error report for missing site file.

* rsl_radar_to_uf.pro: Gave scan_mode a default so program doesn't stop if
  radar.h.scan_mode happens to be empty.  Thanks to Stacy Brodzik for catching
  that.


v1.1 Released December 20, 2007

* Added rsl_select_sweeps.pro.  It returns a radar structure containing only
  the sweeps selected.

* New routines to convert range and elevation to/from ground range and height,
  adapted from RSL's range.c routines:
  rsl_get_groundr_and_h.pro
  rsl_get_gr_slantr_h.pro
  rsl_get_slantr_and_elev.pro
  rsl_get_slantr_and_h.pro

* Added rsl_get_uf_last_sweepnum.pro to get the number of the last sweep in a
  volume scan in UF.  This is used by rsl_uf_to_radar to build the radar
  structure with a minimum of unused space.

* rsl_plotsweep.pro, rsl_plotrhi.pro: Bug fix.  Added code for LIKE_FIELD
  keyword so that it actually works.  Thanks go to Rob Cifelli for catching
  that one. Also in rsl_plotsweep.pro: brought together separated sections of
  related code for clarity.

* rsl_vslice.pro: Modified to return radar structure instead of sweep.  This
  is to make it look more like an RHI scan.  Also, SCAN_MODE is set to 'RHI'
  in the radar header.

* rsl_nsig_to_radar.pro, rsl_open_radar_file.pro: minor mods to improve error
  handling.

* rsl_uf_to_radar.pro (load_ray_from_uf, store_sweep_header, rsl_uf_to_radar),
  rsl_radar_to_uf.pro: Changed sweep indexing to be independent of sweep number.

* rsl_wsr88d_to_radar.pro (load_radar_from_wsr88d): Modified to handle unusual
  message packets at start of WSR-88D files from some future GPM sites.  They
  contained apparently erroneous ray status values signalling end of volume
  scan.

* wsr88d_get_site_info.pro: Modified to read wsr88d_locations.dat instead of
  using wsr88d_locations.pro.  Removed wsr88d_locations.pro.


v1.0 Released August 1, 2007

* rsl_plotrhi.pro: New. Plots an RHI scan.

* rsl_plotsweep.pro: Added keyword BGWHITE to set white background for image.

* rsl_plotsweep_from_radar.pro: Added code to call rsl_plotrhi if scan mode
  is RHI.

* rsl_loadcolortable.pro: Removed rsl_colorbar and rsl_plot_colorbar.
  They have been merged into a single routine in rsl_colorbar.pro.

v0.16 Released June 27, 2007

* rsl_nsig_to_radar.pro (nsig_get_ray): Corrected a problem with decompressing
  two-byte data on big endian machines.

v0.15 Released June 18, 2007

* rsl_nsig_to_radar.pro: Modified to handle RHI and to handle Sigmet two-byte
  data types.  Added keyword MAXSWEEPS to specify the maximum number
  of sweeps to be read from file.  Added keyword FIELDS to specify which
  fields are to be read from file.
  (read_nsig_into_radar): Removed. Sweep-loop moved into rsl_nsig_to_radar.
  (nsig_read_ray): Changed name to nsig_get_ray.
  (nsig_get_ray): Corrected a problem with decompressing one-byte data on
  big endian machines.

* rsl_radar_to_uf.pro and rsl_uf_to_radar.pro: Modified to use Local Use Header
  to store and retrieve WSR-88D VR azimuth.  This is necessary because WSR-88D
  runs separate scans for DZ and VR at lower elevations, which means that they
  have different azimuths for a given ray.  Thanks go to Pat Kennedy of CSU for
  discovering this problem and for bringing it to our attention.
  These routines were also modified to handle RHI.  Added a check for empty
  rays, which occurred with RHI.

* rsl_uf_to_radar.pro: Added keyword MAXSWEEPS to specify the maximum number
  of sweeps to be read from UF file.

* rsl_radar_to_uf.pro: Modified to allow selection of fields to be written
  to UF.  FIELDS keyword added for passing string array of field names.

* rsl_new_radar.pro: Added new member to radar header (radar.h), named
  SCAN_MODE.  It is a string variable to contain the scan type ('PPI', 'RHI').

* rsl_changefield.pro: New. Provides for changing the field type in a volume
  header and the sweep headers within volume.

* rsl_vslice.pro: New. Retrieve an RHI-like vertical slice of volume scan at
  the given azimuth.

* rsl_which_struct.pro: New. Returns the name of the rsl structure given as
  argument.

* rsl_lassen_to_radar.pro: bug fix: PRF in ray header was off by a factor of 10.

* rsl_get_ray_from_sweep.pro: Rewritten to simplify code and to correct a
  problem with azimuths at 0 and 360 degrees.

* rsl_uncompress.pro: Modified to handle multiple line error output from SPAWN.

v0.14 Released July 20, 2006

* lassen_to_radar.pro (load_lassen_sweeps): Changed field type for
  differential reflectivity from DR back to ZD for conformity with RSL.

v0.13 Released July 12, 2006

* Added rsl_lassen_to_radar.pro and rsl_read_lassen.pro to read Lassen format
  data into the Radar structure.

* Added rsl_add_volume.pro to add a field to existing radar structure.

* rsl_get_volume.pro: if field is not found and it is one of the reflectivity
  field types (DR or ZD), and the alternative name is present, use that field.
  For example, if field DR is not found, and ZD is present, use ZD.

* rsl_plotsweep.pro: Added keyword "LIKE_FIELD" for the case when the user
  has created a new field type not recognized by the program.  rsl_plotsweep
  will plot the current data using the same colors and scaling used for the
  field specified in LIKE_FIELD.
  Made changes in some variable names to make code more self-documenting.
  Moved routines rsl_mapcolors and rsl_colorbar to rsl_loadcolortable.pro.

* rsl_nsig_to_radar.pro (nsig_sweep_to_radar):
  Added computations for mean azimuth, taken from nsig_to_radar.c (RSL in C).
  Added ray number check to prevent reading junk after last ray of sweep.
  Added ability to handle Signal Quality Index (SQ) field.
  (rsl_nsig_to_radar): Use date and time from first ray of sweep for radar
  header.

* rsl_loadcolortable.pro:
  (rsl_mapcolors, rsl_colorbar, rsl_loadcolortable): 
  Added fields SW, DR, KD, RH, and PH.

  (rsl_mapcolors): changed coloray cast from "fix" to "long" to avoid
  occasional floating point error messages when a no-data value was converted
  to short integer.  This problem never affected results.
  Corrected index for VR "rangefolded".  Fixed bug where all values were set
  to rangefolded if Nyquist velocity not specified (fields VR and SW).

  (rsl_colorbar): Modified colorbar plotting for DZ so that it is now handled by
  rsl_plot_colorbar as it is for the other fields.

  (rsl_mapcolors, rsl_colorbar): Moved these routines from rsl_plotsweep.pro
  to rsl_loadcolortable.pro since all three require modification when a new
  field is added.

* rsl_anyformat_to_radar, rsl_hdf_to_radar, rsl_nsig_to_radar,
  rsl_uf_to_radar, rsl_wsr88d_to_radar and rsl_lassen_to_radar: Added the
  keyword "ERROR" to return error flag to the caller of these routines.

* rsl_get_ray.pro: Use either sweep or volume as input.  Previously, volume
  was required as in C version, but logically, it makes sense to use sweep.

* Improved error checks for rsl_open_radar.pro and rsl_uncompress.pro.
  uncompress.pro changed to rsl_uncompress.pro.

v0.12 Released February 24, 2005

* rsl_hdf_to_radar.pro, rsl_get_numvos.pro: Added error check to handle files
  that cannot be opened.
* rsl_plotsweep.pro: Error correction: In the range computation, range to first
  gate was being subtracted instead of added.  Since the range to gate 1 is
  usually 0, it took awhile for the problem to show up.
  Vectorized conversion of cartesian coordinates to longitude/latitude.

v0.11 Released December 14, 2004

* rsl_nsig_to_radar: Added a check for nvolumes/nfields > 0. If not, return -1
  (no radar).
* rsl_plotsweep_from_radar.pro: Added error checking: Check that rsl_get_volume
  and rsl_get_sweep return with valid structure.

v0.10 Released December 13, 2004

* rsl_plotsweep.pro (map_colors, rsl_plotsweep): added code to skip bad rays
  (nbins eq 0) that were turning up in NPOL data.

v0.9 Released December 8, 2004

* rsl_anyformat_to_radar: Added optional error handler: It allows functions to
  return with -1 on IDL errors that would normally stop processing. 

* Added QUIET keyword to the following:
    rsl_anyformat_to_radar.pro
    rsl_hdf_to_radar
    rsl_nsig_to_radar.pro
    rsl_uf_to_radar.pro
    rsl_wsr88d_to_radar.pro

* rsl_plotsweep.pro: Added field ZT (same as DZ).

* rsl_nsig_to_radar (nsig_sweep_to_radar): Added a check for valid Raw Product
  structure ID in order to catch occasional bad data in NPOL files. If invalid
  ID is found, processing stops on current file and radar structure is returned
  containing the data processed to the point of error.
  (nsig_read_ray): Separated nsig_ray structure definition from data assignment
  to improve readability.
  (rsl_nsig_to_radar): fixed a bug in which value scaling was inadvertently
  dependent on a conditional for byte swapping.
  Renamed internal functions with prefix "nsig_".

* Renamed open_radar_file to rsl_open_radar_file and did the same in its
  callers.

v0.8 Released November 22, 2004

* uncompress.pro: Replaced call to obsolete "rstrpos" with
  "strpos/REVERSE_SEARCH". Removed check for "gzip" with spawn/capture because
  it can falsely claim "gzip not found" with older versions that print to
  stderr instead of stdout.

v0.7 Released November 18, 2004

* rsl_hdf_to_radar.pro (load_data_from_hdf): Fixed a bug that occurred in CZ
  processing when all data in a ray was masked.

* rsl_plotsweep.pro (rsl_mapcolors, rsl_colorbar): Added CZ field (same as DZ).
* rsl_loadcolortable.pro: Added CZ field (same as DZ).

v0.6 Released November 16, 2004

* rsl_wsr88d_to_radar.pro: Made sweep processing more robust to handle new
  Volume Coverage Patterns. This involved changing the way sweeps are handled
  so that it is no longer necessary to know in advance the number of sweeps
  per elevation of a particular VCP.  Added information for new VCPs 12 and
  121.

* rsl_radar_to_uf.pro: Modified to handle WSR-88D's multiple sweeps per
  elevation at low elevations.
  
* rsl_plotsweep.pro: Generalized to handle additional fields. Added routines
  rsl_mapcolors and rsl_colorbar.
* rsl_loadcolortable.pro: Added color table for velocity (VR). This function
  was formerly named loadcolortable.pro.

v0.5 Released October 25, 2004

* rsl_get_ray_from_sweep.pro:
  Fixed a bug which resulted in failure to find requested azimuth if it was
  near endpoints of sweep, that is, azimuth 0 or 360.

v0.4 Released October 5, 2004

* rsl_anyformat_to_radar.pro (rsl_filetype), rsl_wsr88d_to_radar.pro:
  Modified to handle new NEXRAD Level II Build 5 format.

* is_compressed.pro: Check for gzip magic number in addition to file extension.

* wsr88d_locations.pro: Simplified array assignment.

v0.3 Released August 12, 2004

* rsl_uf_to_radar.pro (read_uf_record): Fixed a bug that caused unnecessary
  byteswapping of strings on Mac.

v0.2 Released July 14, 2004

* Bug fix: Restored keyword SWEEP_INDEX to rsl_get_sweep.pro so that it would
  again work correctly with rsl_plotsweep_from_radar.

v0.1 Released June 17, 2004

* First release.
