Skip to content

Commit

Permalink
Updates with new subclassing strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
petrushy committed Nov 5, 2023
1 parent e16f8fa commit fbf8f1d
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 989 deletions.
149 changes: 13 additions & 136 deletions src/main/java/org/orekit/models/earth/PythonEarthShape.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,165 +60,42 @@ public void finalize()
/** Part of JCC Python interface to object */
public native void pythonDecRef();

/**
* Get the underlying ellipsoid model that defines latitude and longitude. If the
* height component of a {@link GeodeticPoint} is not needed,
* then using the ellipsoid will provide the quickest transformation.
*
* @return the reference ellipsoid. May be {@code this}, but never {@code null}.
*/
/** {@inheritDoc} */
@Override
public native ReferenceEllipsoid getEllipsoid();

/**
* Get body frame related to body shape.
*
* @return body frame related to body shape
*/
/** {@inheritDoc} */
@Override
public native Frame getBodyFrame();

/**
* Get the intersection point of a line with the surface of the body.
* <p>A line may have several intersection points with a closed
* surface (we consider the one point case as a degenerated two
* points case). The close parameter is used to select which of
* these points should be returned. The selected point is the one
* that is closest to the close point.</p>
*
* @param line test line (may intersect the body or not)
* @param close point used for intersections selection
* @param frame frame in which line is expressed
* @param date date of the line in given frame
* @return intersection point at altitude zero or null if the line does
* not intersect the surface
*/
@Override
public native GeodeticPoint getIntersectionPoint(Line line, Vector3D close, Frame frame, AbsoluteDate date);

/**
* Get the intersection point of a line with the surface of the body.
* <p>A line may have several intersection points with a closed
* surface (we consider the one point case as a degenerated two
* points case). The close parameter is used to select which of
* these points should be returned. The selected point is the one
* that is closest to the close point.</p>
*
* @param line test line (may intersect the body or not)
* @param close point used for intersections selection
* @param frame frame in which line is expressed
* @param date date of the line in given frame
* @return intersection point at altitude zero or null if the line does
* not intersect the surface
* @since 9.0
*/
@Override
public <T extends CalculusFieldElement<T>> FieldGeodeticPoint<T> getIntersectionPoint(FieldLine<T> line, FieldVector3D<T> close, Frame frame, FieldAbsoluteDate<T> date) {
return this.getIntersectionPoint_FFFF(line, close, frame, date);
}
public native <T extends CalculusFieldElement<T>> FieldGeodeticPoint<T> getIntersectionPoint(FieldLine<T> line, FieldVector3D<T> close, Frame frame, FieldAbsoluteDate<T> date);

public native <T extends CalculusFieldElement<T>> FieldGeodeticPoint<T> getIntersectionPoint_FFFF(FieldLine<T> line, FieldVector3D<T> close, Frame frame, FieldAbsoluteDate<T> date);

/**
* Project a point to the ground.
*
* @param point point to project
* @param date current date
* @param frame frame in which moving point is expressed
* @return ground point exactly at the local vertical of specified point,
* in the same frame as specified point
* @see #projectToGround(TimeStampedPVCoordinates, Frame)
* @since 7.0
*/
/** {@inheritDoc} */
@Override
public native Vector3D projectToGround(Vector3D point, AbsoluteDate date, Frame frame);

/**
* Project a moving point to the ground.
*
* @param pv moving point
* @param frame frame in which moving point is expressed
* @return ground point exactly at the local vertical of specified point,
* in the same frame as specified point
* @see #projectToGround(Vector3D, AbsoluteDate, Frame)
* @since 7.0
*/
/** {@inheritDoc} */
@Override
public TimeStampedPVCoordinates projectToGround(TimeStampedPVCoordinates pv, Frame frame) {
return this.projectToGround_TF(pv,frame);
}
public native TimeStampedPVCoordinates projectToGround(TimeStampedPVCoordinates pv, Frame frame);

public native TimeStampedPVCoordinates projectToGround_TF(TimeStampedPVCoordinates pv, Frame frame);

/**
* Transform a Cartesian point to a surface-relative point.
*
* @param point Cartesian point
* @param frame frame in which Cartesian point is expressed
* @param date date of the computation (used for frames conversions)
* @return point at the same location but as a surface-relative point
*/
/** {@inheritDoc} */
@Override
public native GeodeticPoint transform(Vector3D point, Frame frame, AbsoluteDate date);

/**
* Transform a Cartesian point to a surface-relative point.
*
* @param point Cartesian point
* @param frame frame in which Cartesian point is expressed
* @param date date of the computation (used for frames conversions)
* @return point at the same location but as a surface-relative point
* @since 9.0
*/
/** {@inheritDoc} */
@Override
public <T extends CalculusFieldElement<T>> FieldGeodeticPoint<T> transform(FieldVector3D<T> point, Frame frame, FieldAbsoluteDate<T> date) {
return this.transform_FFF(point,frame, date);
}
public native <T extends CalculusFieldElement<T>> FieldGeodeticPoint<T> transform(FieldVector3D<T> point, Frame frame, FieldAbsoluteDate<T> date);

/**
* Transform a surface-relative point to a Cartesian point.
*
* @param point surface-relative point
* @return point at the same location but as a Cartesian point
*/
/** {@inheritDoc} */
@Override
public Vector3D transform(GeodeticPoint point) {
return this.transform_G(point);
}
public native Vector3D transform(GeodeticPoint point);

/**
* Transform a Cartesian point to a surface-relative point.
*
* @param point Cartesian point
* @param frame frame in which Cartesian point is expressed
* @param date date of the computation (used for frames conversions)
* @return point at the same location but as a surface-relative point
* @since 9.0
*/

public native <T extends CalculusFieldElement<T>> FieldGeodeticPoint<T> transform_FFF(FieldVector3D<T> point, Frame frame, FieldAbsoluteDate<T> date);

/**
* Transform a surface-relative point to a Cartesian point.
*
* @param point surface-relative point
* @return point at the same location but as a Cartesian point
*/

public native Vector3D transform_G(GeodeticPoint point);

/**
* Transform a surface-relative point to a Cartesian point.
*
* @param point surface-relative point
* @return point at the same location but as a Cartesian point
* @since 9.0
*/
/** {@inheritDoc} */
@Override
public <T extends CalculusFieldElement<T>> FieldVector3D<T> transform(FieldGeodeticPoint<T> point) {
return this.transform_F(point);
}

public native <T extends CalculusFieldElement<T>> FieldVector3D<T> transform_F(FieldGeodeticPoint<T> point);
public native <T extends CalculusFieldElement<T>> FieldVector3D<T> transform(FieldGeodeticPoint<T> point);

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,92 +57,24 @@ public void finalize()
/** Part of JCC Python interface to object */
public native void pythonDecRef();

/**
* Get the frame of the central body.
*
* @return frame of the central body.
* @since 6.0
*/
/** {@inheritDoc} */
@Override
public native Frame getFrame();

/**
* Get the local density.
* Extension point for Python.
*
* @param date current date
* @param position current position in frame
* @param frame the frame in which is defined the position
* @return local density (kg/m³)
*/
/** {@inheritDoc} */
@Override
public native double getDensity(AbsoluteDate date, Vector3D position, Frame frame);

/**
* Get the local density.
* Redirects to getDensity_FFF
*
* @param date current date
* @param position current position in frame
* @param frame the frame in which is defined the position
* @return local density (kg/m³)
*/
/** {@inheritDoc} */
@Override
public <T extends CalculusFieldElement<T>> T getDensity(FieldAbsoluteDate<T> date, FieldVector3D<T> position, Frame frame) {
return this.getDensity_FFF(date, position, frame);
}

public native <T extends CalculusFieldElement<T>> T getDensity(FieldAbsoluteDate<T> date, FieldVector3D<T> position, Frame frame);

/**
* Get the local density.
* Extension point for Python.
*
* @param date current date
* @param position current position in frame
* @param frame the frame in which is defined the position
* @return local density (kg/m³)
*/
public native <T extends CalculusFieldElement<T>> T getDensity_FFF(FieldAbsoluteDate<T> date, FieldVector3D<T> position, Frame frame);


/**
* Get the inertial velocity of atmosphere molecules.
* Extension point for Python.
*
* <p>By default, atmosphere is supposed to have a null
* velocity in the central body frame.</p>
*
* @param date current date
* @param position current position in frame
* @param frame the frame in which is defined the position
* @return velocity (m/s) (defined in the same frame as the position)
*/
/** {@inheritDoc} */
@Override
public native Vector3D getVelocity(AbsoluteDate date, Vector3D position, Frame frame);

/**
* Get the inertial velocity of atmosphere molecules.
* Redirects to getVelocity_FFF(...)
*
* @param date current date
* @param position current position in frame
* @param frame the frame in which is defined the position
* @return velocity (m/s) (defined in the same frame as the position)
*/
/** {@inheritDoc} */
@Override
public <T extends CalculusFieldElement<T>> FieldVector3D<T> getVelocity(FieldAbsoluteDate<T> date, FieldVector3D<T> position, Frame frame) {
return this.getVelocity_FFF(date, position, frame);
}

/**
* Get the inertial velocity of atmosphere molecules.
* Extension point for Python.
*
* @param date current date
* @param position current position in frame
* @param frame the frame in which is defined the position
* @return velocity (m/s) (defined in the same frame as the position)
*/
public native <T extends CalculusFieldElement<T>> FieldVector3D<T> getVelocity_FFF(FieldAbsoluteDate<T> date, FieldVector3D<T> position, Frame frame);
public native <T extends CalculusFieldElement<T>> FieldVector3D<T> getVelocity(FieldAbsoluteDate<T> date, FieldVector3D<T> position, Frame frame);

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,83 +55,24 @@ public void finalize()
/** Part of JCC Python interface to object */
public native void pythonDecRef();

/**
* Calculates the ionospheric path delay for the signal path from a ground
* station to a satellite.
* <p>
* This method is intended to be used for orbit determination issues.
* In that respect, if the elevation is below 0° the path delay will be equal to zero.
* </p><p>
* For individual use of the ionospheric model (i.e. not for orbit determination), another
* method signature can be implemented to compute the path delay for any elevation angle.
* </p>
*
* @param state spacecraft state
* @param baseFrame base frame associated with the station
* @param frequency frequency of the signal in Hz
* @param parameters ionospheric model parameters
* @return the path delay due to the ionosphere in m
*/
/** {@inheritDoc} */
@Override
public double pathDelay(SpacecraftState state, TopocentricFrame baseFrame, double frequency, double[] parameters) {
return this.pathDelay_STdd(state, baseFrame, frequency, parameters);
}

public native double pathDelay_STdd(SpacecraftState state, TopocentricFrame baseFrame, double frequency, double[] parameters);


public native double pathDelay(SpacecraftState state, TopocentricFrame baseFrame, double frequency, double[] parameters);


/**
* Calculates the ionospheric path delay for the signal path from a ground
* station to a satellite.
* <p>
* This method is intended to be used for orbit determination issues.
* In that respect, if the elevation is below 0° the path delay will be equal to zero.
* </p><p>
* For individual use of the ionospheric model (i.e. not for orbit determination), another
* method signature can be implemented to compute the path delay for any elevation angle.
* </p>
*
* @param state spacecraft state
* @param baseFrame base frame associated with the station
* @param frequency frequency of the signal in Hz
* @param parameters ionospheric model parameters
* @return the path delay due to the ionosphere in m
*/
/** {@inheritDoc} */
@Override
public <T extends CalculusFieldElement<T>> T pathDelay(FieldSpacecraftState<T> state, TopocentricFrame baseFrame, double frequency, T[] parameters) {
return this.pathDelay_FTdT(state, baseFrame, frequency, parameters);
}
public native <T extends CalculusFieldElement<T>> T pathDelay(FieldSpacecraftState<T> state, TopocentricFrame baseFrame, double frequency, T[] parameters);

public native <T extends CalculusFieldElement<T>> T pathDelay_FTdT(FieldSpacecraftState<T> state, TopocentricFrame baseFrame, double frequency, T[] parameters);

/**
* Get the drivers for ionospheric model parameters.
*
* @return drivers for ionospheric model parameters
*/
/** {@inheritDoc} */
@Override
public native List<ParameterDriver> getParametersDrivers();

/**
* Get ionospheric model parameters.
*
* @return ionospheric model parameters
*/
/** {@inheritDoc} */
@Override
public native double[] getParameters();

/**
* Get ionospheric model parameters.
*
* @param field field to which the elements belong
* @return ionospheric model parameters
*/
/** {@inheritDoc} */
@Override
public <T extends CalculusFieldElement<T>> T[] getParameters(Field<T> field) {
return this.getParameters_F(field);
}
public native <T extends CalculusFieldElement<T>> T[] getParameters(Field<T> field);

public native <T extends CalculusFieldElement<T>> T[] getParameters_F(Field<T> field);
}
Loading

0 comments on commit fbf8f1d

Please sign in to comment.