Using gen_bfield from the idl command line

  It is assumed the following codes are available to IDL:
     read_raw_mfe.pro   reads 8 Hz POLAR/MFE data from hydra L1 file
     get_hr_bmag.pro    provides POLAR Bfield magnitude at 54Hz
     gen_bield.pro      compiles the above and Hydra 54Hz Bfield direction 
                           data sets into high-quality, 54Hz 3D Bfield data 
                           product.
     
  For this example, the Hydra Level1 file 19960520_hyd_dd_v3.05.cdf and
     the hydra l1 calibration (or "ddcal") file 19960520_hyd_ddcal_v3.35.cdf
     are in the directory /data/polar/hydra/l1/.
  
  Procedure: gen_bfield is called with time and format specified, and
     it returns the bfield product.  In the example, we'll retrieve 54Hz 
     bfield data in cartesian coordinates, in fixed payload from the period
     2-2.1UT on 5/20/1996.
  
  Example:
     
  ;      First, open the level1 and ddcal cdf files:
      raw= cdf_open( '/data/polar/hydra/l1/19960520_hyd_dd_v3.05.cdf' )
      cal= cdf_open( '/data/polar/hydra/l1/19960520_hyd_ddcal_v3.05.cdf' )
       
  ;      Then determine which records contain the times 2-2.1UT
      start_time= 2.0
      end_time= 2.1
      cdf_control, raw, variable='BLOCK_TIME', get_var_info=r
      cdf_varget, raw, 'BLOCK_TIME', time_epoch, rec_start=0,rec_count=r.maxrec
      time_hr= time_epoch mod (86400*1000.) / (3600*1000L)
      r= where( time_hr ge start_time and time_hr le end_time, count )
      rec_start= r(0)
      rec_count= r(count-1) - r(0) + 1
  
  ;      That's all we need to use gen_bfield.
      gen_bfield, raw, cdfcal=cdl, rec_start, rec_count, $
  	/xyz, bx=bx, by=by, bz=bz, time=bt, bvalid= bvalid, /Hz54
      r= where( valid eq 1 )
      if r(0) ne -1 then plot, bt(r), bx(r), psym=4
  
  The code gen_bfield_wrap.pro will perform these functions.  


Documentation:
  See gen_bfield.pro for additional keywords.
  See gen_bfield.ps for description of the procedure.


