Coordinate Systems
Transformations
- pyspedas.cotrans(name_in=None, name_out=None, time_in=None, data_in=None, coord_in=None, coord_out=None)[source]
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
Getting/Setting the Coordinate System
Support Routines
- pyspedas.cotrans.cotrans_lib.get_time_parts(time_in)[source]
Split time into year, doy, hours, minutes, seconds.fsec.
- pyspedas.cotrans.cotrans_lib.csundir_vect(time_in)[source]
Calculate the direction of the sun.
- Parameters:
- Returns:
- pyspedas.cotrans.cotrans_lib.cdipdir(time_in=None, iyear=None, idoy=None)[source]
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)[source]
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.tgsegsm_vect(time_in, data_in)[source]
Transform data from GSE to GSM.
- pyspedas.cotrans.cotrans_lib.tgsmgse_vect(time_in, data_in)[source]
Transform data from GSM to GSE.
- pyspedas.cotrans.cotrans_lib.subgeo2mag(time_in, data_in)[source]
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)[source]
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)[source]
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)[source]
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)[source]
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)[source]
Transform data from GEI to J2000.
- pyspedas.cotrans.cotrans_lib.subj20002gei(time_in, data_in)[source]
Transform data from J2000 to GEI.