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

Last modified: Tue Sep 23 18:17:45 2025.

# Directory Listing of Routines

# projects/themis/spacecraft/particles/ESA/thm_esa_slice2d

- THM_CAL_ROT
  Returns a rotation matrix that rotates v1,v2 to the x-y plane
- THM_DAT_AVG
- THM_ESA_SLICE2D

# Routine Descriptions

## THM_CAL_ROT

[Next Routine] [List of Routines]

    FUNCTION:	thm_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/themis/spacecraft/particles/ESA/thm_esa_slice2d/thm_cal_rot.pro)

## THM_DAT_AVG

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

     Name: thm_dat_avg.pro

     Purpose:  Averages data from tplot variable over specified
               time range and returns value.

     Calling Sequence:
       result = thm_dat_avg( tplot_var,  time1, time2 [,interpolate=interpolate])

     Arguments:
       tplot_var: String containing the name of valid tplot variable
       time1: String or double precision number specifying a time range boundary
       time2: String or double precision number specifying a time range boundary
              (time1 / time 2 may be in any order)

     Keywords:
       interpolate: Flag to attempt interpolation from data outside the specifed
                    range if none is found within.  At least 20 min or half the
                    specified range will be checked past both time limits.

     Example:
       t1 = '2008-4-12/02:00'
       t0 = '2008-4-12/01:00'
       bfield_ave = thm_dat_avg('tha_fgs', t0, t1)

(See projects/themis/spacecraft/particles/ESA/thm_esa_slice2d/thm_dat_avg.pro)

## THM_ESA_SLICE2D

[Previous Routine] [List of Routines]

    Procedure:	thm_esa_slice2d

    Purpose:	creates a 2-D slice of the 3-D ESA ion or electron distribution function.

    Call:		thm_esa_slice2d,sc,typ,current_time,timeinterval,[keywords]

    Keywords:	SPECIES: 'ion' or 'ele'
               ROTATION: suggesting the x and y axis, which can be specified as the followings:
                 'BV': the x axis is V_para (to the magnetic field) and the bulk velocity is in the x-y plane. (DEFAULT)
                 'BE': the x axis is V_para (to the magnetic field) and the VxB direction is in the x-y plane.
                 'xy': the x axis is V_x and the y axis is V_y.
                 'xz': the x axis is V_x and the y axis is V_z.
                 'yz': the x axis is V_y and the y axis is V_z.
                 'perp': the x-y plane is perpendicular to the B field, while the x axis is the velocity projection on the plane.
                 'perp_xy': the x-y plane is perpendicular to the B field, while the x axis is the x projection on the plane.
                 'perp_xz': the x-y plane is perpendicular to the B field, while the x axis is the x projection on the plane.
                 'perp_yz': the x-y plane is perpendicular to the B field, while the x axis is the y projection on the plane.
               ANGLE: the lower and upper angle limits of the slice selected to plot (DEFAULT [-20,20]).
               THIRDDIRLIM: the velocity limits of the slice. Once activated, the ANGLE keyword would be invalid..
               FILETYPE: 'png' or 'ps'. (DEFAULT 'png')
               OUTPUTFILE: the name of the output file.
    			THEBDATA: specifies magnetic data to use.
    			FINISHED: makes the output publication quality when using ps (NOT WORKING WELL).
    			XRANGE: vector specifying the xrange
    			RANGE: vector specifying the color range
    			ERANGE: specifies the energy range to be used
    			UNITS: specifies the units ('eflux','df',etc.) (Def. is 'df')
    			NOZLOG: specifies a linear Z axis
    			POSITION: positions the plot using a 4-vector
    			NOFILL: doesn't fill the contour plot with colors
    			NLINES: says how many lines to use if using NOFILL (DEFAULT 60, MAX 60)
    			NOOLINES: suppresses the black contour lines
    			NUMOLINES: how many black contour lines (DEFAULT 20, MAX 60)
               REMOVEZERO: removes the data with zero counts for plotting
    			SHOWDATA: plots all the data points over the contour
    			VEL: tplot variable containing the velocity data
    			     (default is calculated with v_3d)
    			NOGRID: forces no triangulation
    			NOSMOOTH: suppresses smoothing (IF NOT SET, DEFAULT IS SMOOTH)
    			NOSUN: suppresses the sun direction line
    			NOVELLINE: suppresses the velocity line
               SUBTRACT: subtract the bulk velocity before plot
    			RESOLUTION: resolution of the mesh (DEFAULT 51)
    			RMBINS: removes the sun noise by cutting out certain bins
    			THETA: specifies the theta range for RMBINS (def 20)
    			PHI: specifies the phi range for RMBINS (def 40)
    			NR: removes background noise from ph using noise_remove
    			NOISELEVEL: background level in eflux
    			BOTTOM: level to set as min eflux for background. def. is 0.
    			SR, RS, RM2: removes the sun noise using subtraction
    				REQUIRES write_ph.doc to run
    			NLOW: used with rm2.  Sets bottom of eflux noise level
    				def. 1e4
    			M: marks the tplot at the current time
    			VEL2: takes a 3-vector velocity and puts it on the plot
    CREATED BY:		Arjun Raj
    EXAMPLES:  see the crib file: themis_cut_crib.pro
    REMARKS:		when calling with phb and rm2, use file='write_phb.doc'
    			also, set the noiselevel to 1e5.  This gives the best
    			results

    LAST EDITED BY XUZHI ZHOU 4-24-2008

(See projects/themis/spacecraft/particles/ESA/thm_esa_slice2d/thm_esa_slice2d.pro)