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

Last modified: Wed Nov 5 03:16:59 2025.

# Directory Listing of Routines

# general/cotrans/special/enp

- ENP_CRIB
- ENP_MATRIX_MAKE

# Routine Descriptions

## ENP_CRIB

[Next Routine] [List of Routines]

     Procedure: enp_crib.pro

     Purpose:  A crib showing how to transform data from ENP coordinates to GEI coordinates and vice versa

       E: sat to earth (in orbtial plane)
       N: east (in orbital plane)
       P: north (perpendicular to orbtial plane).

      Defined relative to another coordinate system:
       P_sat = spacecraft position in geocentric inertial coordinate system
       V_sat = deriv(P_sat)   (spacecraft velocity in the same coordinate system.)

       P_enp = P_sat cross V_sat
       E_enp = -P_sat
       N_enp = P_enp cross P_sat

    Notes:

     $LastChangedBy: egrimes $
     $LastChangedDate: 2014-02-11 08:33:06 -0800 (Tue, 11 Feb 2014) $
     $LastChangedRevision: 14275 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/cotrans/special/enp/enp_crib.pro $

(See general/cotrans/special/enp/enp_crib.pro)

## ENP_MATRIX_MAKE

[Previous Routine] [List of Routines]

    Procedure: enp_matrix_make

    Purpose:
      Creates a set of matrices that will rotate data from the input coordinate system into
      ENP.(ie creates a GEI->ENP transformation matrix),
      You can use the invert keyword on tvector rotate to go from ENP->GEI
       E: sat to earth (in orbtial plane)
       N: east (in orbital plane)
       P: north (perpendicular to orbtial plane).

      Defined relative to another coordinate system:
       P_sat = spacecraft position in geocentric inertial coordinate system
       V_sat = deriv(P_sat)   (spacecraft velocity in the same coordinate system.)

       P_enp = P_sat cross V_sat
       E_enp = -P_sat
       N_enp = P_enp cross P_sat

    Inputs:
      pos_tvarname:  Tplot Variable storing the spacecraft position in an intertial earth-centered cartesian coordinate system(like gei)
                     You can use globbing to pass multiple position vectors simultaneously. ('th?_state_pos')

    Outputs:
      xxx2enp transformation matrix

     Keywords:

       fail=fail: Will be set to 1 if operation failed, returns 0 if operation succeeded.  Will not signal failure if
            at least one input was processed.
      suffix: The suffix to be appended to the tplot variables that the output matrices will be stored in.
             (Default: '_enp_mat' or '_pen_mat')
      newname: The name of the output matrix.  If this keyword is used with multiple input values, the outputs
              may overwrite each other.  So you should only set this keyword if there is a single value for the state input.
      velocity_tvar:  Set this keyword to the name of a tplot variable or variables that store velocities matching the positions.
               This way the routine doesn't need to calculate the velocity using derivatives

      orbital_elements: Set this keyword to a 3-element array with orbital elements so the transformation can be generated without reference to the velocity at all.
                        If this keyword is set, this method will take precedence over velocity_tvar method, or position derivative method.
         orbital_elements[0] = time in double precision seconds since 1970, (can use time_double('2007-03-23') to generate)
         orbital_elements[1] = right ascension of the ascending node and
         orbital_elements[2] = inclination

         Can also pass in a 2xN element array if you want orbital elements
         to be interpolated to the specific time. Finally, can be a
         2xNxM element array, if you want to provide orbital elements for each tplot variable being processed.

    Examples:

      enp_matrix_make,'g10_pos_gei'
      tvector_rotate,'g10_pos_gei_enp_mat','g10_b_gei'  ;GEI->ENP
      -OR-
      tvector_rotate,'g10_pos_gei_enp_mat','g10_b_enp',/invert ;ENP->GEI

      See ssl_general/cotrans/special/enp/enp_crib.pro

    Notes:
      1. Because velocity is calculated using the derivative of position,
      there should be a small numerical error at the end points of the time series

      2. Orbital elements method is based upon technique from Paul Lotaniu's C-based GEI2ENP transformation.

      3. Note, the assumption of constant orbital elements means there will be an error at the GEI-POS-Z 0-crossing, that
      is proportional to the error in the orbital elements, if the single orbital element method is used.

     $LastChangedBy: pcruce $
     $LastChangedDate: 2010-10-26 16:26:08 -0700 (Tue, 26 Oct 2010) $
     $LastChangedRevision: 7886 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/cotrans/special/enp/enp_matrix_make.pro $

(See general/cotrans/special/enp/enp_matrix_make.pro)