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

Last modified: Mon Oct 20 03:17:44 2025.

# Directory Listing of Routines

# general/cotrans/lmn_transform

- GSM2LMN
  Routine transforms vector field from GSM to LMN (boundary-normal)
- GSM2LMN_WRAP
  Wrapper transforms vector field from GSM to LMN (boundary-normal)
- LMN_MATRIX_MAKE
- LMN_TRANSFORM_CRIB
  This code shows anatomy of the LMN transform, so essentially this is dissected gsm2lmn

# Routine Descriptions

## GSM2LMN

[Next Routine] [List of Routines]

     NAME:
         GSM2LMN

     PURPOSE:
    	Routine transforms vector field from GSM to LMN (boundary-normal)
    	coordinate system for magnetopause. Shue et al., 1998 magnetopause model
    	is used.

     CATEGORY:
    	Coordinate Transformation

     CALLING SEQUENCE:
    	gsm2lmn,txyz,Bxyz,Blmn,swdat

     INPUTS:
    	txyz: | t | x  | y  | z | - time and GSM position of the input vector (Bxyz).
               - 2D array (nvectors,4)
    	Bxyz: | Bx | By | Bz | - vector field to transform (in GSM).
               - 2D array (nvectors,3)
     OPTIONAL INPUT:
    	swdat: | t | Dp | Bz | of IMF at the bow-shock nose covering time
    		interval of interest. 2D array (ntimepoints,3). The time points
    		may be different from those of the vector field. However, they
    		should use the same time units.
    		If this input is not provided, the SPDF standard static SW data
    		are generated.

     KEYWORDS: none

     PARAMETERS: none

     OUTPUTS:
    	Blmn: | Bl | Bm | Bn | - vector in LMN at the same space-time points.
    		- 2D array (nvectors,3)

     DEPENDENCIES: None - can be used alone. Lowest-level part of LMN transform package.

     MODIFICATION HISTORY:
    	Written by:	Vladimir Kondratovich 2007/12/28 on the base of
    	the code xyz2lmnshue by Liu Jiang (09/21/2007)
    	Modified for error handling, changed () to [] for arrays, and now correctly
    	indexes for loop with long integers for large arrays
    	                                     by: Lynn B. Wilson III    2012/10/26

(See general/cotrans/lmn_transform/gsm2lmn.pro)

## GSM2LMN_WRAP

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

     NAME:
         GSM2LMN_WRAP

     PURPOSE:
    	Wrapper transforms vector field from GSM to LMN (boundary-normal)
    	coordinate system for magnetopause with help of routine gsm2lmn.pro.
    	It gets the necessary solar wind data with help of routine
    	solarwind_load.pro and passes all necessary keywords to it.

     CATEGORY:
    	Coordinate Transformation

     CALLING SEQUENCE:
    	gsm2lmn_wrap,txyz,Bxyz,Blmn,SWkeywords

     INPUTS:
    	txyz: | t | x  | y  | z | - time and position of the input vector (Bxyz).
               - 2D array (nvectors,4)
    	Bxyz: | Bx | By | Bz | - vector field to transform (in GSM).
               - 2D array (nvectors,3)

     KEYWORDS: Solarwind_load.pro keywords (Any combination of keywords defining
               output of solarwind_load.pro)

     PARAMETERS: none

     OUTPUTS:
    	Blmn: | Bl | Bm | Bn | - vector in LMN at the same space-time points.
    		- 2D array (nvectors,3)

     DEPENDENCIES: gsm2lmn.pro, solarwind_load.pro. Intermediate-level part of LMN
    		transform package.

     MODIFICATION HISTORY:
    	Written by:	Vladimir Kondratovich 2007/12/28

(See general/cotrans/lmn_transform/gsm2lmn_wrap.pro)

## LMN_MATRIX_MAKE

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

     Procedure:
      lmn_matrix_make

     Purpose:
      Creates a tplot variable, using the GSM to LMN transformation gsm2lmn.

     Parameters (required):
         pos_var_name: tplot name with position in GSM coorinates.
         mag_var_name: tplot name with B field in GSM coordinates.

     Keywords (optional):
         trange:   Time range of interest (array with 2 elements, start and end time).
                   If trange is not provided, it will be extracted from mag_var_name.
         hro2:     Flag. Load the newer HRO2 data set instead of HRO.
         newname:  Name for the output tplot variable. If not set, newname will be mag_var_name + "_lmn_mat".

    $LastChangedBy: nikos $
    $LastChangedDate: 2025-04-13 15:15:43 -0700 (Sun, 13 Apr 2025) $
    $LastChangedRevision: 33258 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/cotrans/lmn_transform/lmn_matrix_make.pro $

(See general/cotrans/lmn_transform/lmn_matrix_make.pro)

## LMN_TRANSFORM_CRIB

[Previous Routine] [List of Routines]

     NAME:
         LMN_TRANSFORM_CRIB

     PURPOSE:
    	This code shows anatomy of the LMN transform, so essentially this is dissected gsm2lmn
    	routine with hand-picked solar wind input. It projects the LMN base vectors onto the XY (GSM)
    	plane at the points of magnetopause boundary for different levels of Z (smooth line - Z=0,
    	dotted - Z=-10, dashed - Z=15 (Earth radii). The LMN orts are plotted in the sequence N-M-L,
    	so, if you see that the green one overshadows the red, that means that the green vector
    	screens part of the red vector (you look from atop of the Z axis).

     CATEGORY:
    	Crib

     CALLING SEQUENCE:
    	lmn_transform_crib

     INPUTS:
    	none

     KEYWORDS: none

     PARAMETERS: none; image parameters are set in the code

     OUTPUTS:
    	graphic file mpfig.ps (color postscript)

     DEPENDENCIES: CDAWlib files DeviceOpen.pro and DeviceClose.pro.

     MODIFICATION HISTORY:
    	Written by:	Vladimir Kondratovich 2008/01/30

(See general/cotrans/lmn_transform/lmn_transform_crib.pro)