Class RefsysModule
java.lang.Object
gaiasky.script.v2.impl.APIModule
gaiasky.script.v2.impl.RefsysModule
- All Implemented Interfaces:
RefsysAPI
-
Field Summary
Fields inherited from class APIModule
api, em, logger, me, nameModifier and TypeFieldDescriptionprotected final APIv2Reference to API object.protected final EventManagerReference to event manager.protected final Logger.Logprotected final APIModuleReference to self.protected final StringModule name. -
Constructor Summary
ConstructorsConstructorDescriptionRefsysModule(EventManager em, APIv2 api, String name) Create a new module with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]cartesian_to_equatorial(double x, double y, double z) Convert internal cartesian coordinates to equatorial[ra, dec, distance]coordinates.double[]cartesian_to_equatorial(int x, int y, int z) double[]ecliptic_to_cartesian(double l, double b, double r) Convert ecliptic coordinates to the internal cartesian coordinate system.double[]ecliptic_to_cartesian(int l, int b, int r) double[]ecliptic_to_equatorial(double[] ecl) Convert ecliptic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.double[]ecliptic_to_equatorial(List<?> ecl) double[]equatorial_cartesian_to_internal(double[] eq, double factor) 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.double[]equatorial_cartesian_to_internal(List<?> eq, double kmFactor) double[]equatorial_to_cartesian(double ra, double dec, double r) Convert equatorial coordinates to the internal cartesian coordinate system.double[]equatorial_to_cartesian(int ra, int dec, int r) double[]equatorial_to_ecliptic(double[] eq) Convert equatorial cartesian coordinates (in the internal reference system) to ecliptic cartesian coordinates.double[]equatorial_to_ecliptic(List<?> eq) double[]equatorial_to_galactic(double[] eq) Convert equatorial cartesian coordinates (in the internal reference system) to galactic cartesian coordinates.double[]equatorial_to_galactic(List<?> eq) double[]galactic_to_cartesian(double l, double b, double r) Convert galactic coordinates to the internal cartesian coordinate system.double[]galactic_to_cartesian(int l, int b, int r) double[]galactic_to_equatorial(double[] gal) Convert galactic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.double[]galactic_to_equatorial(List<?> gal) double[]get_transform_matrix(String name) Returns the column-major matrix representing the given reference system transformation.
-
Constructor Details
-
RefsysModule
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:RefsysAPIConvert galactic coordinates to the internal cartesian coordinate system.- Specified by:
galactic_to_cartesianin interfaceRefsysAPI- 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
Description copied from interface:RefsysAPIReturns the column-major matrix representing the given reference system transformation.- Specified by:
get_transform_matrixin interfaceRefsysAPI- 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:RefsysAPIConvert ecliptic coordinates to the internal cartesian coordinate system.- Specified by:
ecliptic_to_cartesianin interfaceRefsysAPI- 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:RefsysAPIConvert equatorial coordinates to the internal cartesian coordinate system.- Specified by:
equatorial_to_cartesianin interfaceRefsysAPI- 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:RefsysAPIConvert internal cartesian coordinates to equatorial[ra, dec, distance]coordinates.- Specified by:
cartesian_to_equatorialin interfaceRefsysAPI- 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]withraanddecin degrees anddistancein 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:RefsysAPIConvert 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_internalin interfaceRefsysAPI- 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 thateq * factor = Km.- Returns:
- Internal coordinates ready to be fed in other scripting functions.
-
equatorial_cartesian_to_internal
-
equatorial_to_galactic
public double[] equatorial_to_galactic(double[] eq) Description copied from interface:RefsysAPIConvert equatorial cartesian coordinates (in the internal reference system) to galactic cartesian coordinates.- Specified by:
equatorial_to_galacticin interfaceRefsysAPI- Parameters:
eq- Vector with [x, y, z] equatorial cartesian coordinates.- Returns:
- Vector with [x, y, z] galactic cartesian coordinates.
-
equatorial_to_galactic
-
equatorial_to_ecliptic
public double[] equatorial_to_ecliptic(double[] eq) Description copied from interface:RefsysAPIConvert equatorial cartesian coordinates (in the internal reference system) to ecliptic cartesian coordinates.- Specified by:
equatorial_to_eclipticin interfaceRefsysAPI- Parameters:
eq- Vector with [x, y, z] equatorial cartesian coordinates.- Returns:
- Vector with [x, y, z] ecliptic cartesian coordinates.
-
equatorial_to_ecliptic
-
galactic_to_equatorial
public double[] galactic_to_equatorial(double[] gal) Description copied from interface:RefsysAPIConvert galactic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.- Specified by:
galactic_to_equatorialin interfaceRefsysAPI- Parameters:
gal- Vector with [x, y, z] galactic cartesian coordinates.- Returns:
- Vector with [x, y, z] equatorial cartesian coordinates.
-
galactic_to_equatorial
-
ecliptic_to_equatorial
public double[] ecliptic_to_equatorial(double[] ecl) Description copied from interface:RefsysAPIConvert ecliptic cartesian coordinates (in the internal reference system) to equatorial cartesian coordinates.- Specified by:
ecliptic_to_equatorialin interfaceRefsysAPI- Parameters:
ecl- Vector with [x, y, z] ecliptic cartesian coordinates.- Returns:
- Vector with [x, y, z] equatorial cartesian coordinates.
-
ecliptic_to_equatorial
-