*********************************************************
Electron Drift Instrument (EDI) Variable Definitions
These are currently the EDI_PISO output variables found in
either the EDI PP CDF files, or the EDI Archive CDF File (PP-plus):

 Epoch__                                BOTH
 V_ed_xyz_gse__				BOTH
 E_xyz_gse__				BOTH
 Reduced_chi_sq__			BOTH
 Status__				BOTH
 Drift_step_mag__			PP-plus
 Drift_step_mag_error_inertial__	PP-plus
 Drift_step_azi_error_inertial__	PP-plus
 Nbeam__				PP-plus

 V_ed_xyz_gse_loser__			PP-plus
 E_xyz_gse_loser__			PP-plus	
 Reduced_chi_sq_loser__			PP-plus	
 Status_loser__				PP-plus	
 Drift_step_mag_loser__			PP-plus
 Drift_step_mag_error_inertial_loser__	PP-plus
 Drift_step_azi_error_inertial_loser__	PP-plus
 Nbeam_loser__				PP-plus

Written: September 12th, 2003
         Pamela A. Puhl-Quinn (ppq@mpe.mpg.de)

*********************************************************
*********************************************************
Name: V_ed_xyz_gse__
Type: REAL4
Size: 3
Fill: -1e+31
Units: km/s
Coord: GSE
Defn: Electron drift velocity perpendicular to the magnetic field;
      Corrected for the SC motion
*********************************************************
Name: E_xyz_gse__
Type: REAL4
Size: 3
Fill: -1e+31
Units: mV/m
Coord: GSE
Defn: Perpendicular electric field
      Corrected for the SC motion
*********************************************************
Name: Reduced_chi_sq__
Type: REAL4
Size: Scalar
Fill: -1e+31
Units: unitless
Coord: N/A
Defn: Reduced chi-squared of the Triangulation analysis fit;
      Only valid if the end method used was triangulation;
      If other method used, this variable is given a value of -1.0
*********************************************************
Name: Status__
Type: UINT1
Size: 7
Fill: 255
Units: varies (see below)
Coord: N/A
Defn: See below
Note: These 7 variables are either all fill, or all non-fill,
      never mixed (so that QSAS won't have problems)
*********************************************************
Name: Drift_step_mag__
Type: REAL4
Size: Scalar
Fill: -1e+31
Units: meters
Coord: N/A
Defn: Drift step magnitude
Note: To be used together with Sbyte5 for post-processing 
      re-assignment of quality if desired
*********************************************************
Name: Drift_step_mag_error_inertial__
Type: REAL4
Size: Scalar
Fill: -1e+31
Units: meters
Coord: N/A
Defn: Drift step magnitude error in the inertial (wrt Earth) frame
Note: 
*********************************************************
Name: Drift_step_azi_error_inertial__
Type: REAL4
Size: Scalar
Fill: -1e+31
Units: degrees
Coord: N/A
Defn: Drift step azimuthal error in the inertial (wrt Earth) frame
Note: 
*********************************************************
Name: Nbeam__
Type: INT2
Size: Scalar
Fill: 32767
Units: N/A
Coord: N/A
Defn: Number of beams used in calculation
Note: To be used for post-processing 
      re-assignment of quality if desired

=========================================================
DEFINITIONS OF STATUS BYTES
=========================================================
Sbyte0: Quality
     Sbyte0 = 0 ---> 'BAD'
     Sbyte0 = 1 ---> 'CAUTION'
     Sbyte0 = 2 ---> 'GOOD'

IF CONTROL PARAMETER pp_qual_assign_meth eq 0 THEN THE
ASSIGNMENT OF SBYTE0 IS DONE USING THE LOGIC FOUND IN
THE EDI_PISO ROUTINE
   ep_assign_quality_0.pro
THIS IS CURRENTLY THE DEFAULT FOR DM03 AND VERSIONS >= 2.42

IF pp_qual_assign_meth ne 0, THE FOLLOWING OLD LOGIC IS USED:
Triangulation ----------------------
'BAD':  rchi2 gt 20 or derror/d gt 1
'GOOD': rchi2 lt 5 and derror/d lt .30
'CAUTION': Everything that's left

Poorman's ToF ----------------------
'BAD':  derror/d gt 1
'GOOD': derror/d lt .3
'CAUTION': Everything that's left

Simultan ToF -----------------------
'BAD':  derror/d gt 1
'GOOD': derror/d lt .3
'CAUTION': Everything that's left

Richman's ToF ----------------------
'BAD':  derror/d gt 1
'GOOD': derror/d lt .3
'CAUTION': Everything that's left

=========================================================   
Sbyte1: Percentage of 1keV beams used in entire spin
        (If 100, then we're not in energy switching;
         If 0, then we're at 0.5keV;
         Else, we're in energy switching mode)
=========================================================   
Sbyte2: Percentage of Class-A beams used in entire spin
=========================================================   
Sbyte3: Method Papertrail and Ambiguity Flag

 Bits 0-4 reflect the value of the control parameter pp_method:
 If Bits 0-4 aren't set, then pp_method = 0 -- Forced TRI
 Bit 0 set if pp_method = 1 -- TRI/PMT/SMT examined - Logic Chain 1
 Bit 1 set if pp_method = 2 -- Forced PMT
 Bit 2 set if pp_method = 3 -- TRI/PMT/SMT examined - Logic Chain 2
 Bit 3 set if pp_method = 4 -- TRI/PMT/SMT examined - Logic Chain 3
 Bit 4 set if pp_method = 5 -- Forced SMT
 Bit 0 and 1 set if pp_method = 6 -- Forced PMT/SMT
 Bit 0 and 2 set if pp_method = 7 -- TRI/RMT examined
 Bit 0 and 3 set if pp_method = 8 -- Forced RMT
 Bit 0 and Bit 4 set if pp_method = 9 -- Both methods forced, winners/losers

 If Bits 5-6 aren't set, then method used in the end was Triangulation (TRI)
 Bit 5 set if method used in the end was Poorman's ToF (PMT)
 Bit 6 set if method used in the end was Simultan ToF (SMT)
 Bit 5 and 6 set if method used in the end was Richman's ToF (RMT)

 Bit 7:  Not set = No 180-degree ambiguity in drift step
         Set     = 180-degree ambiguity exists


=========================================================  
Sbyte4: Percentage of Triangulation outliers 
        (only reported for triangulation results)

=========================================================
Sbyte5: Fractional drift step magnitude error (percent) in SC frame (0-254)

=========================================================
Sbyte6: Drift step azimuthal error in degrees in SC frame (0-254)

