Coordinate Systems
Transformations
- pyspedas.cotrans(name_in=None, name_out=None, time_in=None, data_in=None, coord_in=None, coord_out=None)
Transform data from coord_in to coord_out.
- Parameters:
name_in (
str
, optional) – Pytplot name for input data.name_out (
str
, optional) – Pytplot name for output data.time_in (
list
offloat
, optional) – Time array. Ignored if name_in is provided.data_in (
list
offloat
, optional) – Data in the coord_in system. Ignored if name_in is provided.coord_in (
str
) – Name of input coordinate system. Valid options: “gse”, “gsm”, “sm”, “gei”, “geo”, “mag”, “j2000”coord_out (
str
) – Name of output coordinate system. Valid options: “gse”, “gsm”, “sm”, “gei”, “geo”, “mag”, “j2000”
- Returns:
Fills a new pytplot variable with data in the coord_out system.
- Return type:
Returns 1 for successful completion.
Examples
import pyspedas
pyspedas.themis.state(trange=['2015-10-16', '2015-10-17'], probe='c')
from pyspedas import cotrans
cotrans(name_in='thc_pos_gse', name_out='gsm_data', coord_in='gse', coord_out='gsm')
cotrans(name_in='thc_pos_gse', name_out='sm_data', coord_in='gse', coord_out='sm')
cotrans(name_in='thc_pos_gse', name_out='geo_data', coord_in='gse', coord_out='geo')
from pytplot import tplot
tplot(['gsm_data', 'sm_data', 'geo_data'])
LMN Coordinates
- pyspedas.cotrans.gsm2lmn.gsm2lmn(times, Rxyz, Bxyz, swdata=None)
Transforms vector field from GSM to LMN (boundary-normal) coordinate system for the magnetopause using the Shue et al. (1998) magnetopause model
Getting/Setting the Coordinate System
- pyspedas.cotrans_get_coord(name)
- pyspedas.cotrans_set_coord(name, coord)
Support Routines
- pyspedas.cotrans.cotrans_lib.get_time_parts(time_in)
Split time into year, doy, hours, minutes, seconds.fsec.
- pyspedas.cotrans.cotrans_lib.csundir_vect(time_in)
Calculate the direction of the sun.
- Parameters:
- Returns:
- pyspedas.cotrans.cotrans_lib.cdipdir(time_in=None, iyear=None, idoy=None)
Compute dipole direction in GEO coordinates.
Notes
Compute geodipole axis direction from International Geomagnetic Reference Field (IGRF-13) model for time interval 1970 to 2020. For time out of interval, computation is made for nearest boundary. Same as SPEDAS cdipdir.
- pyspedas.cotrans.cotrans_lib.cdipdir_vect(time_in=None, iyear=None, idoy=None)
Compute dipole direction in GEO coordinates.
Similar to cdipdir but for arrays.
- Parameters:
- Return type:
Notes
Same as SPEDAS cdipdir_vec.
- pyspedas.cotrans.cotrans_lib.tgeigse_vect(time_in, data_in)
GEI to GSE transformation.
- pyspedas.cotrans.cotrans_lib.subgei2gse(time_in, data_in)
Transform data from GEI to GSE.
- pyspedas.cotrans.cotrans_lib.tgsegei_vect(time_in, data_in)
GSE to GEI transformation.
- pyspedas.cotrans.cotrans_lib.subgse2gei(time_in, data_in)
Transform data from GSE to GEI.
- pyspedas.cotrans.cotrans_lib.tgsegsm_vect(time_in, data_in)
Transform data from GSE to GSM.
- pyspedas.cotrans.cotrans_lib.subgse2gsm(time_in, data_in)
Transform data from GSE to GSM.
- pyspedas.cotrans.cotrans_lib.tgsmgse_vect(time_in, data_in)
Transform data from GSM to GSE.
- pyspedas.cotrans.cotrans_lib.subgsm2gse(time_in, data_in)
Transform data from GSM to GSE.
- pyspedas.cotrans.cotrans_lib.tgsmsm_vect(time_in, data_in)
Transform data from GSM to SM.
- pyspedas.cotrans.cotrans_lib.subgsm2sm(time_in, data_in)
Transform data from GSM to SM.
- pyspedas.cotrans.cotrans_lib.tsmgsm_vect(time_in, data_in)
Transform data from SM to GSM.
- pyspedas.cotrans.cotrans_lib.subsm2gsm(time_in, data_in)
Transform data from SM to GSM.
- pyspedas.cotrans.cotrans_lib.subgei2geo(time_in, data_in)
Transform data from GEI to GEO.
- pyspedas.cotrans.cotrans_lib.subgeo2gei(time_in, data_in)
Transform data from GEO to GEI.
- pyspedas.cotrans.cotrans_lib.subgeo2mag(time_in, data_in)
Transform data from GEO to MAG.
- Parameters:
- Returns:
Coordinates in MAG.
- Return type:
Array
offloat
Notes
Adapted from spedas IDL file geo2mag.pro.
- pyspedas.cotrans.cotrans_lib.submag2geo(time_in, data_in)
Transform data from MAG to GEO.
- Parameters:
- Returns:
Coordinates in GEO.
- Return type:
Array
offloat
Notes
Adapted from spedas IDL file mag2geo.pro.
- pyspedas.cotrans.cotrans_lib.ctv_mm_mult(m1, m2)
Vectorized multiplication of two lists of 3x3 matrices.
- Parameters:
- Returns:
Array (3, 3, n). List of n 3x3 matrices.
- Return type:
Array
offloat
Notes
Adapted from spedas IDL file matrix_array_lib.pro.
- pyspedas.cotrans.cotrans_lib.j2000_matrix_vec(time_in)
Get the conversion matrix for J2000 coordinates.
Gives a matrix that transforms from mean earth equator and equinox of J2000 into the true earth equator and equinox for the dates and times.
- Parameters:
- Returns:
Transformation matrix.
- Return type:
Matrix
offloat
Notes
Adapted from spedas IDL file spd_make_j2000_matrix_vec.pro.
- pyspedas.cotrans.cotrans_lib.ctv_mx_vec_rot(m, v)
Vectorized multiplication of n matrices by n vectors.
- Parameters:
- Returns:
Array (n, k). List of n vectors.
- Return type:
Array
offloat
Notes
Adapted from spedas IDL file matrix_array_lib.pro.
- pyspedas.cotrans.cotrans_lib.subgei2j2000(time_in, data_in)
Transform data from GEI to J2000.
- pyspedas.cotrans.cotrans_lib.subj20002gei(time_in, data_in)
Transform data from J2000 to GEI.
- pyspedas.cotrans.cotrans_lib.subcotrans(time_in, data_in, coord_in, coord_out)
Transform data from coord_in to coord_out.
Calls the other sub functions in this file.