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

Last modified: Fri Aug 1 18:18:07 2025.

# Directory Listing of Routines

# projects/mms/common/tai

- ARRANGE_PLOTS
- CAL_ROT
  Returns a rotation matrix that rotates v1,v2 to the x-y plane
- CLEAN_TIME
  Check and fix the time arrays of the input variables.
- CROSSN3
- DEFINED
- DIAG_T
  Returns the temperature: [Tpara,Tperp,Tperp], T_total and
- VPERPPARA_XYZ

# Routine Descriptions

## ARRANGE_PLOTS

[Next Routine] [List of Routines]

     NAME: ARRANGE_PLOTS

     PURPOSE:  Returns normal coordinates of plot position box, suitable for
              passing to PLOT, when you want to put many plots on one
              page. Differs from setting !p.multi, because plots can be
              put against one another with no space between. You can
              specify the outer margins through keywords, as well as the
              gaps between plots. By default, the margins are 0.1 left,
              0.05 right, 0.1 bottom, 0.07 top, and there is no gap
              between plots in either direction.

     INPUTS:

     KEYWORD PARAMETERS:
                         NX - the number of plots in the x direction

                         NY - the number of plots in the y direction

                         NPLOTS - the total number of plots

                         X0MARGIN, Y0MARGIN,
                          X1MARGIN, Y1MARGIN - the plot margins, in
                          normalized coordinates.

                         SQUARE - if set, the resulting plots are
                                  square. The larger dimension is shrunk to
                                  make squares.
     OUTPUTS:
              x0, y0, x1, y1: These are named variables in which the
              left, lower, right, and upper boundaries, respectively of
              each plot are returned.

     EXAMPLE:
       arrange_plots, x0, y0, x1, y1, nx=3
       erase
       for i=0,2 do plot,my_data,position=[x0[i],y0[i],x1[i],y1[i]],/noerase

     MODIFICATION HISTORY:

(See projects/mms/common/tai/arrange_plots.pro)

## CAL_ROT

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

    FUNCTION:	cal_rot(v1,v2)
    INPUT:
    	v1:	3 component vector,
    	v2:	3 component vector,
    PURPOSE:
    	Returns a rotation matrix that rotates v1,v2 to the x-y plane
    	v1 is rotated to the x-axis and v2 into the x-y plane
    NOTES:
    	Function normally called by "add_df2d.pro" to rotate
    	velocities into the plane of Vsw and B

    CREATED BY:
    	J.McFadden
    LAST MODIFICATION:
    	95-9-13		J.McFadden

(See projects/mms/common/tai/cal_rot.pro)

## CLEAN_TIME

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

    NAME:
                 clean_time
    CALL:        clean_time,datanames [,SORT=SORT]
    PURPOSE:
                 Check and fix the time arrays of the input variables.
                 If the time array cannot be fixed, remove the corresponding
                 time and data values.
    WARNING:     This program is not an artificial intelligence.  It will not
                 work on all problems.  Particularly if there are lots of errors
                 piled up together or seperated by only a few time intervals.
                 It should be able to handle up to 40 consecuous time errors if
                 there is a bit of clean time (~40 points) before the next errors.
    INPUTS:      Array of strings.  Each string should be associated with a data
                 quantity.  (see the store_data and get_data routines)
                 alternately, datanames could be one data structure.
                 eg:  get_data,'Ve_3dp',dat=dat & clean_time,dat
    OPTIONAL INPUTS: seed:  an input to the filter routine. Default is 5.
                 seed is a filtering width factor.  If the default fails, choose
                 another seed that is not a multiple of 5.  Seed will affect
                 run time.
    KEYWORDS:
                 SORT: this is a kludge. assume all the time data is good.
                       this will sort the data monotonically.
                 PLOT: plot the new time array to see if it is acceptable.
                       this is mostly a debugging tool
                 LOUD:  Print lots of messages as the program chugs along.
    OUTPUTS:     Prints a strange report:  eg:  no errors found, data
                 cleaned, xx% data loss, data unrecoverable, too many errors.
    SIDE EFFECTS:If sucessful in finding errors, will alter the data array
                 and time array.
    LAST MODIFICATION:     @(#)clean_time.pro	1.5 95/12/04
    AUTHOR: Frank V. Marcoline

(See projects/mms/common/tai/clean_time.pro)

## CROSSN3

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

     NAME: CROSSN3

     PURPOSE: Takes cross product of two time series vectors, both of
              which must be N x 3 matrices.

     CALLING SEQUENCE:

     INPUTS: A, B - two N x 3 vectors

     OUTPUTS: C - an N x 3 vector, the cross product of A and B.

     EXAMPLE: compute V cross B (motional electric field)
     help,b, v
     B               FLOAT     = Array[1000, 3]
     V               FLOAT     = Array[1000, 3]
     e_motional = crossn3(v, b)

     MODIFICATION HISTORY: ???

(See projects/mms/common/tai/crossn3.pro)

## DEFINED

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

      brief way to check if a variable has been defined yet.
       returns 1 for defined variables, 0 for undefined.

      example:

          if defined(x) then begin
              do_stuff_to(x)
          endif

      Originally written 9-July-1996 by Bill Peria

(See projects/mms/common/tai/defined.pro)

## DIAG_T

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

    Procedure:	diag_t, temp, t=t, s=s
    INPUT:
    	temp:	temperature array of n by 6 or a string (e.g., 'Tp')
    PURPOSE:
    	Returns the temperature: [Tpara,Tperp,Tperp], T_total and
    		the unit symmetry axis s. Also returns 'T_diag' and 'S.axis'
    		for plotting purposes.

    CREATED BY:
    	Tai Phan	98-07-02
    LAST MODIFICATION:
    	98-07-02	Tai Phan

(See projects/mms/common/tai/diag_t.pro)

## VPERPPARA_XYZ

[Previous Routine] [List of Routines]

    Procedure:	vperppara_xyz, vel, magf, vperp_mag=vperp_mag, vpara=vpara, vperp_xyz=vperp_xyz
    INPUT:
    	vel:	a string containing a structure (e.g. a.x(1000), a.y(1000,3))
    	magf:	the other string. a.x and b.x are not the same. The resulting
    		array size is the size of a.
    OUTPUT:
    	vperp_mag: a string which contains the component of a perpendicular
    			to b.
    	vpara: a string which contains the component of a parallel
    			to b.

    CREATED BY:
    	Tai Phan	98-01-06
    LAST MODIFICATION:
    	2001-10-26		Tai Phan

(See projects/mms/common/tai/vperppara_xyz.pro)