当前位置: 首页>>代码示例>>Java>>正文


Java OrekitException类代码示例

本文整理汇总了Java中org.orekit.errors.OrekitException的典型用法代码示例。如果您正苦于以下问题:Java OrekitException类的具体用法?Java OrekitException怎么用?Java OrekitException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OrekitException类属于org.orekit.errors包,在下文中一共展示了OrekitException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refineIntersection

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public NormalizedGeodeticPoint refineIntersection(final ExtendedEllipsoid ellipsoid,
                                                  final Vector3D position, final Vector3D los,
                                                  final NormalizedGeodeticPoint closeGuess)
    throws RuggedException {
    try {
        DumpManager.dumpAlgorithm(AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID, constantElevation);
        final Vector3D      p  = ellipsoid.pointAtAltitude(position, los, constantElevation);
        final GeodeticPoint gp = ellipsoid.transform(p, ellipsoid.getFrame(), null);
        return new NormalizedGeodeticPoint(gp.getLatitude(), gp.getLongitude(), gp.getAltitude(),
                                           closeGuess.getLongitude());
    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts());
    }
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:17,代码来源:ConstantElevationAlgorithm.java

示例2: refineIntersection

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public NormalizedGeodeticPoint refineIntersection(final ExtendedEllipsoid ellipsoid,
                                                  final Vector3D position, final Vector3D los,
                                                  final NormalizedGeodeticPoint closeGuess)
    throws RuggedException {
    try {
        DumpManager.dumpAlgorithm(AlgorithmId.BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY);
        final Vector3D      delta     = ellipsoid.transform(closeGuess).subtract(position);
        final double        s         = Vector3D.dotProduct(delta, los) / los.getNormSq();
        final GeodeticPoint projected = ellipsoid.transform(new Vector3D(1, position, s, los),
                                                            ellipsoid.getBodyFrame(), null);
        final NormalizedGeodeticPoint normalizedProjected = new NormalizedGeodeticPoint(projected.getLatitude(),
                                                                                        projected.getLongitude(),
                                                                                        projected.getAltitude(),
                                                                                        closeGuess.getLongitude());
        final Tile          tile      = cache.getTile(normalizedProjected.getLatitude(),
                                                      normalizedProjected.getLongitude());
        return tile.cellIntersection(normalizedProjected,
                                     ellipsoid.convertLos(normalizedProjected, los),
                                     tile.getFloorLatitudeIndex(normalizedProjected.getLatitude()),
                                     tile.getFloorLongitudeIndex(normalizedProjected.getLongitude()));
    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts());
    }
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:27,代码来源:BasicScanAlgorithm.java

示例3: selectInertialFrame

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** Select inertial frame.
 * @param inertialFrameId inertial frame identifier
 * @return inertial frame
 * @exception RuggedException if data needed for some frame cannot be loaded
 */
private static Frame selectInertialFrame(final InertialFrameId inertialFrameId)
    throws RuggedException {

    try {
        // set up the inertial frame
        switch (inertialFrameId) {
        case GCRF :
            return FramesFactory.getGCRF();
        case EME2000 :
            return FramesFactory.getEME2000();
        case MOD :
            return FramesFactory.getMOD(IERSConventions.IERS_1996);
        case TOD :
            return FramesFactory.getTOD(IERSConventions.IERS_1996, true);
        case VEIS1950 :
            return FramesFactory.getVeis1950();
        default :
            // this should never happen
            throw RuggedException.createInternalError(null);
        }
    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts().clone());
    }

}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:31,代码来源:RuggedBuilder.java

示例4: selectBodyRotatingFrame

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** Select body rotating frame.
 * @param bodyRotatingFrame body rotating frame identifier
 * @return body rotating frame
 * @exception RuggedException if data needed for some frame cannot be loaded
 */
private static Frame selectBodyRotatingFrame(final BodyRotatingFrameId bodyRotatingFrame)
    throws RuggedException {

    try {
        // set up the rotating frame
        switch (bodyRotatingFrame) {
        case ITRF :
            return FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        case ITRF_EQUINOX :
            return FramesFactory.getITRFEquinox(IERSConventions.IERS_1996, true);
        case GTOD :
            return FramesFactory.getGTOD(IERSConventions.IERS_1996, true);
        default :
            // this should never happen
            throw RuggedException.createInternalError(null);
        }
    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts().clone());
    }

}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:27,代码来源:RuggedBuilder.java

示例5: pointOnGround

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** Get point on ground along a pixel line of sight.
 * @param position cell position (in body frame)
 * @param los pixel line-of-sight, not necessarily normalized (in body frame)
 * @param centralLongitude reference longitude lc such that the point longitude will
 * be normalized between lc-π and lc+π
 * @return point on ground
 * @exception RuggedException if no such point exists (typically line-of-sight missing body)
 */
public NormalizedGeodeticPoint pointOnGround(final Vector3D position, final Vector3D los,
                                             final double centralLongitude)
    throws RuggedException {
    try {
        DumpManager.dumpEllipsoid(this);
        final GeodeticPoint gp =
                getIntersectionPoint(new Line(position, new Vector3D(1, position, 1e6, los), 1.0e-12),
                                     position, getBodyFrame(), null);
        if (gp == null) {
            throw new RuggedException(RuggedMessages.LINE_OF_SIGHT_DOES_NOT_REACH_GROUND);
        }
        return new NormalizedGeodeticPoint(gp.getLatitude(), gp.getLongitude(), gp.getAltitude(),
                                           centralLongitude);
    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts());
    }
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:26,代码来源:ExtendedEllipsoid.java

示例6: convertLos

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** Convert a line-of-sight from Cartesian to topocentric.
 * @param primary reference point on the line-of-sight (in body frame and Cartesian coordinates)
 * @param secondary secondary point on the line-of-sight, only used to define a direction
 * with respect to the primary point (in body frame and Cartesian coordinates)
 * @return line-of-sight in topocentric frame (East, North, Zenith) of the point,
 * scaled to match radians in the horizontal plane and meters along the vertical axis
 * @exception RuggedException if points cannot be converted to geodetic coordinates
 */
public Vector3D convertLos(final Vector3D primary, final Vector3D secondary)
    throws RuggedException {
    try {

        // switch to geodetic coordinates using primary point as reference
        final GeodeticPoint point = transform(primary, getBodyFrame(), null);
        final Vector3D      los   = secondary.subtract(primary);

        // convert line of sight
        return convertLos(point, los);

    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts());
    }
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:24,代码来源:ExtendedEllipsoid.java

示例7: testInverseLoc02

import org.orekit.errors.OrekitException; //导入依赖的package包/类
@Test
public void testInverseLoc02() throws URISyntaxException, IOException, OrekitException, RuggedException {

    String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath();
    DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath)));

    String dumpPath = getClass().getClassLoader().getResource("replay/replay-inverse-loc-02.txt").toURI().getPath();
    DumpReplayer replayer = new DumpReplayer();
    replayer.parse(new File(dumpPath));
    Rugged rugged = replayer.createRugged();
    DumpReplayer.Result[] results = replayer.execute(rugged);

    Assert.assertEquals(3, results.length);
    for (final DumpReplayer.Result result : results) {
        SensorPixel expectedSP = (SensorPixel) result.getExpected();
        SensorPixel replayedSP = (SensorPixel) result.getReplayed();
        Assert.assertEquals(expectedSP.getLineNumber(),  replayedSP.getLineNumber(),  1.0e-6);
        Assert.assertEquals(expectedSP.getPixelNumber(), replayedSP.getPixelNumber(), 1.0e-6);
    }

}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:22,代码来源:DumpReplayerTest.java

示例8: parse

import org.orekit.errors.OrekitException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void parse(final int l, final File file, final String line, final String[] fields, final DumpReplayer global)
    throws RuggedException {
    try {
        if (fields.length < 10 ||
            !fields[0].equals(MIN_DATE)  || !fields[2].equals(MAX_DATE) || !fields[4].equals(T_STEP)   ||
            !fields[6].equals(TOLERANCE) || !fields[8].equals(INERTIAL_FRAME)) {
            throw new RuggedException(RuggedMessages.CANNOT_PARSE_LINE, l, file, line);
        }
        global.minDate        = new AbsoluteDate(fields[1], TimeScalesFactory.getUTC());
        global.maxDate        = new AbsoluteDate(fields[3], TimeScalesFactory.getUTC());
        global.tStep          = Double.parseDouble(fields[5]);
        global.tolerance      = Double.parseDouble(fields[7]);
        global.bodyToInertial = new TreeMap<Integer, Transform>();
        global.scToInertial   = new TreeMap<Integer, Transform>();
        try {
            global.inertialFrame = FramesFactory.getFrame(Predefined.valueOf(fields[9]));
        } catch (IllegalArgumentException iae) {
            throw new RuggedException(RuggedMessages.CANNOT_PARSE_LINE, l, file, line);
        }
    } catch (OrekitException oe) {
        throw new RuggedException(oe, oe.getSpecifier(), oe.getParts());
    }
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:26,代码来源:DumpReplayer.java

示例9: testInverseLoc01

import org.orekit.errors.OrekitException; //导入依赖的package包/类
@Test
public void testInverseLoc01() throws URISyntaxException, IOException, OrekitException, RuggedException {

    String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath();
    DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath)));

    String dumpPath = getClass().getClassLoader().getResource("replay/replay-inverse-loc-01.txt").toURI().getPath();
    DumpReplayer replayer = new DumpReplayer();
    replayer.parse(new File(dumpPath));
    Rugged rugged = replayer.createRugged();
    DumpReplayer.Result[] results = replayer.execute(rugged);

    Assert.assertEquals(1, results.length);
    for (final DumpReplayer.Result result : results) {
        SensorPixel expectedSP = (SensorPixel) result.getExpected();
        SensorPixel replayedSP = (SensorPixel) result.getReplayed();
        Assert.assertEquals(expectedSP.getLineNumber(),  replayedSP.getLineNumber(),  1.0e-6);
        Assert.assertEquals(expectedSP.getPixelNumber(), replayedSP.getPixelNumber(), 1.0e-6);
    }

}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:22,代码来源:DumpReplayerTest.java

示例10: createInterpolator

import org.orekit.errors.OrekitException; //导入依赖的package包/类
private SpacecraftToObservedBody createInterpolator(LineSensor sensor)
    throws RuggedException, OrekitException {
    Orbit orbit = new CircularOrbit(7173352.811913891,
                                    -4.029194321683225E-4, 0.0013530362644647786,
                                    FastMath.toRadians(98.63218182243709),
                                    FastMath.toRadians(77.55565567747836),
                                    FastMath.PI, PositionAngle.TRUE,
                                    FramesFactory.getEME2000(), sensor.getDate(1000),
                                    Constants.EIGEN5C_EARTH_MU);
    BodyShape earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
                                           Constants.WGS84_EARTH_FLATTENING,
                                           FramesFactory.getITRF(IERSConventions.IERS_2010, true));
    AbsoluteDate minDate = sensor.getDate(0);
    AbsoluteDate maxDate = sensor.getDate(2000);
    return new SpacecraftToObservedBody(orbit.getFrame(), earth.getBodyFrame(),
                                        minDate, maxDate, 0.01,
                                        5.0,
                                        orbitToPV(orbit, earth, minDate, maxDate, 0.25), 2,
                                        CartesianDerivativesFilter.USE_P,
                                        orbitToQ(orbit, earth, minDate, maxDate, 0.25), 2,
                                        AngularDerivativesFilter.USE_R);
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:23,代码来源:SensorMeanPlaneCrossingTest.java

示例11: orbitToPV

import org.orekit.errors.OrekitException; //导入依赖的package包/类
private List<TimeStampedPVCoordinates> orbitToPV(Orbit orbit, BodyShape earth,
                                                 AbsoluteDate minDate, AbsoluteDate maxDate,
                                                 double step)
    throws OrekitException {
    Propagator propagator = new KeplerianPropagator(orbit);
    propagator.setAttitudeProvider(new YawCompensation(orbit.getFrame(), new NadirPointing(orbit.getFrame(), earth)));
    propagator.propagate(minDate);
    final List<TimeStampedPVCoordinates> list = new ArrayList<TimeStampedPVCoordinates>();
    propagator.setMasterMode(step, new OrekitFixedStepHandler() {
        public void init(SpacecraftState s0, AbsoluteDate t) {
        }   
        public void handleStep(SpacecraftState currentState, boolean isLast) {
            list.add(new TimeStampedPVCoordinates(currentState.getDate(),
                                                  currentState.getPVCoordinates().getPosition(),
                                                  currentState.getPVCoordinates().getVelocity(),
                                                  Vector3D.ZERO));
        }
    });
    propagator.propagate(maxDate);
    return list;
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:22,代码来源:SensorMeanPlaneCrossingTest.java

示例12: orbitToQ

import org.orekit.errors.OrekitException; //导入依赖的package包/类
private List<TimeStampedAngularCoordinates> orbitToQ(Orbit orbit, BodyShape earth,
                                                     AbsoluteDate minDate, AbsoluteDate maxDate,
                                                     double step)
    throws OrekitException {
    Propagator propagator = new KeplerianPropagator(orbit);
    propagator.setAttitudeProvider(new YawCompensation(orbit.getFrame(), new NadirPointing(orbit.getFrame(), earth)));
    propagator.propagate(minDate);
    final List<TimeStampedAngularCoordinates> list = new ArrayList<TimeStampedAngularCoordinates>();
    propagator.setMasterMode(step, new OrekitFixedStepHandler() {
        public void init(SpacecraftState s0, AbsoluteDate t) {
        }   
        public void handleStep(SpacecraftState currentState, boolean isLast) {
            list.add(new TimeStampedAngularCoordinates(currentState.getDate(),
                                                       currentState.getAttitude().getRotation(),
                                                       Vector3D.ZERO, Vector3D.ZERO));
        }
    });
    propagator.propagate(maxDate);
    return list;
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:21,代码来源:SensorMeanPlaneCrossingTest.java

示例13: createOrbit

import org.orekit.errors.OrekitException; //导入依赖的package包/类
private Orbit createOrbit(double mu)
    throws OrekitException {
    // the following orbital parameters have been computed using
    // Orekit tutorial about phasing, using the following configuration:
    //
    //  orbit.date                          = 2012-01-01T00:00:00.000
    //  phasing.orbits.number               = 143
    //  phasing.days.number                 =  10
    //  sun.synchronous.reference.latitude  = 0
    //  sun.synchronous.reference.ascending = false
    //  sun.synchronous.mean.solar.time     = 10:30:00
    //  gravity.field.degree                = 12
    //  gravity.field.order                 = 12
    AbsoluteDate date = new AbsoluteDate("2012-01-01T00:00:00.000", TimeScalesFactory.getUTC());
    Frame eme2000 = FramesFactory.getEME2000();
    return new CircularOrbit(7173352.811913891,
                             -4.029194321683225E-4, 0.0013530362644647786,
                             FastMath.toRadians(98.63218182243709),
                             FastMath.toRadians(77.55565567747836),
                             FastMath.PI, PositionAngle.TRUE,
                             eme2000, date, mu);
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:23,代码来源:RuggedBuilderTest.java

示例14: testPointAtLongitudeError

import org.orekit.errors.OrekitException; //导入依赖的package包/类
@Test
public void testPointAtLongitudeError() throws RuggedException, OrekitException {

    Vector3D p = new Vector3D(3220103.0, 69623.0, -6449822.0);
    double longitude = 1.25;
    Vector3D parallelToLongitudePlane = new Vector3D(FastMath.cos(longitude),
                                                     FastMath.sin(longitude),
                                                     -2.4);
    try {
        ellipsoid.pointAtLongitude(p, parallelToLongitudePlane, longitude);
        Assert.fail("an error should have been triggered");
    } catch (RuggedException re) {
        Assert.assertEquals(RuggedMessages.LINE_OF_SIGHT_NEVER_CROSSES_LONGITUDE, re.getSpecifier());
        Assert.assertEquals(FastMath.toDegrees(longitude), re.getParts()[0]);
    }

}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:18,代码来源:ExtendedEllipsoidTest.java

示例15: testPointAtLatitudeTwoPointsOppositeSides

import org.orekit.errors.OrekitException; //导入依赖的package包/类
@Test
public void testPointAtLatitudeTwoPointsOppositeSides() throws RuggedException, OrekitException {

    Vector3D p = new Vector3D(3220103.0, 69623.0, -6449822.0);
    Vector3D d = new Vector3D(1.0, 2.0, 0.1);
    double latitude = -0.5;

    Vector3D pPlus = ellipsoid.pointAtLatitude(p, d, latitude, new Vector3D(1, p, +2.0e7, d));
    GeodeticPoint gpPlus = ellipsoid.transform(pPlus, ellipsoid.getBodyFrame(), null);
    Assert.assertEquals(latitude, gpPlus.getLatitude(), 3.0e-16);
    Assert.assertEquals(20646364.047, Vector3D.dotProduct(d, pPlus.subtract(p)), 0.001);

    Vector3D pMinus = ellipsoid.pointAtLatitude(p, d, latitude, new Vector3D(1, p, -3.0e7, d));
    GeodeticPoint gpMinus = ellipsoid.transform(pMinus, ellipsoid.getBodyFrame(), null);
    Assert.assertEquals(latitude, gpMinus.getLatitude(), 3.0e-16);
    Assert.assertEquals(-31797895.234, Vector3D.dotProduct(d, pMinus.subtract(p)), 0.001);

}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:19,代码来源:ExtendedEllipsoidTest.java


注:本文中的org.orekit.errors.OrekitException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。