This page was created by the IDL library routine `mk_html_help2`.

Last modified: Fri Oct 10 18:17:40 2025.

# Directory Listing of Routines

# general/cotrans/special/minvar

- MINVAR
- MINVAR_MATRIX_MAKE
- MINVAR_TEST

# Routine Descriptions

## MINVAR

[Next Routine] [List of Routines]

     Procedure: minvar.pro
     This program computes the principal variance directions and variances of a
     vector quantity (can be 2D or 3D) as well as the associated
     eigenvalues.  This routine is a simple version
     designed to be used by a tplot wrapper with the contrans_var library
     Works with trired and triql (IDL's version of Num. Recipies w/ permission)

     Input: Vxyz, an (ndim,npoints) array of data(ie 3xN)
     Output: eigenVijk, an (ndim,ndim) array containing the principal axes vectors
             Maximum variance direction eigenvector, Vi=eigenVijk(*,0)
             Intermediate variance direction, Vj=eigenVijk(*,1) (descending order)

             Vrot: if set to a name, that name becomes an array of (ndim,npoints)
             containing the rotated data in the new coordinate system, ijk.
             Vi(maximum direction)=Vrot(0,*)
             Vj(intermediate direction)=Vrot(1,*)
             Vk(minimum variance direction)=Vrot(2,*)

             lambdas2=if set to a name returns the eigenvalues of the
             computation

    Written by: Vassilis Angelopoulos

     $LastChangedBy: jwl $
     $LastChangedDate: 2025-03-15 12:11:20 -0700 (Sat, 15 Mar 2025) $
     $LastChangedRevision: 33186 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/cotrans/special/minvar/minvar.pro $

(See general/cotrans/special/minvar/minvar.pro)

## MINVAR_MATRIX_MAKE

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

    Procedure: minvar_matrix_make

    Purpose: tplot wrapper for minvar.pro.  This routine generates a
    matrix or set of matrices from a time series of 3-d vector data that
    will transform three dimensional data into a minimum variance
    coordinate system.  This routine takes a tplot variable that stores 3
    dimensional vector data as an argument and produces a tplot variable
    storing the transformation matrix or matrices.

    The minimum variance coordinate system is taken by generating the covariance
    matrix for an interval of data.  This matrix is then diagonalized to
    identify the eigenvalues and eigenvectors of the covariance matrix.
    The eigenvector with the smallest eigenvalue will form the direction
    of the z component of the new coordinate system.  The eigenvector
    with the largest eigenvalue will form the direction of the x
    component of the new coordinate system.  The third eigenvector will
    form the y direction of the coordinate system.

    Warning:  The resulting transformation matrices will only correctly
    transform data from the coordinate system of the input variable to
    the minimum variance coordinate system.  So if in_var_name is in gse
    coordinates then you should only use the output matrices to transform
    other data in gse coordinates.

    Arguments:
           in_var_name: the name of the tplot variable holding the input
           data, can be any sort of timeseries 3-d data

           tstart(optional): the start time of the data you'd like to
           consider for generating the transformation matrix(defaults to
           minimum time of in_var timeseries)

           tstop(optional): the stop time of the data you'd like to
           consider for generating the transformation matrix(defaults to
           maximum time of in_var timeseries)

           twindow(optional): the size of the window(in seconds) you'd like to
           consider when using a moving boxcar average to generate
           multiple transformations. (defaults to the entire time series)

           tslide(optional):  the number of seconds the boxcar should
           slide forward after each average.(defaults to twindow/2)
           set tslide=0 to cause the program to generate only a single
           matrix

           newname(optional): the name of the tplot variable in which to
           store the transformation matrix(matrices) (defaults to
           in_var_name+'_mva_mat'

           evname(optional): the name of the tplot variable in which to
           store the eigenvalues of the mva matrix(matrices) (defaults to
           nowhere, ie if unset doesn't store them

           error(optional): named variable that holds the error state of
           the computation, 1=success 0 = failure

           tminname(optional): name of a tplot variable in which you would
           like to store the minimum variance direction vectors this
           vector will be represented in the original coordinate system

           tmidname(optional):  name of a tplot variable in which you would
           like to store the intermediate variance direction vectors this
           vector will be represented in the original coordinate system

           tmaxname(optional): name of a tplot variable in which you would
           like to store the minimum variance direction vectors this
           vector will be represented in the original coordinate system

      SEE ALSO:
         minvar.pro
         tvector_rotate.pro
         thm_crib_mva.pro (THEMIS project)

     $LastChangedBy: jwl $
     $LastChangedDate: 2025-03-15 12:13:20 -0700 (Sat, 15 Mar 2025) $
     $LastChangedRevision: 33187 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/cotrans/special/minvar/minvar_matrix_make.pro $

(See general/cotrans/special/minvar/minvar_matrix_make.pro)

## MINVAR_TEST

[Previous Routine] [List of Routines]

    Basic tests for minvar.pro

    Written by Vassilis Angelopolous(vassilis@ssl.berkeley.edu)

     $LastChangedBy: pcruce $
     $LastChangedDate: 2007-10-04 15:40:27 -0700 (Thu, 04 Oct 2007) $
     $LastChangedRevision: 1667 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/cotrans/special/minvar/minvar.pro $

(See general/cotrans/special/minvar/minvar_test.pro)