Skip to content
Snippets Groups Projects
Commit d4c9560f authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Merge branch 'Issue372' into develop

parents 330c3e1c 2352282b
No related branches found
No related tags found
No related merge requests found
Showing
with 1245 additions and 330 deletions
pipeline {
agent any
tools {
maven 'mvn-default'
jdk 'openjdk-8'
}
options {
timeout(time: 60, unit: 'MINUTES')
}
stages {
stage('Cleaning') {
steps {
sh 'git clean -fdx'
}
}
stage('Build') {
steps {
script {
if ( env.BRANCH_NAME ==~ /^release-[.0-9]+$/ ) {
sh 'mvn verify assembly:single'
}
else {
sh 'mvn verify site'
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
script {
if ( env.BRANCH_NAME ==~ /^release-[.0-9]+$/ ) {
archiveArtifacts artifacts: 'target/*.zip', fingerprint: true
}
}
checkstyle pattern: 'target/checkstyle-result.xml'
junit 'target/surefire-reports/*.xml'
jacoco execPattern:'target/**.exec', classPattern: '**/classes', sourcePattern: '**/src/main/java'
}
}
}
...@@ -87,9 +87,19 @@ ...@@ -87,9 +87,19 @@
<property name="checkFormat" value="NoWhitespaceAfter"/> <property name="checkFormat" value="NoWhitespaceAfter"/>
</module> </module>
<module name="SuppressionCommentFilter"> <module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop FallThrough check"/> <property name="offCommentFormat" value="CHECKSTYLE\: stop Indentation check"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume FallThrough check"/> <property name="onCommentFormat" value="CHECKSTYLE\: resume Indentation check"/>
<property name="checkFormat" value="FallThrough"/> <property name="checkFormat" value="IndentationCheck"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop MultipleStringLiterals check"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume MultipleStringLiterals check"/>
<property name="checkFormat" value="MultipleStringLiteralsCheck"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\: stop UnnecessaryParentheses check"/>
<property name="onCommentFormat" value="CHECKSTYLE\: resume UnnecessaryParentheses check"/>
<property name="checkFormat" value="UnnecessaryParentheses"/>
</module> </module>
</module> </module>
<module name="RegexpHeader"> <module name="RegexpHeader">
......
...@@ -18,32 +18,33 @@ ...@@ -18,32 +18,33 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<rugged.findbugs-maven-plugin.version>3.0.4</rugged.findbugs-maven-plugin.version> <rugged.spotbugs-maven-plugin.version>3.1.7</rugged.spotbugs-maven-plugin.version>
<rugged.jacoco-maven-plugin.version>0.7.9</rugged.jacoco-maven-plugin.version> <rugged.jacoco-maven-plugin.version>0.8.2</rugged.jacoco-maven-plugin.version>
<rugged.maven-assembly-plugin.version>3.0.0</rugged.maven-assembly-plugin.version> <rugged.maven-assembly-plugin.version>3.1.0</rugged.maven-assembly-plugin.version>
<rugged.maven-bundle-plugin.version>3.3.0</rugged.maven-bundle-plugin.version> <rugged.maven-bundle-plugin.version>4.1.0</rugged.maven-bundle-plugin.version>
<rugged.maven-changes-plugin.version>2.12.1</rugged.maven-changes-plugin.version> <rugged.maven-changes-plugin.version>2.12.1</rugged.maven-changes-plugin.version>
<rugged.maven-checkstyle-plugin.version>2.17</rugged.maven-checkstyle-plugin.version> <rugged.maven-checkstyle-plugin.version>3.0.0</rugged.maven-checkstyle-plugin.version>
<rugged.checkstyle.version>8.10</rugged.checkstyle.version> <rugged.checkstyle.version>8.14</rugged.checkstyle.version>
<rugged.maven-clean-plugin.version>3.0.0</rugged.maven-clean-plugin.version> <rugged.maven-clean-plugin.version>3.1.0</rugged.maven-clean-plugin.version>
<rugged.maven-compiler-plugin.version>3.6.1</rugged.maven-compiler-plugin.version> <rugged.maven-compiler-plugin.version>3.8.0</rugged.maven-compiler-plugin.version>
<rugged.maven-javadoc-plugin.version>2.10.4</rugged.maven-javadoc-plugin.version> <rugged.maven-javadoc-plugin.version>3.0.1</rugged.maven-javadoc-plugin.version>
<rugged.maven-jar-plugin.version>3.0.2</rugged.maven-jar-plugin.version> <rugged.maven-jar-plugin.version>3.1.0</rugged.maven-jar-plugin.version>
<rugged.maven-jxr-plugin.version>2.5</rugged.maven-jxr-plugin.version> <rugged.maven-jxr-plugin.version>3.0.0</rugged.maven-jxr-plugin.version>
<rugged.plantuml-maven-plugin.version>1.2</rugged.plantuml-maven-plugin.version> <rugged.plantuml-maven-plugin.version>1.2</rugged.plantuml-maven-plugin.version>
<rugged.plantuml.version>1.2017.15</rugged.plantuml.version> <rugged.plantuml.version>1.2018.12</rugged.plantuml.version>
<rugged.maven-project-info-reports-plugin.version>2.9</rugged.maven-project-info-reports-plugin.version> <rugged.maven-project-info-reports-plugin.version>3.0.0</rugged.maven-project-info-reports-plugin.version>
<rugged.maven-resources-plugin.version>3.0.2</rugged.maven-resources-plugin.version> <rugged.maven-resources-plugin.version>3.1.0</rugged.maven-resources-plugin.version>
<rugged.maven-site-plugin.version>3.6</rugged.maven-site-plugin.version> <rugged.maven-site-plugin.version>3.7.1</rugged.maven-site-plugin.version>
<rugged.maven-surefire-plugin.version>2.20</rugged.maven-surefire-plugin.version> <rugged.maven-source-plugin.version>3.0.1</rugged.maven-source-plugin.version>
<rugged.maven-surefire-report-plugin.version>2.20</rugged.maven-surefire-report-plugin.version> <rugged.maven-surefire-plugin.version>2.22.1</rugged.maven-surefire-plugin.version>
<rugged.maven-surefire-report-plugin.version>2.22.1</rugged.maven-surefire-report-plugin.version>
<rugged.jgit.buildnumber.version>1.2.10</rugged.jgit.buildnumber.version> <rugged.jgit.buildnumber.version>1.2.10</rugged.jgit.buildnumber.version>
<rugged.build-helper-maven-plugin.version>3.0.0</rugged.build-helper-maven-plugin.version> <rugged.build-helper-maven-plugin.version>3.0.0</rugged.build-helper-maven-plugin.version>
<rugged.nexus-staging-maven-plugin.version>1.6.8</rugged.nexus-staging-maven-plugin.version> <rugged.nexus-staging-maven-plugin.version>1.6.8</rugged.nexus-staging-maven-plugin.version>
<rugged.maven-gpg-plugin.version>1.6</rugged.maven-gpg-plugin.version> <rugged.maven-gpg-plugin.version>1.6</rugged.maven-gpg-plugin.version>
<rugged.maven-install-plugin.version>2.5.2</rugged.maven-install-plugin.version> <rugged.maven-install-plugin.version>3.0.0-M1</rugged.maven-install-plugin.version>
<rugged.orekit.version>9.2</rugged.orekit.version> <rugged.orekit.version>9.3-SNAPSHOT</rugged.orekit.version>
<rugged.hipparchus.version>1.3</rugged.hipparchus.version> <rugged.hipparchus.version>1.4</rugged.hipparchus.version>
<rugged.junit.version>4.12</rugged.junit.version> <rugged.junit.version>4.12</rugged.junit.version>
<rugged.compiler.source>1.8</rugged.compiler.source> <rugged.compiler.source>1.8</rugged.compiler.source>
<rugged.compiler.target>1.8</rugged.compiler.target> <rugged.compiler.target>1.8</rugged.compiler.target>
...@@ -129,10 +130,10 @@ ...@@ -129,10 +130,10 @@
</scm> </scm>
<issueManagement> <issueManagement>
<system>Redmine</system> <system>Gitlab</system>
<url>https://www.orekit.org/forge/projects/rugged/issues</url> <url>https://gitlab.orekit.org/orekit/rugged/issues</url>
</issueManagement> </issueManagement>
<mailingLists> <mailingLists>
<mailingList> <mailingList>
<name>Shared Orekit/Rugged announces mailing list</name> <name>Shared Orekit/Rugged announces mailing list</name>
...@@ -448,14 +449,14 @@ ...@@ -448,14 +449,14 @@
<version>${rugged.maven-project-info-reports-plugin.version}</version> <version>${rugged.maven-project-info-reports-plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>com.github.spotbugs</groupId>
<artifactId>findbugs-maven-plugin</artifactId> <artifactId>spotbugs-maven-plugin</artifactId>
<version>${rugged.findbugs-maven-plugin.version}</version> <version>${rugged.spotbugs-maven-plugin.version}</version>
<configuration> <configuration>
<threshold>Normal</threshold> <threshold>Normal</threshold>
<effort>Default</effort> <effort>Default</effort>
<excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile> <excludeFilterFile>${basedir}/spotbugs-exclude-filter.xml</excludeFilterFile>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
...@@ -584,6 +585,21 @@ ...@@ -584,6 +585,21 @@
<id>release</id> <id>release</id>
<build> <build>
<plugins> <plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${orekit.maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
......
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- <!--
This file contains some false positive bugs detected by findbugs. Their This file contains some false positive bugs detected by spotbugs. Their
false positive nature has been analyzed individually and they have been false positive nature has been analyzed individually and they have been
put here to instruct findbugs it must ignore them. put here to instruct findbugs it must ignore them.
--> -->
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<include>BUILDING.txt</include> <include>BUILDING.txt</include>
<include>pom.xml</include> <include>pom.xml</include>
<include>checkstyle.xml</include> <include>checkstyle.xml</include>
<include>findbugs-exclude-filter.xml</include> <include>spotbugs-exclude-filter.xml</include>
<include>license-header.txt</include> <include>license-header.txt</include>
</includes> </includes>
<useDefaultExcludes>true</useDefaultExcludes> <useDefaultExcludes>true</useDefaultExcludes>
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
<useDefaultExcludes>true</useDefaultExcludes> <useDefaultExcludes>true</useDefaultExcludes>
</fileSet> </fileSet>
</fileSets> </fileSets>
</assembly> </assembly>
\ No newline at end of file
This diff is collapsed.
...@@ -145,21 +145,21 @@ class Dump { ...@@ -145,21 +145,21 @@ class Dump {
/** Dump a direct location computation. /** Dump a direct location computation.
* @param date date of the location * @param date date of the location
* @param position pixel position in spacecraft frame * @param sensorPosition sensor position in spacecraft frame
* @param los normalized line-of-sight in spacecraft frame * @param los normalized line-of-sight in spacecraft frame
* @param lightTimeCorrection flag for light time correction * @param lightTimeCorrection flag for light time correction
* @param aberrationOfLightCorrection flag for aberration of light correction * @param aberrationOfLightCorrection flag for aberration of light correction
* @param refractionCorrection flag for refraction correction * @param refractionCorrection flag for refraction correction
* @exception RuggedException if date cannot be converted to UTC * @exception RuggedException if date cannot be converted to UTC
*/ */
public void dumpDirectLocation(final AbsoluteDate date, final Vector3D position, final Vector3D los, public void dumpDirectLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los,
final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection, final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection,
final boolean refractionCorrection) final boolean refractionCorrection)
throws RuggedException { throws RuggedException {
writer.format(Locale.US, writer.format(Locale.US,
"direct location: date %s position %22.15e %22.15e %22.15e los %22.15e %22.15e %22.15e lightTime %b aberration %b refraction %b %n", "direct location: date %s position %22.15e %22.15e %22.15e los %22.15e %22.15e %22.15e lightTime %b aberration %b refraction %b %n",
convertDate(date), convertDate(date),
position.getX(), position.getY(), position.getZ(), sensorPosition.getX(), sensorPosition.getY(), sensorPosition.getZ(),
los.getX(), los.getY(), los.getZ(), los.getX(), los.getY(), los.getZ(),
lightTimeCorrection, aberrationOfLightCorrection, refractionCorrection); lightTimeCorrection, aberrationOfLightCorrection, refractionCorrection);
} }
......
...@@ -135,19 +135,19 @@ public class DumpManager { ...@@ -135,19 +135,19 @@ public class DumpManager {
/** Dump a direct location computation. /** Dump a direct location computation.
* @param date date of the location * @param date date of the location
* @param position pixel position in spacecraft frame * @param sensorPosition sensor position in spacecraft frame
* @param los normalized line-of-sight in spacecraft frame * @param los normalized line-of-sight in spacecraft frame
* @param lightTimeCorrection flag for light time correction * @param lightTimeCorrection flag for light time correction
* @param aberrationOfLightCorrection flag for aberration of light correction * @param aberrationOfLightCorrection flag for aberration of light correction
* @param refractionCorrection flag for refraction correction * @param refractionCorrection flag for refraction correction
* @exception RuggedException if date cannot be converted to UTC * @exception RuggedException if date cannot be converted to UTC
*/ */
public static void dumpDirectLocation(final AbsoluteDate date, final Vector3D position, final Vector3D los, public static void dumpDirectLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los,
final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection, final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection,
final boolean refractionCorrection) final boolean refractionCorrection)
throws RuggedException { throws RuggedException {
if (isActive()) { if (isActive()) {
DUMP.get().dumpDirectLocation(date, position, los, lightTimeCorrection, aberrationOfLightCorrection, DUMP.get().dumpDirectLocation(date, sensorPosition, los, lightTimeCorrection, aberrationOfLightCorrection,
refractionCorrection); refractionCorrection);
} }
} }
......
...@@ -80,7 +80,9 @@ public enum RuggedMessages implements Localizable { ...@@ -80,7 +80,9 @@ public enum RuggedMessages implements Localizable {
DUPLICATED_PARAMETER_NAME("a different parameter with name {0} already exists"), DUPLICATED_PARAMETER_NAME("a different parameter with name {0} already exists"),
INVALID_RUGGED_NAME("invalid rugged name"), INVALID_RUGGED_NAME("invalid rugged name"),
UNSUPPORTED_REFINING_CONTEXT("refining using {0} rugged instance is not handled"), UNSUPPORTED_REFINING_CONTEXT("refining using {0} rugged instance is not handled"),
NO_LAYER_DATA("no atmospheric layer data at altitude {0} (lowest altitude: {1})"); NO_LAYER_DATA("no atmospheric layer data at altitude {0} (lowest altitude: {1})"),
INVALID_STEP("step {0} is not valid : {1}"),
INVALID_RANGE_FOR_LINES("range between min line {0} and max line {1} too small {2}");
// CHECKSTYLE: resume JavadocVariable check // CHECKSTYLE: resume JavadocVariable check
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
package org.orekit.rugged.linesensor; package org.orekit.rugged.linesensor;
import java.io.Serializable; import java.io.Serializable;
import java.text.NumberFormat;
import org.hipparchus.util.CompositeFormat;
/** Container for sensor pixel. /** Container for sensor pixel.
* <p> * <p>
...@@ -63,15 +60,4 @@ public class SensorPixel implements Serializable { ...@@ -63,15 +60,4 @@ public class SensorPixel implements Serializable {
public double getPixelNumber() { public double getPixelNumber() {
return pixelNumber; return pixelNumber;
} }
@Override
public String toString() {
final NumberFormat format = CompositeFormat.getDefaultNumberFormat();
format.setMaximumFractionDigits(6);
return "{Line: " +
format.format(getLineNumber()) +
" , Pixel: " +
format.format(getPixelNumber()) +
"}";
}
} }
/* Copyright 2013-2018 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.rugged.los;
import java.io.Serializable;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.rugged.linesensor.SensorPixel;
/** Container for pixel line-of-sight.
* @author Guylaine Prat
* @since 3.0
*/
public class PixelLOS implements Serializable {
/** Serializable UID. */
private static final long serialVersionUID = -6674056279573271367L;
/** Sensor pixel. */
private final SensorPixel sensorPixel;
/** Pixel line-of-sight in spacecraft frame. */
private final Vector3D los;
/**
* Build a new instance.
* @param sensorPixel the sensor pixel cell
* @param los the pixel line-of-sight in spacecraft frame
*/
public PixelLOS(final SensorPixel sensorPixel, final Vector3D los) {
this.sensorPixel = sensorPixel;
this.los = los;
}
/**
* @return the sensorPixel
*/
public SensorPixel getSensorPixel() {
return sensorPixel;
}
/**
* @return the lOS in spacecraft frame
*/
public Vector3D getLOS() {
return los;
}
}
/* Copyright 2013-2018 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.rugged.refraction;
import org.orekit.rugged.errors.RuggedException;
import org.orekit.rugged.errors.RuggedMessages;
import org.orekit.rugged.linesensor.LineSensor;
import org.orekit.rugged.utils.GridCreation;
/**
* Atmospheric refraction computation parameters.
* Defines for inverse location a set of parameters in order to be able to perform the computation.
* @author Guylaine Prat
* @since 3.0
*/
public class AtmosphericComputationParameters {
/** Margin for definition of the interpolation grid.
* To be inside the min line and max line range to avoid problem with inverse location grid computation. */
private static final int MARGIN_LINE = 10;
/** Default value for pixel step. */
private static final int DEFAULT_STEP_PIXEL = 100;
/** Default value for line step. */
private static final int DEFAULT_STEP_LINE = 100;
/** Actual values for pixel step in case default are overwritten. */
private int pixelStep;
/** Actual values for line step in case default are overwritten. */
private int lineStep;
// Definition of grids for sensor (u = along pixel; v = along line)
/** Linear grid in pixel. */
private double[] uGrid;
/** Linear grid in line. */
private double[] vGrid;
/** Size of uGrid = nbPixelGrid. */
private int nbPixelGrid;
/** Size of vGrid = nbLineGrid. */
private int nbLineGrid;
// Definition of the associated sensor
/** Current min line. */
private double minLineSensor = Double.NaN;
/** Current max line. */
private double maxLineSensor = Double.NaN;
/** Current sensor name. */
private String sensorName = null;
/**
* Default constructor.
*/
public AtmosphericComputationParameters() {
this.pixelStep = DEFAULT_STEP_PIXEL;
this.lineStep = DEFAULT_STEP_LINE;
}
/** Configuration of the interpolation grid. This grid is associated to the given sensor,
* with the given min and max lines.
* @param sensor line sensor
* @param minLine min line defined for the inverse location
* @param maxLine max line defined for the inverse location
* @throws RuggedException if invalid range for lines
*/
public void configureCorrectionGrid(final LineSensor sensor, final int minLine, final int maxLine) throws RuggedException {
// Keep information about the sensor and the required search lines.
// Needed to test if the grid is initialized with this context.
this.minLineSensor = minLine;
this.maxLineSensor = maxLine;
this.sensorName = sensor.getName();
// Compute the number of pixels and lines for the grid (round value is sufficient)
final int sensorNbPxs = sensor.getNbPixels();
this.nbPixelGrid = sensorNbPxs / this.pixelStep;
// check the validity of the min and max lines
if ((maxLine - minLine + 1 - 2 * MARGIN_LINE) < 2 * this.lineStep) {
final String info = ": (maxLine - minLine + 1 - 2*" + MARGIN_LINE + ") < 2*" + this.lineStep;
throw new RuggedException(RuggedMessages.INVALID_RANGE_FOR_LINES, minLine, maxLine, info);
}
this.nbLineGrid = (maxLine - minLine + 1 - 2 * MARGIN_LINE) / this.lineStep;
// CHECKSTYLE: stop UnnecessaryParentheses check
// Compute the linear grids in pixel (u index) and line (v index)
this.uGrid = GridCreation.createLinearGrid(0, (sensorNbPxs - 1), this.nbPixelGrid);
this.vGrid = GridCreation.createLinearGrid((minLine + MARGIN_LINE), (maxLine - MARGIN_LINE), this.nbLineGrid);
// CHECKSTYLE: resume UnnecessaryParentheses check
}
/**
* Set the grid steps in pixel and line (used to compute inverse location).
* Overwrite the default values, for time optimization if necessary.
* @param gridPixelStep grid pixel step for the inverse location computation
* @param gridLineStep grid line step for the inverse location computation
* @throws RuggedException if invalid steps
*/
public void setGridSteps(final int gridPixelStep, final int gridLineStep) throws RuggedException {
if (gridPixelStep <= 0) {
final String reason = " pixelStep <= 0";
throw new RuggedException(RuggedMessages.INVALID_STEP, gridPixelStep, reason);
}
if (gridLineStep <= 0) {
final String reason = " lineStep <= 0";
throw new RuggedException(RuggedMessages.INVALID_STEP, gridLineStep, reason);
}
this.pixelStep = gridPixelStep;
this.lineStep = gridLineStep;
}
/**
* @return the size of pixel grid
*/
public int getNbPixelGrid() {
return nbPixelGrid;
}
/**
* @return the size of line grid
*/
public int getNbLineGrid() {
return nbLineGrid;
}
/**
* @return the pixel grid
*/
public double[] getUgrid() {
return uGrid.clone();
}
/**
* @return the line grid
*/
public double[] getVgrid() {
return vGrid.clone();
}
/**
* @return the min line used to compute the current grids
*/
public double getMinLineSensor() {
return minLineSensor;
}
/**
* @return the max line used to compute the current grids
*/
public double getMaxLineSensor() {
return maxLineSensor;
}
/**
* @return the sensor name used to compute the current grids
*/
public String getSensorName() {
return sensorName;
}
}
/* Copyright 2013-2017 CS Systèmes d'Information /* Copyright 2013-2018 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more * Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
...@@ -16,18 +16,57 @@ ...@@ -16,18 +16,57 @@
*/ */
package org.orekit.rugged.refraction; package org.orekit.rugged.refraction;
import org.hipparchus.analysis.interpolation.BilinearInterpolatingFunction;
import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedException;
import org.orekit.rugged.errors.RuggedMessages;
import org.orekit.rugged.intersection.IntersectionAlgorithm; import org.orekit.rugged.intersection.IntersectionAlgorithm;
import org.orekit.rugged.linesensor.LineSensor;
import org.orekit.rugged.linesensor.SensorPixel;
import org.orekit.rugged.utils.NormalizedGeodeticPoint; import org.orekit.rugged.utils.NormalizedGeodeticPoint;
/** /**
* Interface for atmospheric refraction model. * Interface for atmospheric refraction model.
* @author Sergio Esteves * @author Sergio Esteves
* @author Guylaine Prat
* @since 2.0 * @since 2.0
*/ */
public interface AtmosphericRefraction { public abstract class AtmosphericRefraction {
/** Flag to tell if we must compute the correction.
* By default: computation is set up.
* @since 3.0
*/
private boolean mustBeComputed = true;
/** Flag to tell if we must compute the correction (for direct location) with an optimization grid.
* By default: optimization is not set up.
* @since 3.0
*/
private boolean isOptimized = false;
/** The current atmospheric parameters.
* @since 3.0
*/
private AtmosphericComputationParameters atmosphericParams;
/** Bilinear interpolating function for pixel (used by inverse location).
* @since 3.0
*/
private BilinearInterpolatingFunction bifPixel = null;
/** Bilinear interpolating function of line (used by inverse location).
* @since 3.0
*/
private BilinearInterpolatingFunction bifLine = null;
/**
* Default constructor.
*/
protected AtmosphericRefraction() {
// Set up the atmospheric parameters ... with lazy evaluation of the grid (done only if necessary)
this.atmosphericParams = new AtmosphericComputationParameters();
}
/** Apply correction to the intersected point with an atmospheric refraction model. /** Apply correction to the intersected point with an atmospheric refraction model.
* @param satPos satellite position, in <em>body frame</em> * @param satPos satellite position, in <em>body frame</em>
...@@ -37,10 +76,151 @@ public interface AtmosphericRefraction { ...@@ -37,10 +76,151 @@ public interface AtmosphericRefraction {
* @return corrected point with the effect of atmospheric refraction * @return corrected point with the effect of atmospheric refraction
* @throws RuggedException if there is no refraction data at altitude of rawIntersection or see * @throws RuggedException if there is no refraction data at altitude of rawIntersection or see
* {@link org.orekit.rugged.utils.ExtendedEllipsoid#pointAtAltitude(Vector3D, Vector3D, double)} or see * {@link org.orekit.rugged.utils.ExtendedEllipsoid#pointAtAltitude(Vector3D, Vector3D, double)} or see
* {@link IntersectionAlgorithm#refineIntersection(ExtendedEllipsoid, Vector3D, Vector3D, NormalizedGeodeticPoint)} * {@link org.orekit.rugged.intersection.IntersectionAlgorithm#refineIntersection(org.orekit.rugged.utils.ExtendedEllipsoid, Vector3D, Vector3D, NormalizedGeodeticPoint)}
*/ */
NormalizedGeodeticPoint applyCorrection(Vector3D satPos, Vector3D satLos, NormalizedGeodeticPoint rawIntersection, public abstract NormalizedGeodeticPoint applyCorrection(Vector3D satPos, Vector3D satLos, NormalizedGeodeticPoint rawIntersection,
IntersectionAlgorithm algorithm) IntersectionAlgorithm algorithm)
throws RuggedException; throws RuggedException;
/** Apply correction to the intersected point with an atmospheric refraction model,
* using a time optimized algorithm.
* @param lineSensor the line sensor
* @param sensorPixel the sensor pixel (must be defined)
* @param satPos satellite position, in <em>body frame</em>
* @param satLos sensor pixel line of sight, in <em>body frame</em>
* @param rawIntersection intersection point before refraction correction
* @param algorithm intersection algorithm
* @return corrected point with the effect of atmospheric refraction
* @throws RuggedException if there is no refraction data at altitude of rawIntersection or see
* {@link org.orekit.rugged.utils.ExtendedEllipsoid#pointAtAltitude(Vector3D, Vector3D, double)} or see
* {@link org.orekit.rugged.intersection.IntersectionAlgorithm#refineIntersection(org.orekit.rugged.utils.ExtendedEllipsoid, Vector3D, Vector3D, NormalizedGeodeticPoint)}
* @since 3.0
*/
public abstract NormalizedGeodeticPoint applyCorrection(LineSensor lineSensor, SensorPixel sensorPixel,
Vector3D satPos, Vector3D satLos, NormalizedGeodeticPoint rawIntersection,
IntersectionAlgorithm algorithm)
throws RuggedException;
/** Deactivate computation (needed for the inverse location computation).
* @since 3.0
*/
public void deactivateComputation() {
this.mustBeComputed = false;
}
/** Reactivate computation (needed for the inverse location computation).
* @since 3.0
*/
public void reactivateComputation() {
this.mustBeComputed = true;
}
/** Tell if the computation must be performed.
* @return true if computation must be performed; false otherwise
* @since 3.0
*/
public boolean mustBeComputed() {
return mustBeComputed;
}
/** Tell if the computation (for direct location) must be optimized.
* @return true if computation must be optimized; false otherwise
* @since 3.0
*/
public boolean isOptimized() {
return isOptimized;
}
/** Configuration of the interpolation grid. This grid is associated to the given sensor,
* with the given min and max lines.
* @param sensor line sensor
* @param minLine min line defined for the inverse location
* @param maxLine max line defined for the inverse location
* @throws RuggedException if invalid range for lines
*/
public void configureCorrectionGrid(final LineSensor sensor, final int minLine, final int maxLine) throws RuggedException {
atmosphericParams.configureCorrectionGrid(sensor, minLine, maxLine);
}
/** Check if the current atmospheric parameters are the same as the asked ones.
* @param sensorName the asked sensor name
* @param minLine the asked min line
* @param maxLine the asked max line
* @return true if same context; false otherwise
*/
public Boolean isSameContext(final String sensorName, final int minLine, final int maxLine) {
return (Double.compare(atmosphericParams.getMinLineSensor(), minLine) == 0) &&
(Double.compare(atmosphericParams.getMaxLineSensor(), maxLine) == 0) &&
(atmosphericParams.getSensorName().compareTo(sensorName) == 0);
}
/** Get the computation parameters.
* @return the AtmosphericComputationParameters
*/
public AtmosphericComputationParameters getComputationParameters() {
return atmosphericParams;
}
/** Set the grid steps in pixel and line (used to compute inverse location).
* Overwrite the default values, for time optimization for instance.
* @param pixelStep pixel step for the inverse location computation
* @param lineStep line step for the inverse location computation
* @throws RuggedException if invalid steps
*/
public void setGridSteps(final int pixelStep, final int lineStep) throws RuggedException {
atmosphericParams.setGridSteps(pixelStep, lineStep);
}
/** Compute the correction functions for pixel and lines.
* The corrections are computed for pixels and lines, on a regular grid at sensor level.
* The corrections are based on the difference on grid knots (where direct loc is known with atmosphere refraction)
* and the sensor pixel found by inverse loc without atmosphere refraction.
* The bilinear interpolating functions are then computed for pixel and for line.
* Need to be computed only once for a given sensor with the same minLine and maxLine.
* @param sensorPixelGridInverseWithout inverse location grid WITHOUT atmospheric refraction
* @throws RuggedException if invalid range for lines
*/
public void computeGridCorrectionFunctions(final SensorPixel[][] sensorPixelGridInverseWithout) throws RuggedException {
// Compute for a sensor grid, the associated ground grid, WITH atmospheric effect
// (for interpolations we need a regular grid)
// ==================================================================================
final int nbPixelGrid = atmosphericParams.getNbPixelGrid();
final int nbLineGrid = atmosphericParams.getNbLineGrid();
final double[] pixelGrid = atmosphericParams.getUgrid();
final double[] lineGrid = atmosphericParams.getVgrid();
final double[][] gridDiffPixel = new double[nbPixelGrid][nbLineGrid];
final double[][] gridDiffLine = new double[nbPixelGrid][nbLineGrid];
// Compute the difference between grids knots WITH - without atmosphere
for (int lineIndex = 0; lineIndex < nbLineGrid; lineIndex++) {
for (int pixelIndex = 0; pixelIndex < nbPixelGrid; pixelIndex++) {
if (sensorPixelGridInverseWithout[pixelIndex][lineIndex] != null) {
final double diffLine = lineGrid[lineIndex] - sensorPixelGridInverseWithout[pixelIndex][lineIndex].getLineNumber();
final double diffPixel = pixelGrid[pixelIndex] - sensorPixelGridInverseWithout[pixelIndex][lineIndex].getPixelNumber();
gridDiffPixel[pixelIndex][lineIndex] = diffPixel;
gridDiffLine[pixelIndex][lineIndex] = diffLine;
} else {
// Impossible to find the point in the given min line and max line
throw new RuggedException(RuggedMessages.INVALID_RANGE_FOR_LINES,
atmosphericParams.getMinLineSensor(), atmosphericParams.getMaxLineSensor(), "");
}
}
}
// Definition of the interpolating function for pixel and for line
this.bifPixel = new BilinearInterpolatingFunction(pixelGrid, lineGrid, gridDiffPixel);
this.bifLine = new BilinearInterpolatingFunction(pixelGrid, lineGrid, gridDiffLine);
}
public BilinearInterpolatingFunction getBifPixel() {
return bifPixel;
}
public BilinearInterpolatingFunction getBifLine() {
return bifLine;
}
} }
/* Copyright 2013-2017 CS Systèmes d'Information /* Copyright 2013-2018 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more * Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
...@@ -19,18 +19,19 @@ package org.orekit.rugged.refraction; ...@@ -19,18 +19,19 @@ package org.orekit.rugged.refraction;
/** /**
* Class that represents a constant refraction layer to be used with {@link MultiLayerModel}. * Class that represents a constant refraction layer to be used with {@link MultiLayerModel}.
* @author Sergio Esteves * @author Sergio Esteves
* @author Guylaine Prat
* @since 2.0 * @since 2.0
*/ */
public class ConstantRefractionLayer { public class ConstantRefractionLayer {
/** lowest altitude of this layer. */ /** lowest altitude of this layer (m). */
private final Double lowestAltitude; private final Double lowestAltitude;
/** refractive index of this layer. */ /** refractive index of this layer. */
private final double refractiveIndex; private final double refractiveIndex;
/** Simple constructor. /** Simple constructor.
* @param lowestAltitude lowest altitude of the layer * @param lowestAltitude lowest altitude of the layer (m)
* @param refractiveIndex refractive index of the layer * @param refractiveIndex refractive index of the layer
*/ */
public ConstantRefractionLayer(final double lowestAltitude, final double refractiveIndex) { public ConstantRefractionLayer(final double lowestAltitude, final double refractiveIndex) {
...@@ -38,12 +39,17 @@ public class ConstantRefractionLayer { ...@@ -38,12 +39,17 @@ public class ConstantRefractionLayer {
this.refractiveIndex = refractiveIndex; this.refractiveIndex = refractiveIndex;
} }
/**
* @return the lowest altitude of the layer (m)
*/
public double getLowestAltitude() { public double getLowestAltitude() {
return lowestAltitude; return lowestAltitude;
} }
/**
* @return the refractive index of the layer
*/
public double getRefractiveIndex() { public double getRefractiveIndex() {
return refractiveIndex; return refractiveIndex;
} }
} }
/* Copyright 2013-2018 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.rugged.utils;
/** Utility class for grids creation.
* @author Guylaine Prat
* @since 3.0
*/
public final class GridCreation {
/** Private constructor for utility class.
* Suppress default constructor for non instantiability ...
*/
private GridCreation() {
super();
}
/** Create a linear grid between min and max value for a number n of points.
* TBN: no checks are performed here. Must be done by the calling method.
* @param min value for grid[0]
* @param max value for grid[n-1]
* @param n number of points
* @return the linear grid
*/
public static double[] createLinearGrid(final double min, final double max, final int n) {
final double[] grid = new double[n];
for (int i = 0; i < n; ++i) {
grid[i] = ((n - 1 - i) * min + i * max) / (n - 1);
}
return grid;
}
}
...@@ -88,3 +88,8 @@ UNSUPPORTED_REFINING_CONTEXT = <MISSING TRANSLATION> ...@@ -88,3 +88,8 @@ UNSUPPORTED_REFINING_CONTEXT = <MISSING TRANSLATION>
# no atmospheric layer data at altitude {0} (lowest altitude: {1}) # no atmospheric layer data at altitude {0} (lowest altitude: {1})
NO_LAYER_DATA = ingen atsmosfæriske lagdata ved højden {0} (laveste højde: {1}) NO_LAYER_DATA = ingen atsmosfæriske lagdata ved højden {0} (laveste højde: {1})
# step {0} is not valid : {1}
INVALID_STEP = <MISSING TRANSLATION>
# range between min line {0} and max line {1} too small {2}
INVALID_RANGE_FOR_LINES = <MISSING TRANSLATION>
...@@ -87,3 +87,9 @@ UNSUPPORTED_REFINING_CONTEXT = <MISSING TRANSLATION> ...@@ -87,3 +87,9 @@ UNSUPPORTED_REFINING_CONTEXT = <MISSING TRANSLATION>
# no atmospheric layer data at altitude {0} (lowest altitude: {1}) # no atmospheric layer data at altitude {0} (lowest altitude: {1})
NO_LAYER_DATA = <MISSING TRANSLATION> NO_LAYER_DATA = <MISSING TRANSLATION>
# step {0} is not valid : {1}
INVALID_STEP = <MISSING TRANSLATION>
# range between min line {0} and max line {1} too small {2}
INVALID_RANGE_FOR_LINES = <MISSING TRANSLATION>
...@@ -87,3 +87,9 @@ UNSUPPORTED_REFINING_CONTEXT = refining using {0} rugged instance is not handled ...@@ -87,3 +87,9 @@ UNSUPPORTED_REFINING_CONTEXT = refining using {0} rugged instance is not handled
# no atmospheric layer data at altitude {0} (lowest altitude: {1}) # no atmospheric layer data at altitude {0} (lowest altitude: {1})
NO_LAYER_DATA = no atmospheric layer data at altitude {0} (lowest altitude: {1}) NO_LAYER_DATA = no atmospheric layer data at altitude {0} (lowest altitude: {1})
# step {0} is not valid : {1}
INVALID_STEP = step {0} is not valid : {1}
# range between min line {0} and max line {1} too small {2}
INVALID_RANGE_FOR_LINES = range between min line {0} and max line {1} too small {2}
...@@ -86,4 +86,10 @@ INVALID_RUGGED_NAME = el nombre no se considera válido para Rugged ...@@ -86,4 +86,10 @@ INVALID_RUGGED_NAME = el nombre no se considera válido para Rugged
UNSUPPORTED_REFINING_CONTEXT = no se puede refinar usando {0} instancias rugged UNSUPPORTED_REFINING_CONTEXT = no se puede refinar usando {0} instancias rugged
# no atmospheric layer data at altitude {0} (lowest altitude: {1}) # no atmospheric layer data at altitude {0} (lowest altitude: {1})
NO_LAYER_DATA = no hay datos de atmósfera para la altitud {0} (altitud mínima: {1}) NO_LAYER_DATA = no hay datos de atmósfera para la altitud {0} (altitud mínima: {1})
\ No newline at end of file
# step {0} is not valid : {1}
INVALID_STEP = <MISSING TRANSLATION>
# range between min line {0} and max line {1} too small {2}
INVALID_RANGE_FOR_LINES = <MISSING TRANSLATION>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment