# spacepy.ctrans.CTrans

class spacepy.ctrans.CTrans(ctime, ephmodel=None, pnmodel=None, eop=False)

  Coordinate transformation class for a single instance in time

  A general coordinate conversion routine, which takes a numpy array (Nx3) of Cartesian vectors along with the names of the input and output coordinate systems and returns an array of the converted coordinates.

  Parameters:
    ctime(spacepy.time.Ticktock, datetime, float, string)

      Input time stamp. Must have one time only. Accepted input formats

  Returns:
    out CTrans

      instance with self.convert, etc.

  Other Parameters:
    ephmodel str, optional

      Select ephemerides model (e.g., for determining Sun direction). Currently only ‘LGMDEFAULT’ is supported, for consistency with LANLGeoMag implementation.

    pnmodel str, optional

      Select precession/nutation model set. Options are: ‘IAU82’ (default), and ‘IAU00’.

    eop bool, optional

      Use Earth Orientation Parameters

  See also

  `spacepy.coordinates.Coords`

  Notes

  New in version 0.3.0.

  Methods

  `calcTimes`([recalc]) | Calculate time in systems required to set up coordinate transforms
  `calcOrbitParams`([recalc]) | Calculate Earth orbit parameters needed for coordinate transforms
  `calcCoreTransforms`([recalc]) | Calculate core coordinate transform matrices
  `calcMagTransforms`([recalc]) | Calculate geophysical coordinate systems
  `convert`(vec, sys_in, sys_out[, defaults]) | Convert an input vector between two coordinate systems
  `getEOP`([useEOP]) | Get/set Earth Orientation Parameters
  `gmst`() | Calculate Greenwich Mean Sidereal Time

  calcTimes(recalc=False, **kwargs)

    Calculate time in systems required to set up coordinate transforms

    Sets Julian Date and Julian centuries in UTC, TAI, UT1, and TT systems.

    Parameters:
      recalc bool, optional

        If True, recalculate the times for coordinate transformation. Default is False.

  calcOrbitParams(recalc=False)

    Calculate Earth orbit parameters needed for coordinate transforms

    Calculates Earth’s orbital parameters required for defining coordinate system transformations, such as orbital eccentricity, the obliquity of the ecliptic, anomalies, and precession angles.

    Parameters:
      recalc bool, optional

        If True, recalculate the orbital parameters for coordinate transformation. Default is False.

  calcCoreTransforms(recalc=False)

    Calculate core coordinate transform matrices

    These coordinate systems do not require information about Earth’s magnetic field. The systems are: Earth-Centered Inertial, J2000 (ECI2000) Earth-Centered Inertial, Mean-of-date (ECIMOD) Earth-Centered Inertial, True-of-date (ECITOD) Geocentric Solar Ecliptic (GSE) Geocentric Geographic (GEO)

    Parameters:
      recalc bool, optional

        If True, recalculate the core (non-magnetic) coordinate transformations. Default is False.

  calcMagTransforms(recalc=False)

    Calculate geophysical coordinate systems

    Calculate transforms for coordinate systems requiring magnetic field information.

    These are: Solar Magnetic (SM) Geocentric Solar Magnetospheric (GSM) Geomagnetic, centered dipole (CDMAG)

    Parameters:
      recalc bool, optional

        If True, recalculate the core (non-magnetic) coordinate transformations. Default is False.

  convert(vec, sys_in, sys_out, defaults=None)

    Convert an input vector between two coordinate systems

    Parameters:
      vec array-like

        Input 3-vector (can be an array of input 3-vectors) to convert. E.g., for 2D input the array must be like [[x1, y1, z1], [x2, y2, z2]]

      sys_in str

        String name for initial coordinate system. For supported systems, see module level documentation.

      sys_out str

        String name for target coordinate system. For supported systems, see module level documentation.

    Other Parameters:
      defaults namedtuple or None

        Named tuple containing default settings passed from Coordinates module

  getEOP(useEOP=False)

    Get/set Earth Orientation Parameters

    Parameters:
      useEOP bool

        If True, use Earth Orientation Parameters. Default False.

    Notes

    Currently Earth Orientation Parameters are all set to zero. Use is not yet supported.

  gmst()

    Calculate Greenwich Mean Sidereal Time

    Notes

    The formulation used to calculate GMST is selected using the status of the ‘pnmodel’ variable in the CTrans object attributes.