public void calcPlanetaryPosition(Set<Planet> planets) {

    planetPos = new EnumMap<Planet, Double>(Planet.class);

    isReverse = new EnumMap<Planet, Boolean>(Planet.class);

    double[] res = new double[6];
    StringBuffer sbErr = new StringBuffer();

    for (Planet planet : planets) {

      int rc =
          sw.swe_calc_ut(sweDate.getJulDay(), planet.planetNo(), AstroConsts.iflag, res, sbErr);
      planetPos.put(planet, res[0]);

      if ((res[3] < 0) && (!Planet.isNode(planet))) {

        isReverse.put(planet, true);
      }
    }

    // No-way to compute ketu pos from swisseph
    Double rahuPos = planetPos.get(Planet.Rahu);

    if (rahuPos != null) {
      double ketuPos = (rahuPos + 180.00) % 360;
      planetPos.put(Planet.Ketu, ketuPos);
    }
    // System.out.println(sbErr);
  }
  public double getPlanetSpeed(Planet planet) {

    double[] res = new double[6];
    StringBuffer sbErr = new StringBuffer();
    sw.swe_calc_ut(sweDate.getJulDay(), planet.planetNo(), AstroConsts.iflag, res, sbErr);
    return res[3];
  }