This page was created by the IDL library routine mk_html_help2.

Last modified: Thu Sep 27 14:05:48 2007.


Directory Listing of Routines


Routine Descriptions

THM_CAL_EFI

[Next Routine] [List of Routines]
Procedure: THM_CAL_EFI

Purpose:  Converts raw EFI (V, EDC, and EAC waveform) data into physical quantities.
keywords:
   /VERBOSE or VERBOSE=n ; set to enable diagnostic message output.
		higher values of n produce more and lower-level diagnostic messages.
   /ALL

Example:
   thm_cal_efi, /all

Notes:
	-- fixed, nominal calibration pars used (gains and frequency responses), rather than proper time-dependent parameters.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-20 13:28:09 -0700 (Fri, 20 Jul 2007) $
 $LastChangedRevision: 1195 $
 $URL $

(See themis/spacecraft/fields/thm_cal_efi.pro)


THM_CAL_FBK

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

Purpose:  Converts raw FBK (Filter Bank)  data into physical quantities.
keywords:
  probe = Probe name. The default is 'all', i.e., calibrate data for 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'
  datatype = The type of data to be loaded, 'fbh', 'fb1', 'fb2'.  default is
          'all', to calibrate all variables.
           due to some last minute changes it is required that you include
  both the raw and the calibrated datatype you want for this function
  to perform properly
  in_suffix =  optional suffix to add to name of input data quantity, which
          is generated from probe and datatype keywords.
  out_suffix = optional suffix to add to name for output tplot quantity,
          which is generated from probe and datatype keywords.
  /VALID_NAMES; returns the allowable input names in the probe and
  datatype variables
   /VERBOSE or VERBOSE=n ; set to enable diagnostic message output.
		higher values of n produce more and lower-level diagnostic messages.

Example:
   thm_cal_fbk

Notes:
	-- Changes between signal sources are handled;
		source info from HED data should be used to get actual units of a given spectrum.
	-- fixed, nominal calibration pars used (gains and frequency responses), rather than proper time-dependent parameters.

(See themis/spacecraft/fields/thm_cal_fbk.pro)


THM_CAL_FFT

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

Purpose:  Converts raw FFT (on-board FFT spectra) data into physical quantities.
keywords:
  probe = Probe name. The default is 'all', i.e., calibrate data for 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'
  datatype = The type of data to be loaded, 'ffp_16', 'ffp_32',
  'ffp_64', 'ffw_16', 'ffw_32', or 'ffw_64'.  default is
          'all', to calibrate all variables.
  due to some last minute changes it is required that you include
  both the raw and the calibrated datatype you want for this function
  to perform properly

  in_suffix =  optional suffix to add to name of input data quantity, which
          is generated from probe and datatype keywords.
  out_suffix = optional suffix to add to name for output tplot quantity,
          which is generated from probe and datatype keywords.
  /VALID_NAMES; returns the allowable input names in the probe and
  datatype variables
   /VERBOSE or VERBOSE=n ; set to enable diagnostic message output.
		higher values of n produce more and lower-level diagnostic messages.


Example:
   thm_cal_fft

Notes:
	-- Changes between signal sources are handled;
		source info from HED data should be used to get actual units of a given spectrum.
	-- fixed, nominal calibration pars used (gains and frequency
    responses), rather than proper time-dependent parameters.

(See themis/spacecraft/fields/thm_cal_fft.pro)


THM_CAL_FGM

[Previous Routine] [Next Routine] [List of Routines]
procedure: thm_cal_fgm

Purpose: applies calibration to THEMIS fluxgate magnetometer data

         searches for the current calibration in ASCII file
         takes calibration that has time stamp before or at the start of the data
         converts data to nano Tessla
         applies the calibration
         corrects for phase shift from averaging before despinning

keywords:
  probe = Probe name. The default is 'all', i.e., calibrate data for 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'
  datatype = The type of data to be loaded, 'fge', 'fgh', or 'fgl'.  default is
          'all', to calibrate all variables.
  in_suffix =  optional suffix to add to name of input data quantity, which
          is generated from probe and datatype keywords.
  out_suffix = optional suffix to add to name for output tplot quantity,
          which is generated from probe and datatype keywords.
  coord = apply thm_cotrans if output other
          than spinning spacecraft (SSL) is desired.

optional parameters:

         name_thx_fgx_in   --> input data (t-plot variable name)
         name_thx_fgx_hed  --> header information for input data (t-plot variable name)
         name_thx_fgx_out  --> name for output (t-plot variable name)
         pathfile          --> path and filename of the calibration file

keywords:
Example:
      tha_cal_fgm, probe = 'a', datatype= 'fgl'

Notes: under construction!!

Written by Hannes Schwarzl.
 $LastChangedBy: jimm $
 $LastChangedDate: 2007-09-27 11:40:03 -0700 (Thu, 27 Sep 2007) $
 $LastChangedRevision: 1634 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_cal_fgm.pro $
Changes by Edita Georgescu
eg 6/3/2007     - matrix multiplication
eg 30/3/2007   - keyword deleted, fgmtype determined from: name_thx_fgx_in
                - calibrates fgl,fgh,fge
                - calibrate only mode=0 data
 2007-03-30 Modified by Hannnes S to use multiple calibrations for a selected interval
            and use spinperiod from the statefile
            Search this string to see changes ;Hannes 30/3/2007
 2007-03-30 Modified by Hannnes S correction for filter delay removed
            Search this string to see changes: Hannes 05/21/2007

(See themis/spacecraft/fields/thm_cal_fgm.pro)


THM_CAL_FIT

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

Purpose:  Converts raw FIT parameter data into physical quantities.
keywords:
   /VERBOSE or VERBOSE=n ; set to enable diagnostic message output.
		higher values of n produce more and lower-level diagnostic messages.
   /ALL

Example:
   thm_cal_fit, /all

Notes:
	-- FGM range changes are not handled properly; RANGE=0 is assumed.
	-- fixed, nominal calibration pars used, rather than proper time-dependent parameters.
   -- time-dependent spinn axis offset implemented Hannes 05/25/2007
   -- fixed bug where angle > 80 is assumed to exist, jmm, 2007-09-18
 $LastChangedBy: jimm $
 $LastChangedDate: 2007-09-27 11:40:03 -0700 (Thu, 27 Sep 2007) $
 $LastChangedRevision: 1634 $
 $URL $

(See themis/spacecraft/fields/thm_cal_fit.pro)


THM_CAL_SCM

[Previous Routine] [Next Routine] [List of Routines]
NAME:
 thm_cal_scm
PURPOSE:
 calibrate THEMIS SCM data

    The processing is done in 8  successive steps
 ----------- by default, processing stops after step 5.
 
     # 0: counts, NaN inserted into each gap for proper tplotting
     # 1: Volts,  spinning sensor system, with    DC field
     # 2: Volts,  spinning sensor system, without DC field[, xy DC field in nT]
     # 3: nTesla, spinning sensor system, without DC field
     # 4: nTesla, spinning SSL    system, without DC field
     # 5: nTesla, fixed DSL system, without DC field, filtered <fmin
     # 6: nTesla, fixed DSL system, with xy DC field

keywords:
  probe = Probe name. The default is 'all', i.e., calibrate data for 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'
  datatype = The type of data to be calibrated/created.
          The default is 'scf', 'scp', and 'scw', that is, SCM fast survey mode,
          particle burst mode and waves burst mode data, with no diagnostic
          outputs.
          Each mode of output has its own set of possible diagnostic outputs:
          'sc?_dc', 'sc?_misalign' and 'sc?_iano', where ? can be
          f, p or w.  To calibrate all modes loaded and create all diagnostic 
          outputs you can specify 'all'.
          diagnostic outputs: raw data in Volts, dc field, axis misalignment
          (angle between x and y axes in degrees),
          and iano (data quality flag).  Created with '_dc',
          '_misalign', and '_iano' suffixes, respectively.
  in_suffix =  optional suffix to add to name of input data quantity, which
          is generated from probe and datatype keywords.
  out_suffix = optional suffix to add to name for output tplot quantity,
          which is generated from probe and datatype keywords.
  trange= array[2] string or double.  Limit calibration to specified time range.
 
  nk =    N points of the cal-convolution kernel, if set, this value will
          be used regardless of sample rate.
  mk =    If nk is not set, set nk to (sample frequency)*mk, where sample
          frequency is determined by the data. default = 4.
  despin =classic despin algorithm. 0:off 1:on  Default is on.
  n_spinfit= n spins to fit for misalignment, dc field calculation and 
             optionally despin.
  fdet =  detrend freq. - determines length of boxcar avg. 0 for no detrending.
  fcut =  Low Frequency cut-off for calibration
  fmin =  Min frequency for filtering in DSL system.
  fmax =  Max frequency for filtering in DSL system.
  step =  Highest Processing step to complete.  Default is step 5.
  edge_truncate, edge_wrap, edge_zero= Method for handling edges in
          step 3, cal-deconvolution.  For usage and exact specification of
          these keywords, see docs for IDL convol function.  Default is to
          zero data within nk/2 samples of data gap or edge.
  coord = coordinate system of output.  Step 6 output can only be in DSL.
  no_download=don't access internet to check for updated calibration files.
  dircal= If set to a string, specifies directory of calibration files.
          use /dircal or dircal='' to use calibration files in IDL source 
          distribution.  
  verbose=set to zero to eliminate output.  currently only works with 
          valid_names
valid_names=use /valid_names to print out values for probe, datatype, coord
          and return those in named variables passed in to corresponding 
          keywords.

optional parameters:

  thx_scx      --> input data (t-plot variable name)
  thx_scx_hed  --> header information for input data (t-plot variable name)

Example:
      tha_cal_fgm, probe = 'a', datatype= 'scp'

HISTORY:
 13-mar-2007, jmm, jimm@ssl.berkeley.edu
 June-2007, krb, Based on Patrick Robert's cowave_THEscmwf.f
$LastChangedBy: jimm $
$LastChangedDate: 2007-07-20 13:04:26 -0700 (Fri, 20 Jul 2007) $
$LastChangedRevision: 1193 $ 
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_cal_scm.pro $

(See themis/spacecraft/fields/thm_cal_scm.pro)


THM_COLLATE_INTERVALS

[Previous Routine] [Next Routine] [List of Routines]
Purpose: Takes a bunch of intervals from different data sources and
collates all intervals of the same source into a single vector(may be multidimensional)

keywords:
         r: an array of data with dimensions [time,samples,sources]
         s: an array of source s[i] indices should have the source index of [*,*,i]

         returns: an array with dimensions [time,samples,sources] but
         all sources will be unique(ie the size of the output sources
         will be <= the input sources)

Notes: --Used by thm_cal_fft,thm_cal_fbk
       --The returned data will be sorted according to source index in
       ascending order

(See themis/spacecraft/fields/thm_collate_intervals.pro)


THM_COMP_EAC_RESPONSE

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

	Purpose:
		Compute the voltage gain (magnitude only) as a function of frequency
	for the DFB EAC channels.

	Calling Sequence:
	thm_comp_eac_response, sensor, ff, resp

	Arguements:
		sensor	STRING, ignored.
		ff	FLOAT[ N], array of frequencies at which to compute the channel response.
		resp	float[ N], array of |voltage gain| vs. frequency.

	Notes:
	-- none.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
 $LastChangedRevision: 987 $
 $URL $

(See themis/spacecraft/fields/thm_comp_eac_response.pro)


THM_COMP_EFI_RESPONSE

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

	Purpose:
		Compute the voltage gain (magnitude only) as a function of frequency
	for a given THEMIS EFI sensor (SPB or AXB).

	Calling Sequence:
	thm_comp_efi_response, sensor, ff, resp

	Arguements:
		sensor	STRING, one of SPB or AXB.
		ff	FLOAT[ N], array of frequencies at which to compute the sensor response.
		resp	COMPLEX[ N], array of voltage gain vs. frequency.

	Notes:
	-- none.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
 $LastChangedRevision: 987 $
 $URL $

(See themis/spacecraft/fields/thm_comp_efi_response.pro)


THM_COMP_SCM_RESPONSE

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

	Purpose:
		Compute the voltage gain (magnitude only) as a function of frequency
	for a given THEMIS SCM sensor.

	Calling Sequence:
	thm_comp_scm_response, sensor, ff, resp

	Arguements:
		sensor	STRING, ignored.
		ff	FLOAT[ N], array of frequencies at which to compute the sensor response.
		resp	float[ N], array of |voltage gain| vs. frequency.

	Notes:
	-- none.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
 $LastChangedRevision: 987 $
 $URL $

(See themis/spacecraft/fields/thm_comp_scm_response.pro)


THM_FBK_DECOMPRESS

[Previous Routine] [Next Routine] [List of Routines]
Function: THM_FBK_DECOMPRESS

Purpose:  Decompresses DFB FBK spectral data.
Arguements:
	DATA, any BYTE data type (scalar or array), 8-bit compressed FBK band-pass amplitude estimates.
keywords:
   VERBOSE.
Example:
   result = thm_fbk_compress( data)

Notes:
	-- none.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
 $LastChangedRevision: 987 $
 $URL $

(See themis/spacecraft/fields/thm_fbk_decompress.pro)


THM_FFT_DECOMPRESS

[Previous Routine] [Next Routine] [List of Routines]
Function: THM_FFT_DECOMPRESS

Purpose:  Decompresses DFB FFT spectral data.
Arguements:
	DATA, any BYTE data type (scalar or array), 8-bit compressed FFT spectral estimates.
keywords:
   VERBOSE.
Example:
   result = thm_fft_compress( data)

Notes:
	-- Stub version, to allow for testing.

 $LastChangedBy: jbonnell $
 $LastChangedDate: 2007-06-21 14:15:51 -0700 (Thu, 21 Jun 2007) $
 $LastChangedRevision: 834 $
 $URL $

(See themis/spacecraft/fields/thm_fft_decompress.pro)


THM_FFT_FREQ_BINS[1]

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

(See themis/spacecraft/fields/thm_fft_freq_bins.pro)


THM_FFT_FREQ_BINS[2]

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

	Purpose:
		Given the sampling rate and number of bins, return the center frequencies
	of the FFT spectral estimate bins.

	Calling Sequence:
	thm_fft_freq_bins, rate=rate, nbins=nbins, cent_freq=cent_freq

	Arguements:
		rate	STRING, '8k' or '16k', indicating that the source sampling rate is 8192 or 16384 samp/s.
		nbins	INT, 16, 32, or 64; number of frequency bins in the FFT spectral estimate.

	Outputs:
		cent_freq	FLOAT[ nbins], center frequencies of bins in Hz.

	Notes:
	-- none.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
 $LastChangedRevision: 987 $
 $URL $

(See themis/spacecraft/fields/thm_fft_freq_bins.pro)


THM_GET_EFI_CAL_PARS

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

	Purpose:
		Given the particular EFI waveform data type, and begin and end of the time interval,
	return the waveform RAW->PHYS transformation parameters.

	Calling Sequence:
	thm_get_efi_cal_pars, tbeg, tend, name, cal_pars=cal_pars

	Arguements:
		tbeg, tend	DOUBLE, time in seconds since THEMIS epoch.
		name	STRING, waveform data type indicator.
		cal_pars	STRUCT, see Notes below for elements.


	Notes:
	-- use of TBEG and TEND for time-dependent calibration parameters is not currently implemented!
	-- E-field gains and units are for voltages, not fields, since we have not deployed yet!
	-- Difference in gain between DC and AC coupled E-field data not implemented yet!
	-- Elements of cal_pars are as follows:
		gain,	FLOAT[ 3 or 6], gain of source channel at DC in (phys unit)/ADC.
		offset, FLOAT[ 3 or 6], offset of channel in ADC.

 $LastChangedBy: jbonnell $
 $LastChangedDate: 2007-02-07 17:33:39 -0800 (Wed, 07 Feb 2007) $
 $LastChangedRevision: 324 $
 $URL $

(See themis/spacecraft/fields/thm_get_efi_cal_pars.pro)


THM_GET_FBK_CAL_PARS

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

	Purpose:
		Given the signal source, and begin and end of the time interval,
	return the filter bank RAW->PHYS transformation parameters.

	Calling Sequence:
	thm_get_fbk_cal_pars, tbeg, tend, fb_sel, cal_pars=cal_pars

	Arguements:
		tbeg, tend	DOUBLE, time in seconds since THEMIS epoch.
		fb_sel	INT, FilterBank source selection indicator.
		cal_pars	STRUCT, see Notes below for elements.


	Notes:
	-- use of TBEG and TEND for time-dependent calibration parameters is not currently implemented!
	-- E-field gains and units are for voltages, not fields, since we have not deployed yet!
	-- Elements of cal_pars are as follows:
		gain,	FLOAT, gain of source channel at 0 dB response in (phys unit)/ADC.
		freq_resp FLOAT[ 6], effective attenuation factor for source channel for each
			of the six FilterBank channels.

 $LastChangedBy: pcruce $
 $LastChangedDate: 2007-07-11 15:37:09 -0700 (Wed, 11 Jul 2007) $
 $LastChangedRevision: 1074 $
 $URL $

(See themis/spacecraft/fields/thm_get_fbk_cal_pars.pro)


THM_GET_FFT_CAL_PARS

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

	Purpose:
		Given the signal source, and begin and end of the time interval,
	return the FFT RAW->PHYS transformation parameters.

	Calling Sequence:
	thm_get_fft_cal_pars, tbeg, tend, fft_sel, nbins, cal_pars=cal_pars

	Arguements:
		tbeg, tend	DOUBLE, time in seconds since THEMIS epoch.
		fft_sel	INT, FilterBank source selection indicator.
		nbins,	INT, number of frequency bins in spectrum (16, 32, 64).
		cal_pars	STRUCT, see Notes below for elements.


	Notes:
	-- use of TBEG and TEND for time-dependent calibration parameters is not currently implemented!
	-- E-field gains and units are for actual deployed boom lengths (CDE).
	-- Elements of cal_pars are as follows:

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
 $LastChangedRevision: 987 $
 $URL $

(See themis/spacecraft/fields/thm_get_fft_cal_pars.pro)


THM_LOAD_EFI

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

Purpose:  Loads THEMIS EFI 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'
  datatype = The type of data to be loaded, can be an array of strings
          or single string separate by spaces.  The default is 'all'
  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
  level = the level of the data, the default is 'l1', or level-1
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  CDF_DATA: named variable in which to return cdf data structure: only works
          for a single spacecraft and datafile name.
  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.
  /DOWNLOADONLY: download file but don't read it.
  /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
  /no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  type: 'calibrated' or 'raw'
  coord: what coordinate system you would like your data in.
Example:
   thg_load_efi,/get_suppport_data,probe=['a', 'b']
Notes:

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-20 13:28:09 -0700 (Fri, 20 Jul 2007) $
 $LastChangedRevision: 1195 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_load_efi.pro $

(See themis/spacecraft/fields/thm_load_efi.pro)


THM_LOAD_FBK

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

Purpose:  Loads THEMIS FilterBank 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'
  datatype = The type of data to be loaded, can be an array of strings 
          or single string separate by spaces.  The default is 'all'
  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
  level = the level of the data, the default is 'l1', or level-1
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  type=   'raw' or 'calibrated'. default is calibrated.
  suffix= suffix to add to output data quantity (not added to support
  data)
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
          and/or level options in named variables supplied as 
          arguments to the corresponding keywords.
  files   named varible for output of pathnames of local files.
  CDF_DATA: named variable in which to return cdf data structure: only works
          for a single spacecraft and datafile name.
  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.
  /DOWNLOADONLY: download file but don't read it.
  /VALID_NAMES, if set, then this routine will return the valid
  probe, datatype
  /NO_DOWNLOAD: use only files which are online locally.
  /VERBOSE  set to output some useful info
Example:
   thg_load_fbk,/get_suppport_data,probe=['a', 'b']
Notes:

 $LastChangedBy: pcruce $
 $LastChangedDate: 2007-07-11 12:53:34 -0700 (Wed, 11 Jul 2007) $
 $LastChangedRevision: 1073 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_load_fbk.pro $

(See themis/spacecraft/fields/thm_load_fbk.pro)


THM_LOAD_FFT

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

Purpose:  Loads THEMIS FFT spectra (ParticleBurst and WaveBurst) 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'
  datatype = The type of data to be loaded, can be an array of strings 
          or single string separate by spaces.  The default is 'all'
  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
  level = the level of the data, the default is 'l1', or level-1
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  type=   'raw' or 'calibrated'. default is calibrated.
  suffix= suffix to add to output data quantity (not added to support
  data)
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  files   named varible for output of pathnames of local files.
  CDF_DATA: named variable in which to return cdf data structure: only works
          for a single spacecraft and datafile name.
  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.
  /DOWNLOADONLY: download file but don't read it.
  /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.
  /NO_DOWNLOAD: use only files which are online locally.
  /VERBOSE  set to output some useful info
Example:
   thm_load_fft,/get_suppport_data,probe=['a', 'b']
Notes:

 $LastChangedBy: pcruce $
 $LastChangedDate: 2007-07-09 21:15:29 -0700 (Mon, 09 Jul 2007) $
 $LastChangedRevision: 1046 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_load_fft.pro $

(See themis/spacecraft/fields/thm_load_fft.pro)


THM_LOAD_FGM

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

Purpose:  Loads THEMIS fluxgate magnetometer 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'
  datatype = The type of data to be loaded, 'fge', 'fgh', or 'fgl'.  'all'
          can be passed in also, to get all variables.
  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
  level = the level of the data to read, the default is 'l1', or level-1
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  type=   'raw' or 'calibrated'. default is calibrated.
  coord=  coordinate system of output.  default is 'ssl'
  suffix= suffix to add to output data quantity (not added to support data)
  CDF_DATA: named variable in which to return cdf data structure: only works
          for a single spacecraft and datafile name.
  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.
  /DOWNLOADONLY: download file but don't read it.
  /no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  /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, set to 0 to or 1 to reduce output.
Example:
   thg_load_fgm,probe=['a','b']
Notes:
  This routine is (should be) platform independent.

 $LastChangedBy: kenb-mac $
 $LastChangedDate: 2007-07-12 12:09:54 -0700 (Thu, 12 Jul 2007) $
 $LastChangedRevision: 1084 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_load_fgm.pro $

(See themis/spacecraft/fields/thm_load_fgm.pro)


THM_LOAD_FIT

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

Purpose:  Loads THEMIS 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'
  datatype = The type of data to be loaded, can be an array of strings
          or single string separate by spaces.  The default is 'all'
  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
  level = the level of the data, the default is 'l1', or level-1
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  CDF_DATA: named variable in which to return cdf data structure: only works
          for a single spacecraft and datafile name.
  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.
  /DOWNLOADONLY: download file but don't read it.
  /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
Example:
   thg_load_fit,/get_suppport_data,probe=['a', 'b']
Notes:

 $LastChangedBy: pcruce $
 $LastChangedDate: 2007-07-17 11:37:23 -0700 (Tue, 17 Jul 2007) $
 $LastChangedRevision: 1134 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_load_fit.pro $

(See themis/spacecraft/fields/thm_load_fit.pro)


THM_LOAD_SCM

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

Purpose:  Loads THEMIS SCM 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'
  datatype = The type of data to be loaded, can be an array of strings 
          or single string separate by spaces.  The default is 'all'
  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
  level = the level of the data, the default is 'l1', or level-1
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  CDF_DATA: named variable in which to return cdf data structure: only works
          for a single spacecraft and datafile name.
  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.
  /DOWNLOADONLY: download file but don't read it.
  /no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  /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, set to 0 to or 1 to reduce output.
Example:
   thg_load_scm,level=1,/get_suppport_data,probe=['a', 'b']
Notes:
  This routine is (should be) platform independent.

 $LastChangedBy: jimm $
 $LastChangedDate: 2007-07-20 13:04:26 -0700 (Fri, 20 Jul 2007) $
 $LastChangedRevision: 1193 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_02/idl/themis/spacecraft/fields/thm_load_scm.pro $

(See themis/spacecraft/fields/thm_load_scm.pro)


THM_SCM_DECONVO_VEC

[Previous Routine] [Next Routine] [List of Routines]
Name:
 thm_scm_deconvo_vec
Purpose:
 continuous calibration accomplished by 
 convolveing a signal with a kernel.
 The kernel is derived by taking the fft of the 
 inverse of the frequency reponse.  The  kernel is also constructed
 to account for any sample delay.
Inputs:
    xio: input/output waveform
    nbp: number of points in xio
     nk: number of points in kernel: power of 2.
     f1: low frequency
     f2: high frequency
     fe: sample frequency
gainant: gain function, such as thm_scm_gainant
     ix: antenna number (1,2,3)
pathfil: calibration file name
    tau: time correction

(See themis/spacecraft/fields/thm_scm_deconvo_vec.pro)


THM_SPINFIT

[Previous Routine] [Next Routine] [List of Routines]
procedure: thm_spinfit

Purpose: finds spinfits of field data

         finds A,B, and C fits for each period of data, over the entire day

required parameters:
  var_name_in = tplot variable name containing data to fit

keywords:
  sigma = If set, will cause program to output tplot variable with sigma for each period.
  npoints = If set, will cause program to output tplot variable with number of points in fit.
  spinaxis = If set, program will output a tplot variable storing the average over the spin axis dimension
             for each time period.
  median  = If spinaxis set, program will output a median of each period instead of the average.
  plane_dim = Tells program which dimension to treat as the plane. 0=x, 1=y, 2=z. Default 0.
  axis_dim = Tells program which dimension contains axis to average over. Default 0.  Will not
             create a tplot variable unless used with /spinaxis.
  min_points = Minimum number of points to fit.  Default = 5.
  alpha = A parameter for finding fits.  Points outside of sigma*(alpha + beta*i)
          will be thrown out.  Default 1.4.
  beta = A parameter for finding fits.  See above.  Default = 0.4
  phase_mask_starts = Time to start masking data.  Default = 0
  phase_mask_ends = Time to stop masking data.  Default = -1
  sun2sensor = Tells how much to rotate data to align with sun sensor.

Example:
      thm_spinfit,'th?_fg?',/sigma

Notes: under construction!!

Written by Katherine Ramer
 $LastChangedBy: kramer $
 $LastChangedDate: 2007-06-08 10:10:36 -0700 (Fri June 8, 2007) $
 $LastChangedRevision: 0 $
 $URL:

(See themis/spacecraft/fields/thm_spinfit.pro)


THM_UNPACK_HED

[Previous Routine] [List of Routines]
Function: THM_UNPACK_HED
	thm_unpack_hed, data_type, hed_array

Purpose:  Unpacks data packed into HED data.

Arguements:
	DATA_TYPE	STRING, one of the L1 data types (eff, scp, fbk, etc.)
	HED_ARRAY	BYTE[ N, 16], array of header data.

keywords:
	None.

Example:
	get_data, 'tha_fit_hed', data=d_hed
   hed_data = thm_unpack_hed( 'fit', d_hed.y)

Notes:
	-- Returns int( 0) if requested DATA_TYPE is not implemented.
	-- Returns annonymous structure with variable elements if DATA_TYPE is recognized.
	-- Not all DATA_TYPEs are implemented; implemented data types (APIDs) listed below:
		FIT (on-board EFI and FGM spin fits, 410),
		FBK (FilterBank data, 440),
		EFI waveform (VA?, VB?, EF?; 441,442,443, 445,446,447, 449,44A,44B),
		SCM waveform (SCF, SCP, SCW; 444; 448; 44C),
		FGM waveform (FGL, FGH; 460, 461),
		FFT spectra (FFP, FFW; 44D, 44E).

 Modification History:
 Written by J Bonnell, 31 Jan 2007
 Modified by
  LeContel 2007-05-24 10:39  (Wed, 24 May 2007)
           Modification for reading scm and efw headers:
           speed = reform( dh[ *, 14]/16b)

 $LastChangedBy: jbonnell $
 $LastChangedDate: 2007-06-16 10:57:56 -0700 (Sat, 16 Jun 2007) $
 $LastChangedRevision: 794 $
 $URL $

(See themis/spacecraft/fields/thm_unpack_hed.pro)