This page was created by the IDL library routine mk_html_help2.

Last modified: Tue May 7 11:36:21 2013.


Directory Listing of Routines


Routine Descriptions

RBSP_AC_HIGHPASS_RESPONSE (FUNCTION)

[Next Routine] [List of Routines]
 NAME:
   rbsp_ac_highpass_response (function)

 PURPOSE:
   Calculate the response of the one-pole 10 Hz high-pass analog filter applied
   to RBSP AC channel field signals.

 CATEGORIES:

 CALLING SEQUENCE:
   resp = rbsp_ac_highpass_response(f)

 ARGUMENTS:
   f: (Input, required) A frequency array for which the response of the filter
       is calcuated. The frequency should be in units of Hz.

 KEYWORDS:
   None.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-08: Created by Jianbao Tao, SSL, UC Berkeley.
 

 Version:

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-09-06 11:42:13 -0700 (Thu, 06 Sep 2012) $
 $LastChangedRevision: 10895 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_ac_highpass_response.pro $

(See ssl_general/missions/rbsp/efw/rbsp_ac_highpass_response.pro)


RBSP_ADC_RESPONSE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_adc_response (function)

 PURPOSE:
   Calculate the responses of the RBSP DFB ADC chip.

 CATEGORIES:

 CALLING SEQUENCE:
   response = rbsp_adc_response(f, channel, delay = delay)

 ARGUMENTS:
   f: (Input, required) A floating array of frequencies at which the responses
           are calculated.
   channel: (Input, required) A string of channel names. Valid channels are:
          'V1DC',  'V2DC',  'V3DC',  'V4DC',  'V5DC',  'V6DC',
          'E12DC', 'E34DC', 'E56DC', 'E12AC', 'E34AC', 'E56AC', 
          'V1AC', 'V2AC', 'V3AC', 'V4AC', 'V5AC', 'V6AC', 
          'MAGU', 'MAGV', 'MAGW', 'MSCU', 'MSCV', 'MSCW'

 KEYWORDS:
   delay: (Output, optional) A variable name to hold the time delay of the
          given channel.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-10: Created by Jianbao Tao (JBT), SSL, UC Berkley.


 Version:

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-09-06 11:42:13 -0700 (Thu, 06 Sep 2012) $
 $LastChangedRevision: 10895 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_adc_response.pro $

(See ssl_general/missions/rbsp/efw/rbsp_adc_response.pro)


RBSP_ANTI_ALIASING_RESPONSE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_anti_aliasing_response (function)

 PURPOSE:
   Calculate the frequency responses of the anti-aliasing filters for RBSP
   field signals.

 CATEGORIES:

 CALLING SEQUENCE:
   response = rbsp_anti_aliasing_response(f)

 ARGUMENTS:
   f: (Input, required) A floating array of frequencies at which the responses
           are calculated.

 KEYWORDS:
   None.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-10: Created by Jianbao Tao (JBT), SSL, UC Berkley.


 Version:

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-09-06 11:42:13 -0700 (Thu, 06 Sep 2012) $
 $LastChangedRevision: 10895 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_anti_aliasing_response.pro $

(See ssl_general/missions/rbsp/efw/rbsp_anti_aliasing_response.pro)


RBSP_COTRANS (PROCEDURE)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_cotrans (procedure)

 PURPOSE:
   A wrapper of cotrans for RBSP, with a few mission-specific features added.

 CATEGORIES:

 CALLING SEQUENCE:
   rbsp_cotrans, from_tvar, to_tvar $
     , gse2gsm = gse2gsm $
     , gsm2gse = gsm2gse $
     , dsc2gse = dsc2gse $
     , dsc2mgse = dsc2mgse $
     , dsc2gsm = dsc2gsm $
     , gse2dsc = gse2dsc $
     , gse2mgse = gse2mgse $
     , gsm2dsc = gsm2dsc $
     , dsc2fac = dsc2fac $
     , mat_dsc = mat_dsc $
     , tmag    = tmag    $
     , vectype = vectype $
     , verbose = verbose

   NOTES:
   1. A tplot variable of magnetic field in DSC, specified with tmag keyword,
      is required to perfrom dsc2fac. The default value of tmag is something
      like 'rbspa_mag_dsc'.
   2. A tplot variable of rotation matrix from DSC to GSE, specified with the
      mat_dsc keyword, is required to perform dsc2gse, gse2dsc, dsc2gsm,
      and gsm2dsc. The rotation matrix is usually generated by
      *rbsp_load_state*. The default value of mat_dsc is something like
      'rbspa_mat_dsc'.

 ARGUMENTS:
   from_tvar: (In, required) A tplot variable to which the rotation is applied.
   to_tvar: (Out, required) A tplot name for storing the rotation results.

 KEYWORDS:
   The following keywords enable the transformations indicated by their names.
   /gse2gsm, /gsm2gse, /dsc2gse, /dsc2gsm, /gse2dsc, /gsm2dsc

   mat_dsc: (In, optional) A tplot name of the rotation matrix between DSC and
         GSE. It is usually loaded in rbsp_load_state. By default, this name is
         derived as 
                 strmid(from_tvar, 0, 6) + 'mat_dsc'
   vectype: (In, optional) The type of the vectors being transformed. Valid
         types are 'E', 'B', and 'V'. By default, vectype = ''. This string is
         used for labelling the to_tvar.
   verbose: (In, optional) A number to indicate the verbose level. See dprint.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-11-03: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-05: JBT, SSL, UC Berkley.
               Initial release to TDAS.
   2012-11-20: JBT, SSL, UC Berkley.
               1. Added dsc-to-fac transformation.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2013-03-20 13:46:28 -0700 (Wed, 20 Mar 2013) $
 $LastChangedRevision: 11849 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_cotrans.pro $

(See ssl_general/missions/rbsp/efw/rbsp_cotrans.pro)


RBSP_DESPIN (PROCEDURE)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_despin (procedure)

 PURPOSE:
   Rotate data from a spinning frame to DSC. By default, the spinning frame is
   assumed to be the UVW frame.

 CATEGORIES:

 CALLING SEQUENCE:
   rbsp_despin, sc, tvar, angle_offset = angle_offset, pertvar = pertvar, $
     newname = newname, uvw = uvw, xyz = xyz, offset_name = offset_name, $
     no_axial_processing = no_axial_processing,  $
     no_offset_remove = no_offset_remove, $
     tper = tper, tphase = tphase

 ARGUMENTS:
   sc: (In, required) Spacecraft name. Should be 'a' or 'b'.
   tvar: (In, required) Tplot variable to be despun, such as 'rbspa_mag_uvw'.

 KEYWORDS:
   angle_offset: (In, optional) Angle offset additional to spin phase. For UVW,
         angle_offset is 10 degree, which is the default.
   pertvar: (In, optional) Spin period tplot data. By default, 
         pertvar = 'rbsp' + strlowcase(sc[0]) + '_spinper'.
   newname: (In, optional) New name for the despun data. By default, 
         newname = tvar + '_dsc'
   /uvw: Shortcut for rotating UVW data.
   /xyz: Shortcut for rotating XYZ data. Equivalent to set angle_offset = 45.
   offset_name: A tplot name for saving offsets in spin-plane components.
   /no_axial_processing: If set, axial component is not processed. By default,
         the first spin-tone harmonic is removed in the axial component.
   /no_offset_remove: If set, offsets in spin-plane components are not removed.
   tper: (In, optional) Tplot name of spin period data. By default, 
         tper = pertvar. If tper is set, pertvar = tper.
   tphase: (In, optional) Tplot name of spin phase data. By default, 
         tphase = 'rbsp' + strlowcase(sc[0]) + '_spinphase'
         Note: tper and and tphase are mostly used for using eclipse-corrected
         spin data.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-11-03: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-05: Initial release to TDAS. JBT, SSL/UCB.
   2012-11-06: JBT, SSL/UCB.
         1. Added tper and tphase to use eclipse-corrected spin data.
         2. Added keyword *no_offset_remove*.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2013-02-08 16:58:01 -0800 (Fri, 08 Feb 2013) $
 $LastChangedRevision: 11556 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_despin.pro $

(See ssl_general/missions/rbsp/efw/rbsp_despin.pro)


RBSP_DFB_RESPONSE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_dfb_response (function)

 PURPOSE:
   Calculate DFB responses at given frequencies. Two modes are suppored. If the
   sample rate keyword, SAMPLE_RATE, is specified, it will calculate the
   response of the low-pass output from DFB. If the the filter bank level
   keyword, FBK_LEVEL, is specified, it will calculate the response of the
   corresponding filter bank level. 

   Warning: If both keywords are set, FBK_LEVEL is ignored. If neither is set,
            a NaN will be returned.

   Filter bank level look-up table:
       Frequency range in Hz  |  Level
           8192 - 4096        |    1
           4096 - 2048        |    2
           2048 - 1024        |    3
           1024 -  512        |    4
            512 -  256        |    5
            256 -  128        |    6
            128 -   64        |    7
             64 -   32        |    8
             32 -   16        |    9
             16 -    8        |    10
              8 -    4        |    11
              4 -    2        |    12
              2 -    1        |    13

 CATEGORIES:

 CALLING SEQUENCE:
   result = rbsp_dfb_response(f, sample_rate = sample_rate, $
                        fbk_level = fbk_level)

 ARGUMENTS:
   f: (Input, required) A floating array of frequencies at which the responses
           are calculated.

 KEYWORDS:
   sample_rate: (Input, optional) See PURPOSE.
   fbk_level: (Input, optional) See PURPOSE.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-08: Created by Jianbao Tao (JBT), SSL, UC Berkley.


 Version:

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-09-06 11:42:13 -0700 (Thu, 06 Sep 2012) $
 $LastChangedRevision: 10895 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_dfb_response.pro $

(See ssl_general/missions/rbsp/efw/rbsp_dfb_response.pro)


RBSP_EFW_BOOM_LENGTH (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_boom_length (function)

 PURPOSE:
   Return the boom length for a give time.

 CATEGORIES:

 CALLING SEQUENCE:
   result = rbsp_efw_boom_length(sc, time)

 ARGUMENTS:
   sc: (In, required) Spacecraft name. Should be 'a' or 'b'.
   time: (In, required) A value of time.

 KEYWORDS:

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-10-08: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-05: Initial release to TDAS. JBT, SSL/UCB.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-11-05 08:45:25 -0800 (Mon, 05 Nov 2012) $
 $LastChangedRevision: 11176 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_boom_length.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_boom_length.pro)


RBSP_EFW_BOOM_RESPONSE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_boom_response (function)

 PURPOSE:

 CATEGORIES:

 CALLING SEQUENCE:
   resp = rbsp_efw_boom_response(f, boom_type, rsheath = rsheath, $
   H_before = H_before, H_after = H_after)

 ARGUMENTS:

 KEYWORDS:

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-12: Created by Jianbao Tao (JBT), SSL, UC Berkley.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-08-14 18:00:24 -0700 (Tue, 14 Aug 2012) $
 $LastChangedRevision: 10823 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_boom_response.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_boom_response.pro)


RBSP_EFW_CAL_FBK

[Previous Routine] [Next Routine] [List of Routines]
 NAME: rbsp_efw_cal_fbk

 PURPOSE: Calibrate RBSP filterbank data

 NOTES: -This is meant to be called from rbsp_load_efw_fbk.pro
		 -No check at this point to see if the channel changes over day. Now I'm using
		  the channels at the start of day. 
		 -Not yet putting SCM values in nT. 
		 -Boom lengths currently set to     100.02000       100.02000       10.000000
		 -Make sure gain curves are the values at the center of the freq bin
		 -add in boom shorting factor


 SEE ALSO:

 HISTORY:
   2012-xx-xx: Created by Aaron W Breneman, University of Minnesota
	2013-04-xx: added support for FBK 7
	2013-04-18: Added freq-dependent gain correction. At this point the gain curves
				are "hard-wired" into the code. In the future they will be accessed
				from the Berkeley RBSP website. 


 VERSION:
 $LastChangedBy:  $
 $LastChangedDate:  $
 $LastChangedRevision:  $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/missions/rbsp/efw/rbsp_efw_cal_fbk.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_cal_fbk.pro)


RBSP_EFW_CAL_SPEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME: rbsp_efw_cal_spec

 PURPOSE: Calibrate RBSP spectral data

 NOTES: Intended to be called from rbsp_load_efw_spec.pro

 TO DO: 
		-No accounting for midday source change
		-only set up for 64 bins at the moment
		-not using boom shorting factor

		There are 7 returned spec channels. The possibilities are
			Select 7 of: E12dc,E34dc,E56dc
						 E12ac,E34ac,E56ac
						 Edcpar,Edcprp
						 Eacpar,Eacprp
						 V1ac,V2ac,V3ac,V4ac,V5ac,V6ac
						 SCMU,SCMV,SCMW
						 SCMpar,SCMprp,
						 (V1dc+V2dc+V3dc+V4dc)/4,
						 Edcprp2, Eacprp2, SCMprp2
		


 Calibration procedure

	subtract offset
		vals = (double(vals) - offset[j])
   Compensate for 4 bit dynamic range compression
       vals /= 16.
	Divide the 0th bin by 4 (from weirdness doc)
		vals[*,0] /= 4.
	Compensate for using Hanning window
		vals /= 0.375^2
	Apply ADC conversion
		vals *= adc_factor^2
	Apply channel gain
		vals *= gain[j]^2   (V^2/Hz at this point)
	Apply boom length to change from V^2/Hz to mV/m^2/Hz				
		vals *=  conversion[j]^2   ;mV/m ^2 /Hz

	Apply freq dependent gain
			



 HISTORY:
   2012-09-xx: Created by Aaron W Breneman, University of Minnesota
	2013-04-xx: added automated channel selection
	2013-04-23: added freq-dependent gain

 VERSION:
 $LastChangedBy:  $
 $LastChangedDate:  $
 $LastChangedRevision:  $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/missions/rbsp/efw/rbsp_efw_cal_fbk.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_cal_spec.pro)


RBSP_EFW_CAL_WAVEFORM (PROCEDURE)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_cal_waveform (procedure)

 PURPOSE:
   Calibrate EFW waveform data.

 CATEGORIES:

 CALLING SEQUENCE:
   rbsp_efw_cal_waveform, probe = probe, datatype = datatype, $
     trange = trange, get_support_data = get_support_data, $
     coord = coord, no_adc = no_adc, $
     tper = tper, tphase = tphase

 ARGUMENTS:

 KEYWORDS:
   probe: (In, optional) RBSP spacecraft names, either 'a', or 'b', or 
         ['a', 'b']. The default is ['a', 'b']
   datatype: (In, optional) A string scalar of data types that acceptable to 
         *rbsp_load_efw_waveform*.
   trange: (In, optional) Time range for performing the calibration. By
         default, trange = timerange()
   /get_support_data: If set, offsets in spin-plane components are stored in a
         tplot variable with format '*_uvw_offset'.
   coord: (In, optional) If set to 'uvw', despinning will not be performed.
   /no_adc: If set, ADC-to-physical units is ignored.
   tper: (In, optional) Tplot name of spin period data. By default, 
         tper = pertvar. If tper is set, pertvar = tper.
   tphase: (In, optional) Tplot name of spin phase data. By default, 
         tphase = 'rbsp' + strlowcase(sc[0]) + '_spinphase'
         Note: tper and and tphase are mostly used for using eclipse-corrected
         spin data.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-07: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-06: JBT, SSL/UCB.
         1. Added despinning capability.
   2012-11-12: JBT, SSL/UCB.
         1. Added esvy and vsvy cleaning.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2013-04-17 11:31:23 -0700 (Wed, 17 Apr 2013) $
 $LastChangedRevision: 12085 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_cal_waveform.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_cal_waveform.pro)


RBSP_EFW_CAL_XSPEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME: rbsp_efw_cal_xspec

 PURPOSE: Calibrate RBSP cross-spectral data

 NOTES: meant to be called from rbsp_load_efw_xspec.pro

	The default is that xspec0 is SCMw x E12AC
	and xspec1 is V1AC x V2AC
	xspec3 is not used at this time

	A note on the various channels.

		From the LASP DFB document Fig 4, the spectral FFT of each channel (ex SCMw and E12AC)
		is sent directly into the Xspec processor. The "top" channel in this figure
		shows the calculation of the real and imaginary parts. 
			FFT(SCMw) and FFT(E12AC) --> Xspec calc (eg SCMw x E12AC) --> bin averaging --> xspec compression
		The power is calculated via the "bottom" channel
			FFT(SCMw) --> FFT(SCMw)*FFT(SCMw)* --> bin averaging --> spec compression		
		These values are "src1" and "src2"


	src1 and src2 refer to the individual sources that comprise the xspec. These
	are power spectral densities


	Data calibration (ex, starting with src1, described above)
		subtract offset
			src1_2 = (double(src1.y) - offset_chn1)
		Compensate for dynamic range compression
			src1_2 /= 16   (/8 for the real and imaginary parts)
		Divide the 0th bin by 4 (from weirdness doc)
			src1_2[*,0] /= 4.
		Compensate for using Hanning window
			src1_2 /= 0.375^2
		Apply ADC conversion
			src1_2 *= adc_factor^2
		Apply channel gain
			src1_2 *= gain[0]^2
		Resulting data in V^2/Hz


	The coherence values are calculated as in Eqn 3.91 in "Engineering Applications of
	Correlation and Spectral Analysis" by Bendat and Piersol (vol 1 apparently)

	Coherence(f) = |Gxy(f)|^2 / Gxx(f)*Gyy(f)
		where 
			|Gxy(f)|^2 = (Real^2 + Imaginary^2)
			Gxx(f) = src1_2
			Gyy(f) = src2_2
			
 SEE ALSO:

 HISTORY:
   Sept 2012: Created by Aaron W Breneman, University of Minnesota

 VERSION:
 $LastChangedBy:  $
 $LastChangedDate:  $
 $LastChangedRevision:  $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/missions/rbsp/efw/rbsp_efw_cal_fbk.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_cal_xspec.pro)


RBSP_EFW_CLEAN_ESVY (PROCEDURE)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_clean_esvy (procedure)

 PURPOSE:
   Clean the axial component of EFW esvy data type.

 CATEGORIES:

 CALLING SEQUENCE:
   rbsp_efw_clean_esvy, tvar, newname = newname, $
     notch = notch, phase_tolerance = phase_tol, $
     ind_spike = ind_spike, threshold = thres, $
     sc = sc, tper = tper, tphase = tphase

 ARGUMENTS:
   tvar: (In, required) Tplot name of esvy data.

 KEYWORDS:
   newname: (In, optional) Tplot name for cleaned data. Default is something
         like 'rbspa_esvy_clean'.
   notch: (In, optional) Number of data points to be notched. Default = 43.
   phase_tolerance: (In, optional) Spin phase tolerance for locating spikes in
         the axial component. Default = 5 (degree)
   ind_spike: (Out, optional) A named variable to return the found spikes to.
   threhold: (In, optional) Threshold for finding extrema when locating spikes.
         Default = 1.
   sc: (In, optional) Spacecraft name. Default = strmid(tvar, 4, 1)
   tper: (In, optional) Tplot name of spin period data. Default is something
         like 'rbspa_spinper'.
   tphase: (In, optional) Tplot name of spin phase data. Default is something
         like 'rbspa_spinphase'.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-10-12: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-12: Initial release in TDAS. JBT, SSL/UCB.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-11-12 14:34:49 -0800 (Mon, 12 Nov 2012) $
 $LastChangedRevision: 11226 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_clean_esvy.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_clean_esvy.pro)


RBSP_EFW_CLEAN_VSVY (PROCEDURE)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_clean_vsvy (procedure)

 PURPOSE:
   Clean the axial components (V5 and V6) of EFW vsvy data type.

 CATEGORIES:

 CALLING SEQUENCE:
   rbsp_efw_clean_vsvy, tvar, newname = newname, $
     notch = notch, phase_tolerance = phase_tol, $
     ind_spike = ind_spike, threshold = thres, $
     sc = sc, tper = tper, tphase = tphase

 ARGUMENTS:
   tvar: (In, required) Tplot name of esvy data.

 KEYWORDS:
   newname: (In, optional) Tplot name for cleaned data. Default is something
         like 'rbspa_esvy_clean'.
   notch: (In, optional) Number of data points to be notched. Default = 21.
   phase_tolerance: (In, optional) Spin phase tolerance for locating spikes in
         the axial component. Default = 5 (degree)
   ind_spike: (Out, optional) A named variable to return the found spikes to.
   threhold: (In, optional) Threshold for finding extrema when locating spikes.
         Default = 0.1.
   sc: (In, optional) Spacecraft name. Default = strmid(tvar, 4, 1)
   tper: (In, optional) Tplot name of spin period data. Default is something
         like 'rbspa_spinper'.
   tphase: (In, optional) Tplot name of spin phase data. Default is something
         like 'rbspa_spinphase'.


 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-11-11: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-12: Initial release in TDAS. JBT, SSL/UCB.


 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-11-12 14:34:49 -0800 (Mon, 12 Nov 2012) $
 $LastChangedRevision: 11226 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_clean_vsvy.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_clean_vsvy.pro)


RBSP_EFW_CONFIG

[Previous Routine] [Next Routine] [List of Routines]
  PRO rbsp_efw_config

  This procedure serves as the RBSP EFW configuration file.  It sets global (system)
  variables and initializes devices

  This procedure will define the location of data files and the data server.
  This procedure is intended to be called from within the "RBSP_EFW_INIT" procedure.

  This should be the only RBSP EFW file that requires modification for use in different
  locations.

  There is no need to modify this file if:
     - Your computer is an SSL UNIX machine that mounts "/disks/data/"   (i.e. ALL Linux and Solaris machines at SSL)
     - You use a portable computer that will be caching files on a local hard drive.


  Settings  in this file will be overridden by settings in the environment.
  (see setup_themis or setup_themis_bash for examples of setting environment
  variables on UNIX-like systems.  The environment can also be set on Windows
  systems.)

  KEYWORDS
     no_color_setup: do not set colors if already taken care of

  Author:  Peter Schroeder Jul 2011

 $LastChangedBy: peters $
 $LastChangedDate: 2012-02-09 14:17:52 -0800 (Thu, 09 Feb 2012) $
 $LastChangedRevision: 9704 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_config.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_config.pro)


RBSP_EFW_CONFIG_FILEDIR

[Previous Routine] [Next Routine] [List of Routines]
Function: rbsp_efw_config_filedir.pro
Purpose: Get the applications user directory for RBSP EFW data analysis software

$LastChangedBy: peters $
$LastChangedDate: 2011-12-28 10:26:47 -0800 (Wed, 28 Dec 2011) $
$LastChangedRevision: 9477 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_config_filedir.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_config_filedir.pro)


RBSP_EFW_DECONVOL_INST_RESP (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_deconvol_inst_resp (function)

 PURPOSE:
   De-convolve instrument responses for RBSP EFW data, including search-coil
   data that are channeled into EFW. It will return a tplot data structure. 

 CATEGORIES:

 CALLING SEQUENCE:
   result = rbsp_efw_deconvol_inst_resp(data, probe, datatype)

 ARGUMENTS:
   data: (Input, required) A tplot data structure, i.e., a structure with the
         form {x:time_array, y:[nt, 3]}.

   probe: (Input, required) RBSP probe name. It should be 'a' or 'b'.

   datatype: (Input, required) Data type name. Valid names are:
         'eb2', 'mscb1', 'mscb2'.

 KEYWORDS:
   None.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-23: Created by Jianbao Tao (JBT), SSL, UC Berkley.


 Version:

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-09-06 17:43:01 -0700 (Thu, 06 Sep 2012) $
 $LastChangedRevision: 10899 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_deconvol_inst_resp.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_deconvol_inst_resp.pro)


RBSP_EFW_GET_CAL_PARAMS (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_efw_get_cal_params (function)

 PURPOSE:
   Return RBSP EFW calibration parameters for converting L1 data to L2 data.

 CATEGORIES:

 CALLING SEQUENCE:
   cp = rbsp_efw_get_cal_params(time)

 ARGUMENTS:
   time: (Input, required) A floating time scalar for determining
         time-dependent calibration parameters.

 KEYWORDS:
   None.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-08-07: Created by Jianbao Tao (JBT), SSL, UC Berkley.

 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-11-12 09:52:04 -0800 (Mon, 12 Nov 2012) $
 $LastChangedRevision: 11222 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_get_cal_params.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_get_cal_params.pro)


RBSP_EFW_INIT

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE:  rbsp_efw_init
PURPOSE:    Initializes system variables for RBSP EFW.  Can be called from idl_startup to set
            custom locations.

 The system variable !RBSP_EFW is defined here.  The elements of this structure are explained below:

 !RBSP_EFW.LOCAL_DATA_DIR    This is the root location for all RBSP EFW data files.
                  The RBSP EFW software expects all data files to reside in specific subdirectories relative
                  to this root directory.;

 !RBSP_EFW.REMOTE_DATA_DIR   This is the URL of the server that can provide the data files.
                  (default is: "http://themis.ssl.berkeley.edu/data/themis/")
                  if the software does not find a needed file in LOCAL_DATA_DIR,
                  then it will attempt to download the data from the URL and REMOTE_DATA_DIR is defined,
                  the software will attempt to download the file from REMOTE_DATA_DIR, place it in LOCAL_DATA_DIR
                  with the same relative pathname, and then continue processing.
                  (NOT YET IMPLEMENTED)


KEYWORDS:
   RESET:           Reset !rbsp to values in environment (or values in keywords).
   LOCAL_DATA_DIR:  use given value for local_data_dir, rather than environment. Only works on
                    initial call or reset.
   REMOTE_DATA_DIR: Use given value for remote_data_dir, rather than env.  Only works on inital
                    call or reset.
   NO_COLOR_SETUP   do not set colors if already taken care of

 Typical examples:

          Desktop UNIX/LINUX computer located at SSL
   LOCAL_DATA_DIR  = '/disks/data/rbsp/'               ; This master directory is read only.
   REMOTE_DATA_DIR = ''                                  ; Should be empty string. (/disks/data/rbsp and server are the same)

          Desktop WINDOWS computer located at SSL
   LOCAL_DATA_DIR  = '\\justice\data\rbsp\'            ; Justice is a samba server (physically the same as /disk/data/rbsp)
   REMOTE_DATA_DIR = ''

          laptop WINDOWS computer located far from a data server, but with internet connection.
   LOCAL_DATA_DIR  = 'C;\data\rbsp\'                              ; Local (portable) directory on laptop
   REMOTE_DATA_DIR = 'http://themis.ssl.berkeley.edu/data/themis/'    ;  URL used to download data to LOCAL_DATA_DIR

          MacOS computer located away from SSL without a nearby data server
   LOCAL_DATA_DIR  = '/data/rbsp/'                              ; Local (portable) directory on laptop
   REMOTE_DATA_DIR = 'http://themis.ssl.berkeley.edu/data/themis/'    ;  URL used to download data to LOCAL_DATA_DIR

   Note: If automatic downloads are used. (i.e. REMOTE_DATA_DIR is not an empty string) the user must ensure that
   LOCAL_DATA_DIR is writeable.

   Note to WINDOWS users: the WINDOWS version of IDL accepts both the '\' and '/' character as the directory
   separation character. The converse is not true.


HISTORY
 Written by Peter Schroeder July 2011

$LastChangedBy: jbonnell $
$LastChangedDate: 2013-02-26 09:24:59 -0800 (Tue, 26 Feb 2013) $
$LastChangedRevision: 11609 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_init.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_init.pro)


RBSP_EFW_READ_CONFIG

[Previous Routine] [Next Routine] [List of Routines]
NAME:
 rbsp_efw_read_config
PURPOSE:
 Reads the rbsp_efw_config file
CALLING SEQUENCE:
 cstruct = rbsp_efw_read_config()
INPUT:
 none, the filename is hardcoded, 'rbsp_efw_config.txt',and is s put in a
 folder given by the routine rbsp_efw_config_filedir, that uses the IDL
 routine app_user_dir to create/obtain it
OUTPUT:
 cstruct = a structure with the changeable fields of the !rbsp_efw
           structure
HISTORY:
 01-jul-2011, peters
$LastChangedBy: peters $
$LastChangedDate: 2011-12-28 10:26:47 -0800 (Wed, 28 Dec 2011) $
$LastChangedRevision: 9477 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_efw_read_config.pro $

(See ssl_general/missions/rbsp/efw/rbsp_efw_read_config.pro)


RBSP_GET_EFW_DFB_CONFIG (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_get_efw_dfb_config (function)

 PURPOSE:
   Decode the EFW DFB Config byte 

 CALLING SEQUENCE:
   result = rbsp_get_efw_dfb_config(config_byte)

 ARGUMENTS:
   config_byte: (Input, required) Integer or array of integers containing the DFB config byte

 KEYWORDS:

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2013-04-03: Created by Peter Schroeder (PCS), SSL, UC Berkley.


 Version:

 $LastChangedBy: peters $
 $LastChangedDate: 2013-04-08 10:45:51 -0700 (Mon, 08 Apr 2013) $
 $LastChangedRevision: 11983 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_get_efw_dfb_config.pro $

(See ssl_general/missions/rbsp/efw/rbsp_get_efw_dfb_config.pro)


RBSP_GSE2MGSE

[Previous Routine] [Next Routine] [List of Routines]
Procedure: rbsp_gse2mgse

Purpose:  Transforms from GSE to MGSE (modified GSE coord..defined below)

	If W gse is the spin axis unit vector in GSE coordinates, then
	(1) Ymgse = -(Wgse x Zgse)
	
	So Ymgse is now in the spin plane and in the ecliptic plane and duskward. (nearly same as Ygse)
	(2) Zmgse =  (Wgse x Ymgse) 
	
	So Z mgse points in the spin plane nearly along the positive normal to the ecliptic	
	(3) Xmgse= Ymgse x Zmgse  
	
	This actually the spin axis of the spacecraft X mgse= W gse

	One of the properties of this coordinate system is that if the spin axis points 
	towards the sun, then the MGSE system is exactly the same as the GSE system. 
	This is a real advantage when thinking about the data and comparing to other instruments.

	Second, since on RBSP the spin axis has a large angle relative to the z GSE axis the 
	cross product in equation 1 is well defined. None of the cross products involve nearly 
	parallel vectors- nothing is ever close to degenerate.


Input : tname = the tplot variable with data in GSE coord [n,3]
		 wgse = the w-antenna direction in GSE coord. This can either be a [3] element
		   	    array or an [n,3] element array. 
		 newname = name for output tplot variable. If not set then new name is 
					old name + '_mgse'


Example:
	rbsp_gse2mgse,'mag_gse',[1,0,0],/nochange

Written by Aaron Breneman, Oct 31, 2012

(See ssl_general/missions/rbsp/efw/rbsp_gse2mgse.pro)


RBSP_INTERP_SPIN_PHASE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_interp_spin_phase (function)

 PURPOSE:
   Calculate spin phases at arbitrary times using linear interpolation.

 CATEGORIES:

 CALLING SEQUENCE:
   phase = rbsp_interp_spin_phase(sc, time_array, $
     newname = newname $
     , tper = tper $
     , tphase = tphase $
     , tumbra_sta = tumbra_sta $
     , tumbra_end = tumbra_end $
     , umbra_pad = umbra_pad)

 ARGUMENTS:
   sc: (In, required) Spacecraft name. Should be 'a' or 'b'.
   time_array: (In, required) A time array at which spin phases are returned.

 KEYWORDS:
   newname: (In, optional) A tplot name for storing the returned spin phases.
       If not provided, the spin phases are not stored into a tplot name.
   tper: (In, optional) Spin-period tplot name. By default, 
           tper = 'rbsp' + strlowcase(sc[0]) + '_spinper'
   tphase: (In, optional) Spin-phase tplot name. By default, 
           tphase = 'rbsp' + strlowcase(sc[0]) + '_spinphase'
   tumbra_sta: (In, optional) Umbra starting time tplot name. By default, 
           tumbra_sta = 'rbsp' + strlowcase(sc[0]) + '_umbta_sta'
   tumbra_end: (In, optional) Umbra ending time tplot name. By default, 
           tumbra_sta = 'rbsp' + strlowcase(sc[0]) + '_umbta_end'
   umbra_pad: (In, optional) Time padding to the umbra times. By default, 
           umbra_pad = [-20d, 20d] * 60d
         This padding is to account for spin-period distrotion around umbra.
         APL has learned this problem, so this default padding will likely
         change in the future.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-10-24: Created by Jianbao Tao (JBT), SSL, UC Berkley.
   2012-11-05: Initial release to TDAS. JBT, SSL/UCB.


 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2013-03-20 13:46:27 -0700 (Wed, 20 Mar 2013) $
 $LastChangedRevision: 11848 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_interp_spin_phase.pro $

(See ssl_general/missions/rbsp/efw/rbsp_interp_spin_phase.pro)


RBSP_LOAD_EFW_BURST_TIMES

[Previous Routine] [Next Routine] [List of Routines]
 NAME: RBSP_LOAD_EFW_BURST_TIMES

 SYNTAX:
	rbsp_load_efw_burst_times,probe='a b'

 PURPOSE: Loads EFW B1 and B2 availability

 KEYWORDS:
	probe = 'a', 'b', 'a b', or ['a','b']
	trange = time range
	local_data_dir = local data directory, for overriding default location set
		in !rbsp_efw or root_data_dir()

 HISTORY:
	11/2012 - Created - Kris Kersten, kris.kersten@gmail.com
	22 Apr 2013 - changed remote_data_dir location

 VERSION:
   $LastChangedBy: kersten $
   $LastChangedDate: 2013-04-22 10:20:43 -0700 (Mon, 22 Apr 2013) $
   $LastChangedRevision: 12124 $
   $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_load_efw_burst_times.pro $

(See ssl_general/missions/rbsp/efw/rbsp_load_efw_burst_times.pro)


RBSP_LOAD_EFW_ESVY_MGSE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:	RBSP_LOAD_EFW_ESVY_MGSE

 SYNTAX:
   rbsp_load_efw_esvy_mgse,probe='a'
   rbsp_load_efw_esvy_mgse,probe='a',/no_spice_load

 PURPOSE:	Loads EFW ESVY data and despins using SPICE via rbsp_uvw_to_mgse.pro

			The MGSE coordinate system is defined:
				Y_MGSE=-W_SC(GSE) x Z_GSE
				Z_MGSE=W_SC(GSE) x Y_MGSE
				X_MGSE=Y_MGSE x Z_MGSE
			where W_SC(GSE) is the spin axis direction in GSE.

			This is equivalent to the GSE coordinate system if the spin axis
			lies along the X_GSE direction.

 KEYWORDS:
	probe = 'a' or 'b'  NOTE: single spacecraft only, does not accept ['a b']
		NOTE: defaults to probe='a'
	/no_spice_load - skip loading/unloading of SPICE kernels
		NOTE: This assumes spice kernels have been manually loaded using:
			rbsp_load_spice_predict ; (optional)
			rbsp_load_spice_kernels ; (required)
	/debug - prints debugging info

 NOTES:

 HISTORY:
	1. Created Nov 2012 - Kris Kersten, kris.kersten@gmail.com

 VERSION:
   $LastChangedBy: kersten $
   $LastChangedDate: 2012-11-29 22:17:49 -0800 (Thu, 29 Nov 2012) $
   $LastChangedRevision: 11320 $
   $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_load_efw_esvy_mgse.pro $

(See ssl_general/missions/rbsp/efw/rbsp_load_efw_esvy_mgse.pro)


RBSP_LOAD_EFW_FIT

[Previous Routine] [Next Routine] [List of Routines]
Procedure: RBSP_LOAD_EFW_FIT

Purpose:  Loads RBSP EFW FIT data

keywords:
  probe = Probe name. The default is 'all', i.e., load all available probes.
          This can be an array of strings, e.g., ['a', 'b'] or a
          single string delimited by spaces, e.g., 'a b'
  varformat=string
  TRANGE= (Optional) Time range of interest  (2 element array), if
          this is not set, the default is to prompt the user. Note
          that if the input time range is not a full day, a full
          day's data is loaded
  VARNAMES: names of variables to load from cdf: default is all.
  /GET_SUPPORT_DATA: load support_data variables as well as data variables
                      into tplot variables. (NOT IMPLEMENTED YET)
  /INTEGRATION: If set, load data from integration.
  /QA: If set, load data from l1_qa testing directory.
  /MSIM: If set, load data from mission simulations.
  /ETU: If set, load data from the ETU.
  /DOWNLOADONLY: download file but don't read it. (NOT IMPLEMENTED YET)
  /valid_names, if set, then this routine will return the valid probe, datatype
          and/or level options in named variables supplied as
          arguments to the corresponding keywords.
  files   named varible for output of pathnames of local files.
  /VERBOSE  set to output some useful info
  type:  set to 'calibrated' to automatically convert data into physical units
Example:
   rbsp_load_efw_fit,/get_suppport_data,probe=['a', 'b']
Notes:
 1. Written by Peter Schroeder, February 2012

 $LastChangedBy: peters $
 $LastChangedDate: 2012-11-07 14:58:26 -0800 (Wed, 07 Nov 2012) $
 $LastChangedRevision: 11201 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_load_efw_fit.pro $

(See ssl_general/missions/rbsp/efw/rbsp_load_efw_fit.pro)


RBSP_LOAD_EFW_SPEC

[Previous Routine] [Next Routine] [List of Routines]
Procedure: RBSP_LOAD_EFW_SPEC

Purpose:  Loads RBSP EFW SPEC data

keywords:
  probe = Probe name. The default is 'all', i.e., load all available probes.
          This can be an array of strings, e.g., ['a', 'b'] or a
          single string delimited by spaces, e.g., 'a b'
  varformat=string
  TRANGE= (Optional) Time range of interest  (2 element array), if
          this is not set, the default is to prompt the user. Note
          that if the input time range is not a full day, a full
          day's data is loaded
  VARNAMES: names of variables to load from cdf: default is all.
  /GET_SUPPORT_DATA: load support_data variables as well as data variables
                      into tplot variables. (NOT IMPLEMENTED YET)
  /DOWNLOADONLY: download file but don't read it. (NOT IMPLEMENTED YET)
  /QA: If set, load data from 11_qa testing directory.
  /INTEGRATION: If set, load data from integration.
  /MSIM: If set, load data from mission simulations.
  /ETU: If set, load data from the ETU.
  /valid_names, if set, then this routine will return the valid probe, datatype
          and/or level options in named variables supplied as
          arguments to the corresponding keywords.
  files   named varible for output of pathnames of local files.
  /VERBOSE  set to output some useful info
  type:  set to 'calibrated' to automatically convert data into physical units
Example:
   rbsp_load_efw_spec,/get_suppport_data,probe=['a', 'b']
Notes:
 1. Written by Peter Schroeder, February 2012

 $LastChangedBy: aaronbreneman $
 $LastChangedDate: 2013-04-01 13:54:32 -0700 (Mon, 01 Apr 2013) $
 $LastChangedRevision: 11927 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_load_efw_spec.pro $

(See ssl_general/missions/rbsp/efw/rbsp_load_efw_spec.pro)


RBSP_LOAD_EFW_WAVEFORM

[Previous Routine] [Next Routine] [List of Routines]
Procedure: RBSP_LOAD_EFW_WAVEFORM

Purpose:  Loads RBSP EFW Waveform data

keywords:
  probe = Probe name. The default is 'all', i.e., load all available probes.
          This can be an array of strings, e.g., ['a', 'b'] or a
          single string delimited by spaces, e.g., 'a b'
  varformat=strin
  TRANGE= (Optional) Time range of interest  (2 element array), if
          this is not set, the default is to prompt the user. Note
          that if the input time range is not a full day, a full
          day's data is loaded
  DATATYPE:    Input, string.  Default setting is to calibrate all raw quantites and also produce all _0 and _dot0 quantities.  Use DATATYPE
                       kw to narrow the data products.  Wildcards and glob-style patterns accepted (e.g., ef?, *_dot0).
  VARNAMES: names of variables to load from cdf: default is all.
  /GET_SUPPORT_DATA: load support_data variables as well as data variables
                      into tplot variables. (NOT IMPLEMENTED YET)
  /DOWNLOADONLY: download file but don't read it. (NOT IMPLEMENTED YET)
  /QA: If set, load data from l1_qa testing directory.
  /INTEGRATION: If set, load data from integration.
  /MSIM: If set, load data from mission simulations.
  /ETU: If set, load data from the ETU.
  /valid_names, if set, then this routine will return the valid probe, datatype
          and/or level options in named variables supplied as
          arguments to the corresponding keywords.
  files   named varible for output of pathnames of local files.
  /VERBOSE  set to output some useful info
  type:  set to 'calibrated' to automatically convert data into physical units
  coord: Set to 'uvw' to return data in UVW. Otherwise the output is in DSC
          coordinate system
   tper: (In, optional) Tplot name of spin period data. By default, 
         tper = pertvar. If tper is set, pertvar = tper.
   tphase: (In, optional) Tplot name of spin phase data. By default, 
         tphase = 'rbsp' + strlowcase(sc[0]) + '_spinphase'
         Note: tper and and tphase are mostly used for using eclipse-corrected
         spin data.
Example:
   rbsp_load_efw_waveform,/get_suppport_data,probe=['a', 'b']

 HISTORY:
   1. Written by Peter Schroeder, February 2012
   2012-11-06: JBT, SSL/UCB.
         1. Added keywords *coord*, *tper*, and *tphase* that are passed into
             *rbsp_efw_cal_waveform*.

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-11-12 14:28:23 -0800 (Mon, 12 Nov 2012) $
 $LastChangedRevision: 11225 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_load_efw_waveform.pro $

(See ssl_general/missions/rbsp/efw/rbsp_load_efw_waveform.pro)


RBSP_LOAD_EFW_XSPEC

[Previous Routine] [Next Routine] [List of Routines]
Procedure: RBSP_LOAD_EFW_XSPEC

Purpose:  Loads RBSP EFW XSPEC data

keywords:
  probe = Probe name. The default is 'all', i.e., load all available probes.
          This can be an array of strings, e.g., ['a', 'b'] or a
          single string delimited by spaces, e.g., 'a b'
  varformat=string
  TRANGE= (Optional) Time range of interest  (2 element array), if
          this is not set, the default is to prompt the user. Note
          that if the input time range is not a full day, a full
          day's data is loaded
  VARNAMES: names of variables to load from cdf: default is all.
  /GET_SUPPORT_DATA: load support_data variables as well as data variables
                      into tplot variables. (NOT IMPLEMENTED YET)
  /DOWNLOADONLY: download file but don't read it. (NOT IMPLEMENTED YET)
  /QA: If set, load data from l1_qa testing directory.
  /INTEGRATION: If set, load data from integration.
  /MSIM: If set, load data from mission simulations.
  /ETU: If set, load data from the ETU.
  /valid_names, if set, then this routine will return the valid probe, datatype
          and/or level options in named variables supplied as
          arguments to the corresponding keywords.
  files   named varible for output of pathnames of local files.
  /VERBOSE  set to output some useful info
  type:  set to 'calibrated' to automatically convert data into physical units
Example:
   rbsp_load_efw_xspec,/get_suppport_data,probe=['a', 'b']
Notes:
 1. Written by Peter Schroeder, February 2012

 $LastChangedBy: peters $
 $LastChangedDate: 2012-11-05 10:31:46 -0800 (Mon, 05 Nov 2012) $
 $LastChangedRevision: 11178 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_load_efw_xspec.pro $

(See ssl_general/missions/rbsp/efw/rbsp_load_efw_xspec.pro)


RBSP_MSC_RESPONSE (FUNCTION)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_msc_response (function)

 PURPOSE:
   Calculate the transmittance of the search-coil magnetometer.

 CATEGORIES:

 CALLING SEQUENCE:
   response = rbsp_msc_response(f, probe, component)

 ARGUMENTS:
   f: (Input, required) A floating array of frequencies at which the responses
           are calculated.

   probe: (Input, required) RBSP probe name. It should be 'a' or 'b'.

   component: (Input, required) Component name. Valid names are:
         'Bu', 'Bv', 'Bw'.

 KEYWORDS:
   None.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2012-09-04: Created by Jianbao Tao (JBT), SSL, UC Berkley.


 Version:

 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2012-09-06 17:43:01 -0700 (Thu, 06 Sep 2012) $
 $LastChangedRevision: 10899 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_msc_response.pro $

(See ssl_general/missions/rbsp/efw/rbsp_msc_response.pro)


RBSP_POYNTING_FLUX

[Previous Routine] [Next Routine] [List of Routines]
*****************************************************************************************

  PROCEDURE :  rbsp_poynting_flux

  PURPOSE  : calculates Poynting flux. Separates into field-aligned and perp components
			  Returns results as tplot variables


  REQUIRES:  tplot library
               
               

  EXAMPLES:    
               

  KEYWORDS:  Bw -> tplot name of the [n,3] magnetic field waveform
			  Ew -> tplot name of the [n,3] electric field waveform
			  Tlow, Thigh -> low and high period of waveform to use. 
  

   NOTES:     

			 Poynting flux coord system
   		 	P1mgse = Bmgse x xhat_mgse  (xhat_mgse is spin axis component)
				P2mgse = Bmgse x P1mgse
  		   		P3mgse = Bmgse


			 The waveform data are first downsampled to 1/Tlow to avoid the wasted
			 computation of having to run program with data at unnecessarily high 
			 sample rate.

			 The waveform is then bandpassed to the frequency range flow=1/Thigh...fhigh=1/Tlow


			 The output tplot variables are:

			 	These three output variables contain a mix of spin axis and spin plane components:
			 		pflux_p1  -> Poynting flux in perp1 direction
			 		pflux_p2  -> Poynting flux in perp2 direction
 			 		pflux_Bo  -> Poynting flux along Bo

			 	These partial Poynting flux calculations contain only spin plane Ew.
			 		pflux_nospinaxis_perp 
			 		pflux_nospinaxis_para

               

   CREATED:  11/28/2012
   CREATED BY:  Aaron W. Breneman
    LAST MODIFIED:  MM/DD/YYYY   v1.0.0
    MODIFIED BY: 

*****************************************************************************************

(See ssl_general/missions/rbsp/efw/rbsp_poynting_flux.pro)


RBSP_SPINFIT (PROCEDURE)

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rbsp_spinfit (procedure)

 PURPOSE:
   Derive spin-fit E-field from instantaneous E-field measurements. The
   spin-fit model is as such:
           fit = A + B * cos(phi) + C * sin(phi)
   where B and C are E-fields in the DSC X and Y dimensions, and angle is the
   angle between the DSC X direction and the EFW spin plane boom used in the
   spin-fit derivation, as demonstrated below.

       DSC Y
            |       / EFW spin plane boom
            |      /
            |     /
            |    /
            |   /
            |  /
            | / 
            |/)angle________ DSC X

   NOTES: 1. Similar to thm_spinfit.pro, this routine is a wrapper of
             spinfit.pro for RBSP. Unlike thm_spinfit, this routine only works
             on one tplot variable at a time.
          2. Normally, this routine saves four tplot variables, such as 
                  'rbspa_efw_esvy_spinfit_a'
                  'rbspa_efw_esvy_spinfit_b'
                  'rbspa_efw_esvy_spinfit_c'
                  'rbspa_efw_esvy_spinfit'
             where the first three are the three cooefficients from the fit and
             the last one is like a normal EFW data type in DSC.

 CATEGORIES:

 CALLING SEQUENCE:
   rbsp_spinfit ,var_name_in, $
             sigma=sigma, npoints=npoints, spinaxis=spinaxis, median=median, $
             plane_dim=plane_dim, axis_dim=axis_dim,  $
             min_points=min_points,alpha=alpha,beta=beta, $
             phase_mask_starts=phase_mask_starts, $
             phase_mask_ends=phase_mask_ends, $
             sc = sc, force = force, tper = tper, tphase = tphase

 ARGUMENTS:
   var_name_in: IN, REQUIRED
         EFW tplot data used for the spin-fit derivation. Must be in UVW.

 KEYWORDS:
   sc: IN, OPTIONAL
         Spacecraft name. Must be 'a' or 'b'.
   /force: IN, OPTIONAL
         If set, force to do the derivation. Useful when the input tplot data
         do not have coord_sys information.
   tper: IN, OPTIONAL
         Spin-period tplot name.
   tphase: IN, OPTIONAL
         Spin-phase tplot name.

     See spinfit.pro and thm_spinfit.pro for usage of other keywords. 
     Exception:
     AXIS_DIM defaults to 2 instead of 0 in this routine.

 COMMON BLOCKS:

 EXAMPLES:

 SEE ALSO:

 HISTORY:
   2013-01-22: Created by Jianbao Tao (JBT), SSL, UC Berkley.


 VERSION:
 $LastChangedBy: jianbao_tao $
 $LastChangedDate: 2013-02-06 10:59:30 -0800 (Wed, 06 Feb 2013) $
 $LastChangedRevision: 11535 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_spinfit.pro $

(See ssl_general/missions/rbsp/efw/rbsp_spinfit.pro)


RBSP_SPLIT_FBK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:	rbsp_split_fbk


 PURPOSE:	Split the filterbank data into separate tplot variables for 
			each channel. Can also combine peak and average on a single panel         

 KEYWORDS:
	probe = 'a' or 'b'  NOTE: single spacecraft only, does not accept ['a b']
	combine -> set to combine peak and average onto a single plot


 CREATED: Aaron Breneman 11/07/2012

(See ssl_general/missions/rbsp/efw/rbsp_split_fbk.pro)


RBSP_UVW_TO_MGSE

[Previous Routine] [List of Routines]
 NAME:	RBSP_UVW_TO_MGSE

 SYNTAX:
   rbsp_load_efw_esvy_mgse,'a','rbspa_efw_esvy'
   rbsp_load_efw_esvy_mgse,'a','rbspa_efw_esvy',/no_spice_load

 PURPOSE:	Transforms from spinning UVW (RBSP SCIENCE) frame to MGSE.

			The MGSE coordinate system is defined:
				Y_MGSE=-W_SC(GSE) x Z_GSE
				Z_MGSE=W_SC(GSE) x Y_MGSE
				X_MGSE=Y_MGSE x Z_MGSE
			where W_SC(GSE) is the spin axis direction in GSE.

			This is equivalent to the GSE coordinate system if the spin axis
			lies along the X_GSE direction.

 INPUT:
	probe	- either 'a' or 'b'
	tvar	- TPLOT variable containing 3-component UVW data
			(either string or integer tplot variable id) 

 KEYWORDS:
	/no_spice_load - skip loading/unloading of SPICE kernels
		NOTE: This assumes spice kernels have been manually loaded using:
			rbsp_load_spice_predict ; (optional)
			rbsp_load_spice_kernels ; (required)
	/no_offset - skip offset removal in spin plane
	/debug - prints debugging info

 NOTES:

 HISTORY:
	1. Created Nov 2012 - Kris Kersten, kris.kersten@gmail.com

 VERSION:
   $LastChangedBy: kersten $
   $LastChangedDate: 2013-01-03 16:23:50 -0800 (Thu, 03 Jan 2013) $
   $LastChangedRevision: 11390 $
   $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/tags/tdas_8_00/missions/rbsp/efw/rbsp_uvw_to_mgse.pro $

(See ssl_general/missions/rbsp/efw/rbsp_uvw_to_mgse.pro)