This page was created by the IDL library routine mk_html_help2.

Last modified: Fri May 29 15:15:21 2009.


Directory Listing of Routines


Routine Descriptions

THM_PDIST

[Next Routine] [List of Routines]
  $Id: $

(See themis/spacecraft/particles/SST/thm_pdist.pro)


THM_SST_CRIB

[Previous Routine] [Next Routine] [List of Routines]
pro thm_sst_crib
 This is an example crib sheet that will load Solid State Telescope data.
 Open this file in a text editor and then use copy and paste to copy
 selected lines into an idl window. Or alternatively compile and run
 using the command:
 .RUN THM_SST_CRIB
Author: Davin Larson

 $Id:$

(See themis/spacecraft/particles/SST/thm_sst_crib.pro)


THM_SST_ERANGE_BIN_VAL

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE: THM_SST_ERANGE_BIN_VAL

Purpose:
   This routine generates the values that will be subtracted to remove electronic noise.  The actual subtraction is done by thm_sst_remove_sunpulse.pro
   A separate value will be calculated for each combination of bin and energy, but a single value will be calculated for all times(at a particular bin/energy).  
   This value will be generated using one of several different functions of the values across time.  The functions can be specified by the user. 
   The user should never call this routine directly, but should instead provide the appropriate arguments to thm_part_moments,thm_part_moments2, & thm_part_getspec
   These routines will guarantee that this routine is called correctly.
   
Arguments(note these arguments are generated correctly in thm_part_moments & thm_part_moments2)
   thx:  a string representing a probe prefix(ie 'tha')

   instrument:  a string representing the instrument(ie 'psif')  Note that this routine will only perform an operation if
   it is passed a string representing sst full distribution data.  (ie 'psif', 'psef')

   times:  a list of times for the sst measurements, this list is generated by thm_part_dist

Keywords:

 enoise_bins:  A 0-1 array that indicates which bins should be used to calculate electronic noise.  A 0 indicates that the
               bin should be used for electronic noise calculations.  This is basically the output from the bins argument of edit3dbins.
               It should have dimensions 16x4.

 enoise_bgnd_times:  This should be either a 2 element array or a 2xN element array(where n is the number of elements in enoise_bins).  
                    The arguments represents the start and end times over which the electronic background will be calculated for each
                    bin.  If you pass a 2 element array the same start and end times can be used for each bin.  If you pass a 2xN element
                    array, then the Ith bin in enoise_bins will use the time enoise_bgnd_time[0,I] as the start time and enoise_bgnd_time[1,I] as
                    the end time for the calculation of the background for that bin.  If this keyword is not set then electronic noise will not 
                    be subtracted.

 

 enoise_remove_method(default: 'fit_median') set the keyword to a string specifying the method you want to use to calculate the electronic noise that will be subtracted 
                      This function combines values across time.  The allowable options are:
                      'min':  Use the minimum value in the time interval for each bin/energy combination.
                      'average': Use the average value in the time interval for each bin/energy combination.
                      'median': Use the median value in the time interval for each bin/energy combination.
                      'fit_average': Fill in selected bins with a value that is interpolated across phi then subtracts the average of the difference
                      between the interpolated value and the actual value from each selected bin/energy combination.
                      'fit_median' :Fill in selected bins with a value that is interpolated across phi then subtracts the median of the difference
                      between the interpolated value and the actual value from each selected bin/energy combination.
                      
        
SEE ALSO:
  thm_part_moments.pro, thm_part_moments2.pro, thm_part_getspec.pro
  thm_part_dist.pro, thm_sst_psif.pro, thm_sst_psef.pro,thm_crib_sst_contamination.pro
  thm_sst_find_masking.pro, thm_sst_remove_sunpulse.pro

 $LastChangedBy: jimmpc $
 $LastChangedDate: 2009-05-29 15:10:52 -0700 (Fri, 29 May 2009) $
 $LastChangedRevision: 6004 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_5_02/idl/themis/spacecraft/particles/SST/thm_sst_erange_bin_val.pro $


(See themis/spacecraft/particles/SST/thm_sst_erange_bin_val.pro)


THM_SST_FIND_MASKING

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE: THM_SST_FIND_MASKING
Purpose:
  This routine is designed to find the indices of the masking in the SST Full distribution data.
  It directly checks the common block and then returns it for use by the remove_sunpulse routine
  While it is the function that actually takes the mask_fill argument, it should not ever be
  directly called by a user.   It was written so that it can identify the mask locations
  efficiently using a total, prior to the point at which thm_part_moments and thm_part_moments2
  begin to iterate over time.

  The majority of the documentation can be found in thm_remove_sunpulse.pro and thm_crib_sst_contamination.pro

 Arguments:
    thx:  a string storing the satellite prefix(ie 'tha')
    instrument:  a string identifying the instrument(ie 'psif')
    index:  a list of indices which specify the times that were requested
 Keywords:
    mask_remove: Set this keyword to the proportion of values that must be 0 at all energies to determine that a mask is present.
             Generally .99 or 1.0 is a good value.   The mask is a set of points that are set to 0 on-board the spacecraft.  By default they will
             be filled by linear interpolation across phi.  This keyword should be passed down via _extra from the parent
             routine.  If this keyword is not set, this routine will always return -1.
SEE ALSO:
  thm_part_moments.pro, thm_part_moments2.pro, thm_part_getspec.pro
  thm_part_dist.pro, thm_sst_psif.pro, thm_sst_psef.pro, thm_crib_sst_contamination.pro
  thm_sst_remove_sunpulse.pro

 $LastChangedBy: pcruce $
 $LastChangedDate: 2008-08-04 15:39:45 -0700 (Mon, 04 Aug 2008) $
 $LastChangedRevision: 3339 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_5_02/idl/themis/spacecraft/particles/SST/thm_sst_find_masking.pro $

(See themis/spacecraft/particles/SST/thm_sst_find_masking.pro)


THM_SST_PSEB

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

 Procedure: THM_SST_PSEB



VERSION:
  $LastChangedBy: $
  $LastChangedDate: $
  $LastChangedRevision:  $
  $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/spacecraft/particles/SST/thm_sst_psef.pro $

(See themis/spacecraft/particles/SST/thm_sst_pseb.pro)


THM_SST_PSEF

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

 Procedure: THM_SST_PSIF

  For documentation on sun contamination correction keywords that
  may be passed in through the _extra keyword please see:
  thm_sst_remove_sunpulse.pro or thm_crib_sst_contamination.pro


VERSION:
  $LastChangedBy: davin-win $
  $LastChangedDate: 2009-01-05 12:31:12 -0800 (Mon, 05 Jan 2009) $
  $LastChangedRevision: 4304 $
  $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_5_02/idl/themis/spacecraft/particles/SST/thm_sst_psef.pro $

(See themis/spacecraft/particles/SST/thm_sst_psef.pro)


THM_SST_PSER

[Previous Routine] [Next Routine] [List of Routines]
  $Id: thm_sst_pser.pro 3414 2008-08-19 20:00:22Z bckerr $

(See themis/spacecraft/particles/SST/thm_sst_pser.pro)


THM_SST_PSIF

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

  Procedure: THM_SST_PSIF

  For documentation on sun contamination correction keywords that
  may be passed in through the _extra keyword please see:
  thm_sst_remove_sunpulse.pro or thm_crib_sst_contamination.pro


VERSION:
  $LastChangedBy: davin-win $
  $LastChangedDate: 2009-01-05 12:31:12 -0800 (Mon, 05 Jan 2009) $
  $LastChangedRevision: 4304 $
  $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_5_02/idl/themis/spacecraft/particles/SST/thm_sst_psif.pro $

(See themis/spacecraft/particles/SST/thm_sst_psif.pro)


THM_SST_PSIR

[Previous Routine] [Next Routine] [List of Routines]
  $Id: thm_sst_psir.pro 3414 2008-08-19 20:00:22Z bckerr $

(See themis/spacecraft/particles/SST/thm_sst_psir.pro)


THM_SST_REMOVE_SUNPULSE

[Previous Routine] [List of Routines]
PROCEDURE: THM_SST_REMOVE_SUNPULSE
Purpose:
  Routine to perform a variety of calibrations on full distribution sst data.  
  These can remove sun contamination and on-board masking. They can also scale 
  the data to account for the loss of solid angle from the inability of the sst
  to measure directly along the probe geometric Z axis and the inability to measure
  directly along the probe geometric xy plane.(ie X=0,Y=0,Z = n or X=n,Y=m,Z=0,  are SST 'blind spots')  
  THM_REMOVE_SUNPULSE routine should not generally be called directly.
  Keywords to it will be passed down from higher level routines such as, thm_part_moments,
  thm_part_moments2, thm_part_dist,thm_part_getspec, thm_sst_psif, and thm_sst_psef

  Arguments:
           dat:  the dat structure used in thm_part_dist, etc...

  Keywords:
  all_angle_median:  set this option to replace the angular distribution with the median
                     of the data calculated over the all angles(thetas & phis) for each energy.
                     This will generally eliminate contamination in some of the moments, but will make 
                     analysis of angular plots impossible. It will also eliminate the velocity
                     moment.
  scale_sphere:  set this option to increase the value of all counts by 16%.  This accounts
                 for the loss of phase space mentioned above.

  method_sunpulse_clean:  set this to a string:  Either 'median' or 'spin_fit' or 'z_score_mod'
              'median':  This will remove all points that are greater 
                than 2.0 standard deviations from the median.By default they will be filled by a 
                linear interpolation across the phi angle by default. 
              'spin_fit':  This will remove all points that are greater
                than 2.0 standard deviations from a spin fit across phi angle.  The equation used to
                fit is A+B*sin(phi)+C*cos(phi). By default these points will be filled by a linear
                interpolation across the phi angle. The fitting is done using the svdfit routine
                from the idl distribution.
              'z_score_mod': This will remove all points that have a modified z-score(calculated across phi) greater than 3.5 
                The modified z-score is a normalized outlier detection test defined as follows:  
                #1 X_Bar = median(X+1)
                #2 Sigma = MAD = Median Absolute Deviation = median(abs(X-X_Bar))
                #3 Z_Score_Mod = .6745*(X - X_Bar)/Sigma
                This test can often get excellent results because it is insensitive to variation in standard deviation
                and skew in the distributions.  

  limit_sunpulse_clean: set this equal to a floating point number that will override the default of 2.0 standard
             deviation tolerance or 3.5 z_score_tolerance, used by the sunpulse cleaning methods by default.
             This keyword will only have an effect if the method_sunpulse_clean keyword is set.

  fillin_method: Set this keyword to a string that specifies the method used to fill the points that are
             removed via the method_sunpulse_clean or the mask_remove keywords.
             If 'interpolation' is set, this routine will interpolate across the phi angle.  This is the 
               default behavior. Interpolation is done using the interp_gap routine.
             If 'spin_fit' is set this routine will perform a spin fit to the data after the points
               have been removed using the equation A+B*sin(phi)+C*cos(phi).  It will then generate
               expected values for each removed phi using the equation of fit.   The fitting is done using
               the svdfit routine from the idl distribution.  Note that if 'spin_fit' is selected for
               the clean method and the fill method, this routine will perform two spin fits.

  mask_remove: Set this keyword to the proportion of values that must be 0 at all energies to determine that a mask is present.
             Generally .99 or 1.0 is a good value.  The mask is a set of points that are set to 0 on-board the spacecraft. 
             By default they will be filled by linear interpolation across phi.  NOTE: This argument is not actually accepted by
             this routine, it is only documented here.  If you provide this argument to thm_part_moments, 
             thm_part_moments2, or thm_part_getspec, those routines will appropriately set the value for the
             mask_tot keyword to this routine.

 enoise_bins:  A 0-1 array that indicates which bins should be used to calculate electronic noise.  A 0 indicates that the
               bin should be used for electronic noise calculations.  This is basically the output from the bins argument of edit3dbins.
               It should have dimensions 16x4. NOTE: This argument is not actually accepted by
               this routine, it is only documented here.  If you provide this argument to thm_part_moments, 
               thm_part_moments2, or thm_part_getspec, those routines will appropriately set the value for the
               enoise_tot keyword to this routine.

 enoise_bgnd_time:  This should be either a 2 element array or a 2xN element array(where n is the number of elements in enoise_bins).  
                The arguments represents the start and end times over which the electronic background will be calculated for each
                bin.  If you pass a 2 element array the same start and end times can be used for each bin.  If you pass a 2xN element
                array, then the Ith bin in enoise_bins will use the time enoise_bgnd_time[0,I] as the start time and enoise_bgnd_time[1,I] as
                the end time for the calculation of the background for that bin.  If this keyword is not set then electronic noise will not 
                be subtracted.NOTE: This argument is not actually accepted by
                this routine, it is only documented here.  If you provide this argument to thm_part_moments, 
                thm_part_moments2, or thm_part_getspec, those routines will appropriately set the value for the
                enoise_tot keyword to this routine.

 

 enoise_remove_method(default: 'fit_median') set the keyword to a string specifying the method you want to use to calculate the electronic noise that will be subtracted 
                This function combines values across time.  The allowable options are:
                'min':  Use the minimum value in the time interval for each bin/energy combination.
                'average': Use the average value in the time interval for each bin/energy combination.
                'median': Use the median value in the time interval for each bin/energy combination.
                'fit_average': Fill in selected bins with a value that is interpolated across phi,  then use
                     the average of these values across the time interval for each bin/energy combination.
                'fit_median' : Fill in selected bins with a value that is interpolated across phi,  then use
                     the mean of these values across the time interval for each bin/energy combination.
                  NOTE: This argument is not actually accepted by
                     this routine, it is only documented here.  If you provide this argument to thm_part_moments, 
                     thm_part_moments2, or thm_part_getspec, those routines will appropriately set the value for the
                     enoise_tot keyword to this routine.
 
  mask_tot:  The user should never manually set this keyword.  thm_part_moments,thm_part_moments2, & thm_part_getspec
             will properly set this keyword, if the mask_remove keyword is set when they are called.

  enoise_tot: The user should never manually set this keyword. thm_part_moments,thm_part_moments2, & thm_part_getspec
             will properly set this keyword, if enoise keywords are set when called.


 Examples:  
            thm_part_moments,probe='a',instrum=['ps?f'],mag_suffix='_peif_magf',scpot_suffix='_peif_sc_pot',moments='*', $
              /mask_remove,fillin_method='spin_fit',method_sunpulse_clean='spin_fit',limit_sunpulse_clean=1.8, $
              trange=['2008-05-19','2008-05-20'],tplotsuffix='_fit_mask_fit'
   
            thm_part_getspec, probe='a', trange=['2007-03-23','2007-03-23'],theta=[0,45], data_type='ps?f', angle='phi', $
              erange=[50000,100000], /mask_remove,method_sunpulse_clean='median',limit_sunpulse_clean=1.5, $
              suffix='_fit_mask_med_t2'  
          
            edit3dbins,thm_sst_psef(probe='a', time_double('2008-03-01'),method_sunpulse_clean='spin_fit', $
              limit_sunpulse_clean=1.2),ebins=4,sum_ebins=1


SEE ALSO:
  thm_part_moments.pro, thm_part_moments2.pro, thm_part_getspec.pro
  thm_part_dist.pro, thm_sst_psif.pro, thm_sst_psef.pro,thm_crib_sst_contamination.pro
  thm_sst_find_masking.pro, thm_sst_erange_bin_val.pro

 $LastChangedBy: jimmpc $
 $LastChangedDate: 2009-05-29 15:10:52 -0700 (Fri, 29 May 2009) $
 $LastChangedRevision: 6004 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_5_02/idl/themis/spacecraft/particles/SST/thm_sst_remove_sunpulse.pro $

(See themis/spacecraft/particles/SST/thm_sst_remove_sunpulse.pro)