Class RefsysModule

java.lang.Object
gaiasky.script.v2.impl.APIModule
gaiasky.script.v2.impl.RefsysModule
All Implemented Interfaces:
RefsysAPI

public class RefsysModule extends APIModule implements RefsysAPI
The reference system module contains calls and methods to deal with reference system changes and other useful utilities related to orientation.
  • Constructor Details

    • RefsysModule

      public RefsysModule(EventManager em, APIv2 api, String name)
      Create a new module with the given attributes.
      Parameters:
      api - Reference to the API class.
      name - Name of the module.
  • Method Details

    • galactic_to_cartesian

      public double[] galactic_to_cartesian(double l, double b, double r)
      Description copied from interface: RefsysAPI
      Convert galactic coordinates to the internal cartesian coordinate system.
      Specified by:
      galactic_to_cartesian in interface RefsysAPI
      Parameters:
      l - The galactic longitude in degrees.
      b - The galactic latitude in degrees.
      r - The distance in Km.
      Returns:
      An array of doubles containing [x, y, z] in the internal reference system, in internal units.
    • get_transform_matrix

      public double[] get_transform_matrix(String name)
      Description copied from interface: RefsysAPI
      Returns the column-major matrix representing the given reference system transformation.
      Specified by:
      get_transform_matrix in interface RefsysAPI
      Parameters:
      name -

      The name of the reference system transformation:

      • 'equatorialtoecliptic', 'eqtoecl'
      • 'ecliptictoequatorial', 'ecltoeq'
      • 'galactictoequatorial', 'galtoeq'
      • 'equatorialtogalactic', 'eqtogal'
      • 'ecliptictogalactic', 'ecltogal
      • 'galactictoecliptic', 'galtoecl
      Returns:
      The transformation matrix in column-major order.
    • galactic_to_cartesian

      public double[] galactic_to_cartesian(int l, int b, int r)
    • ecliptic_to_cartesian

      public double[] ecliptic_to_cartesian(double l, double b, double r)
      Description copied from interface: RefsysAPI
      Convert ecliptic coordinates to the internal cartesian coordinate system.
      Specified by:
      ecliptic_to_cartesian in interface RefsysAPI
      Parameters:
      l - The ecliptic longitude in degrees.
      b - The ecliptic latitude in degrees.
      r - The distance in Km.
      Returns:
      An array of doubles containing [x, y, z] in the internal reference system, in internal units.
    • ecliptic_to_cartesian

      public double[] ecliptic_to_cartesian(int l, int b, int r)
    • equatorial_to_cartesian

      public double[] equatorial_to_cartesian(double ra, double dec, double r)
      Description copied from interface: RefsysAPI
      Convert equatorial coordinates to the internal cartesian coordinate system.
      Specified by:
      equatorial_to_cartesian in interface RefsysAPI
      Parameters:
      ra - The right ascension in degrees.
      dec - The declination in degrees.
      r - The distance in Km.
      Returns:
      An array of doubles containing [x, y, z] in the internal reference system, in internal units.
    • equatorial_to_cartesian

      public double[] equatorial_to_cartesian(int ra, int dec, int r)
    • cartesian_to_equatorial

      public double[] cartesian_to_equatorial(double x, double y, double z)
      Description copied from interface: RefsysAPI
      Convert internal cartesian coordinates to equatorial [ra, dec, distance] coordinates.
      Specified by:
      cartesian_to_equatorial in interface RefsysAPI
      Parameters:
      x - The x component, in any distance units.
      y - The y component, in any distance units.
      z - The z component, in any distance units.
      Returns:
      An array of doubles containing [ra, dec, distance] with ra and dec in degrees and distance in the same distance units as the input position.
    • cartesian_to_equatorial

      public double[] cartesian_to_equatorial(int x, int y, int z)
    • equatorial_cartesian_to_internal

      public double[] equatorial_cartesian_to_internal(double[] eq, double factor)
      Description copied from interface: RefsysAPI
      Convert regular Cartesian coordinates, where XY is the equatorial plane, with X pointing to the vernal equinox (ra=0) and Y points to ra=90, and Z pointing to the celestial North Pole (dec=90) to internal Cartesian coordinates in internal units.
      Specified by:
      equatorial_cartesian_to_internal in interface RefsysAPI
      Parameters:
      eq - Equatorial cartesian coordinates (X->[ra=0,dec=0], Y->[ra=90,dec=0], Z->[ra=0,dec=90]).
      factor - Factor used to bring the input coordinate units to Kilometers, so that eq * factor = Km.
      Returns:
      Internal coordinates ready to be fed in other scripting functions.
    • equatorial_cartesian_to_internal

      public double[] equatorial_cartesian_to_internal(List<?> eq, double kmFactor)
    • equatorial_to_galactic

      public double[] equatorial_to_galactic(double[] eq)
      Description copied from interface: RefsysAPI
      Convert equatorial cartesian coordinates (in the internal reference system) to galactic cartesian coordinates.
      Specified by:
      equatorial_to_galactic in interface RefsysAPI
      Parameters:
      eq - Vector with [x, y, z] equatorial cartesian coordinates.
      Returns:
      Vector with [x, y, z] galactic cartesian coordinates.
    • equatorial_to_galactic

      public double[] equatorial_to_galactic(List<?> eq)
    • equatorial_to_ecliptic

      public double[] equatorial_to_ecliptic(double[] eq)
      Description copied from interface: RefsysAPI
      Convert equatorial cartesian coordinates (in the internal reference system) to ecliptic cartesian coordinates.
      Specified by:
      equatorial_to_ecliptic in interface RefsysAPI
      Parameters:
      eq - Vector with [x, y, z] equatorial cartesian coordinates.
      Returns:
      Vector with [x, y, z] ecliptic cartesian coordinates.
    • equatorial_to_ecliptic

      public double[] equatorial_to_ecliptic(List<?> eq)
    • galactic_to_equatorial

      public double[] galactic_to_equatorial(double[] gal)
      Description copied from interface: RefsysAPI
      Convert galactic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.
      Specified by:
      galactic_to_equatorial in interface RefsysAPI
      Parameters:
      gal - Vector with [x, y, z] galactic cartesian coordinates.
      Returns:
      Vector with [x, y, z] equatorial cartesian coordinates.
    • galactic_to_equatorial

      public double[] galactic_to_equatorial(List<?> gal)
    • ecliptic_to_equatorial

      public double[] ecliptic_to_equatorial(double[] ecl)
      Description copied from interface: RefsysAPI
      Convert ecliptic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.
      Specified by:
      ecliptic_to_equatorial in interface RefsysAPI
      Parameters:
      ecl - Vector with [x, y, z] ecliptic cartesian coordinates.
      Returns:
      Vector with [x, y, z] equatorial cartesian coordinates.
    • ecliptic_to_equatorial

      public double[] ecliptic_to_equatorial(List<?> ecl)