diff --git a/.CI/README b/.CI/README new file mode 100644 index 0000000000000000000000000000000000000000..457c6ee3ebf080e149a211a73db41acbc55f2af4 --- /dev/null +++ b/.CI/README @@ -0,0 +1 @@ +A directory for Continuous Integration tooling. \ No newline at end of file diff --git a/.CI/maven-settings.xml b/.CI/maven-settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..09b19e135b63526013b65a2cb697ace4d5033c93 --- /dev/null +++ b/.CI/maven-settings.xml @@ -0,0 +1,63 @@ +<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xsi:schemalocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + <mirrors> + <!-- mirror + | Specifies a repository mirror site to use instead of a given repository. The repository that + | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used + | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. + | + <mirror> + <id>mirrorId</id> + <mirrorOf>repositoryId</mirrorOf> + <name>Human Readable Name for this Mirror.</name> + <url>http://my.repository.com/repo/path</url> + </mirror> + --> + <mirror> + <id>Nexus-Rugged</id> + <name>Maven Repository Manager</name> + <!-- Share the same Nexus repository as Orekit --> + <url>https://packages.orekit.org/repository/maven-public/</url> + <mirrorOf>*</mirrorOf> + </mirror> + </mirrors> + <servers> + <server> + <id>ci-releases</id> + <username>${env.NEXUS_USERNAME}</username> + <password>${env.NEXUS_PASSWORD}</password> + </server> + <server> + <id>ci-snapshots</id> + <username>${env.NEXUS_USERNAME}</username> + <password>${env.NEXUS_PASSWORD}</password> + </server> + <server> + <id>website</id> + <privateKey>${user.home}/.ssh/id_website</privateKey> + </server> + </servers> + <profiles> + <profile> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <repositories> + <repository> + <id>Nexus-Rugged</id> + <name>Nexus Public Repository</name> + <!-- Share the same Nexus repository as Orekit --> + <url>https://packages.orekit.org/repository/maven-public/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + </snapshots> + </repository> + </repositories> + </profile> + </profiles> +</settings> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..c7c79b498e2e7812da283ad2976ae3201f95c75f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,78 @@ +stages: +- verify +- deploy + +default: + # Default image + image: registry.orekit.org/orekit/ci-utils/maven:3.3.9-jdk-8 + # Cache downloaded dependencies and plugins between builds. + # To keep cache across branches add 'key: "$CI_JOB_REF_NAME"' + cache: + paths: + - .m2/repository + +variables: + # This will supress any download for dependencies and plugins or upload messages which would clutter the console log. + # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work. + MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" + # As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used + # when running from the command line. + # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins. + MAVEN_CLI_OPTS: "-s .CI/maven-settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" + +verify: + stage: verify + script: + - mvn $MAVEN_CLI_OPTS verify site + - mvn $MAVEN_CLI_OPTS sonar:sonar -Dsonar.login=${SONAR_TOKEN} -Dsonar.branch.name=${CI_COMMIT_REF_NAME} + artifacts: + paths: + - target/*.jar + - target/site + reports: + junit: + - target/surefire-reports/*.xml + +# On main branches (develop, release-*, master) +# the produced artifacts are deployed on the Nexus of the project +# (https://packages.orekit.org/) +deploy:artifacts: + stage: deploy + script: + - mvn $MAVEN_CLI_OPTS javadoc:jar source:jar deploy -DskipTests=true -Pci-deploy + artifacts: + paths: + - target/*.jar + only: + - develop@orekit/rugged + - /^release-[.0-9]+$/@orekit/rugged + - master@orekit/rugged + + +deploy:site: + stage: deploy + before_script: + ## + ## Create the SSH directory and give it the right permissions + ## + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + + ## + ## We're using tr to fix line endings which makes ed25519 keys work + ## without extra base64 encoding. + ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556 + ## + - echo "$SSH_SECRET_KEY" > ~/.ssh/id_website + - chmod 700 ~/.ssh/id_website + + ## + ## Add known hosts + ## + - cp $SSH_KNOWN_HOSTS ~/.ssh/known_hosts + script: + - mvn $MAVEN_CLI_OPTS site:deploy + only: + - master@orekit/rugged + - /^release-[.0-9]+$/@orekit/rugged + - develop@orekit/rugged diff --git a/BUILDING.txt b/BUILDING.txt deleted file mode 100644 index cfd8dbbc2df1c1974aedefbcf96cc27bc9b15115..0000000000000000000000000000000000000000 --- a/BUILDING.txt +++ /dev/null @@ -1,26 +0,0 @@ -Rugged can be built from source either using maven 3 or eclipse. - -Building with Maven 3: - - Maven 3 can be downloaded here: - http://maven.apache.org/download.html - - If you are behind a proxy (which is a traditional - setting in a corporate environment), then you need - to configure maven to use it. This is explained - in the maven documentation here: - http://maven.apache.org/guides/mini/guide-proxies.html - - run "mvn package" to automatically download all - the required dependencies listed in the pom.xml file - and create a file named target/rugged-x.y.jar where - x.y is the version number - -Building with Eclipse: - - Eclipse can be downloaded here: - http://www.eclipse.org/downloads/ - - using your operating system tools, unpack the source distribution directly - inside your Eclipse workspace - - using Eclipse, import the project by selecting in the top level "File" menu - the entry "Import..." - - in the wizard that should appear, select "Maven -> Existing Maven Projects" - - select the folder you just created in your workspace by unpacking the - source distribution. The "pom.xml" file describing the project will be - automatically selected. Click finish diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 69e40fdf3ea7dfbeacc20b49b7b4a27007e9b17e..0000000000000000000000000000000000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,50 +0,0 @@ -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 - } - } - junit testResults: '**/target/surefire-reports/*.xml' - jacoco execPattern:'target/**.exec', classPattern: '**/classes', sourcePattern: '**/src/main/java' - recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()] - recordIssues enabledForFailure: true, tool: checkStyle() - recordIssues enabledForFailure: true, tool: spotBugs() - } - } -} diff --git a/NOTICE.txt b/NOTICE.txt index 3ab722542a0cd55c15513e6214857f13aa43a63d..b65e6c654d78ebf3e973e85ca146437c851335e3 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,11 +1,11 @@ RUGGED -Copyright 2013-2019 CS Systèmes d'Information +Copyright 2013-2020 CS GROUP This product includes software developed by -CS Systèmes d'Information (http://www.c-s.fr/) +CS GROUP (http://www.c-s.fr/) This product depends on software developed by The Apache Software Foundation (http://www.apache.org/) This product depends on software developed by -The Hipparchus project (https://hipparchus.org/) \ No newline at end of file +The Hipparchus project (https://hipparchus.org/) diff --git a/README.txt b/README.txt deleted file mode 100644 index ee17ceee9840f70799c9ed3c038bb052543b02c2..0000000000000000000000000000000000000000 --- a/README.txt +++ /dev/null @@ -1,34 +0,0 @@ -Rugged, a sensor-to-terrain mapping tool, is a free java library -for geolocation and used for satellite imagery. - -It is licensed by CS Systèmes d'Information under the -Apache License Version 2.0. A copy of this license is -provided in the LICENSE.txt file. - -The BUILDING.txt file explains how the library can be built from sources. - -The src/main/java directory contains the library sources. -The src/main/resources directory contains the library data. -The src/test/java directory contains the tests sources. -The src/test/resources directory contains the tests data. -The src/tutorials/java directory contains sources for example use of the library. -The src/design directory contains pieces for a UML model of the library. - -Rugged relies on the following free software, all released under -business friendly free licenses. - -compile-time/run-time dependency: - - - Orekit from CS Systèmes d'Information - https://www.orekit.org/ - released under the Apache Software License, version 2 - - - Hipparchus from the Hipparchus project - https://hipparchus.org/ - released under the Apache Software License, version 2 - -test-time dependency: - - - JUnit 4 from Erich Gamma and Kent Beck - http://www.junit.org/ - released under the Common Public License Version 1.0 diff --git a/Readme.md b/Readme.md index 56ca011b1c9ab15a42c6fd36094d834ecdf6ff44..f5cc611486b655abd9d4e5c6b0456d776f18c2c6 100644 --- a/Readme.md +++ b/Readme.md @@ -1,29 +1,12 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information - Licensed 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. ---> - -<h1 style="color:blue;" align="center"> - Rugged -</h1> -<h1> - <img src="src/site/resources/images/rugged-logo-small.jpg" alt="Rugged"/> - A sensor-to-terrain mapping tool -</h1> - -<h4 align="center">Rugged is a free java library for geolocation and used for satellite imagery.</h4> - -Rugged is an add-on for [Orekit](https://www.orekit.org/ "Orekit homepage") handling Digital Elevation Models contribution to -line of sight computation. It is a free software intermediate-level library written in Java. + + +# Rugged + +> A sensor-to-terrain mapping tool + +[Rugged](https://www.orekit.org/rugged/ "Rugged homepage") is a free java library for geolocation and used for satellite imagery. + +Rugged is an add-on for [Orekit](https://www.orekit.org/ "Orekit homepage") handling Digital Elevation Models contribution to line of sight computation. It is a free software intermediate-level library written in Java. It mainly provides direct and inverse location, i.e. it allows to compute accurately which ground point is looked at from a specific pixel in a spacecraft instrument, @@ -38,4 +21,78 @@ ground and sensor is computed with a viewing model taking into account: Direct and inverse location can be used to perform full ortho-rectification of images and correlation between sensors observing the same area. -Homepage: [www.orekit.org/rugged/](https://www.orekit.org/rugged/ "Rugged homepage") + +[](https://sonar.orekit.org/dashboard?id=org.orekit%3Arugged) +[](https://sonar.orekit.org/component_measures?id=org.orekit%3Arugged&metric=coverage&view=treemap) + +## Download + +### Official releases + +[Official Rugged releases](https://gitlab.orekit.org/orekit/rugged/-/releases) +are available on our [Gitlab instance](https://gitlab.orekit.org/). They are +also available in the +[Maven repository](https://mvnrepository.com/artifact/org.orekit/rugged). + +### Development version + +To get the latest development version, please clone our official repository +and checkout the `develop` branch: + +```bash +git clone -b develop https://gitlab.orekit.org/orekit/rugged.git +``` +__Note:__ Our official repository is +[mirrored on Github](https://github.com/CS-SI/Rugged). + +## Documentation + +Project overview, architecture and development, detailed features list, +Javadoc and a lot of other information is available on the +[Maven site](https://www.orekit.org/site-rugged-development/). + +## Getting help + +The main communication channel is our [forum](https://forum.orekit.org/). You +can report bugs and suggest new features in our +[issues tracking system](https://gitlab.orekit.org/orekit/rugged/-/issues). When +reporting security issues check the "This issue is confidential" box. + +## Contributing + +Please take a look at our +[contributing guidelines](https://www.orekit.org/site-rugged-latest/contributing.html) if you're +interested in helping! + +## Building + +Detailed information on how to build Rugged from source either using Maven or +Eclipse is provided in [building](https://www.orekit.org/site-rugged-latest/building.html) explanations. + +## Dependencies + +Rugged relies on the following +[FOSS](https://en.wikipedia.org/wiki/Free_and_open-source_software) libraries, +all released under business friendly FOSS licenses. + +### Compile-time/run-time dependencies + +* [Orekit](https://www.orekit.org/), a low level space dynamics library released under + the Apache License, version 2.0. + +* [Hipparchus](https://hipparchus.org/), a mathematics library released under + the Apache License, version 2.0. + +### Test-time dependencies + +* [JUnit 4](http://www.junit.org/), a widely used unit test framework released + under the Eclipse Public License, version 1.0. + +More detailed information is available in the +[Maven site](https://www.orekit.org/site-rugged-development/dependencies.html). + +## License + +Rugged is licensed by [CS GROUP](https://www.c-s.fr/) under +the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). +A copy of this license is provided in the [LICENSE.txt](LICENSE.txt) file. diff --git a/checkstyle.xml b/checkstyle.xml index 7fc65ee528ab744db95b38dbad022ac812bc301b..b6b597bb92298099adfcfd27638bc5dbd4274731 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -34,8 +34,6 @@ <property name="caseIndent" value="4"/> </module> <module name="JavadocMethod"> - <property name="allowUndeclaredRTE" value="true"/> - <property name="allowMissingPropertyJavadoc" value="true"/> <property name="validateThrows" value="false"/> </module> <module name="JavadocStyle"/> @@ -96,15 +94,12 @@ <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 name="RegexpHeader"> <property name="headerFile" value="${checkstyle.header.file}" /> </module> <module name="FileTabCharacter"/> - <module name="NewlineAtEndOfFile"/> + <module name="NewlineAtEndOfFile"> + <property name="lineSeparator" value="LF_CR_CRLF"/> + </module> </module> diff --git a/pom.xml b/pom.xml index a7802b6fc98ac0d20ee2ef6dac1b2436d4c69d94..45b79a53f7a93fddf18764a1f3a63659ed150894 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.orekit</groupId> <artifactId>rugged</artifactId> - <version>2.1</version> + <version>2.2</version> <packaging>jar</packaging> <name>Rugged</name> <url>https://www.orekit.org/rugged</url> @@ -19,8 +19,7 @@ <!-- COTS version --> - <rugged.orekit.version>9.3.1</rugged.orekit.version> - <rugged.hipparchus.version>1.4</rugged.hipparchus.version> + <rugged.orekit.version>10.2</rugged.orekit.version> <rugged.junit.version>4.12</rugged.junit.version> <!-- Compilers and Tools version --> @@ -28,30 +27,34 @@ <rugged.compiler.target>1.8</rugged.compiler.target> <rugged.implementation.build>${git.revision}; ${maven.build.timestamp}</rugged.implementation.build> + <!-- sonar related properties --> + <sonar.host.url>https://sonar.orekit.org/</sonar.host.url> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <rugged.spotbugs-maven-plugin.version>3.1.7</rugged.spotbugs-maven-plugin.version> - <rugged.jacoco-maven-plugin.version>0.8.2</rugged.jacoco-maven-plugin.version> - <rugged.maven-assembly-plugin.version>3.1.0</rugged.maven-assembly-plugin.version> - <rugged.maven-bundle-plugin.version>4.1.0</rugged.maven-bundle-plugin.version> + <rugged.spotbugs-maven-plugin.version>4.0.4</rugged.spotbugs-maven-plugin.version> + <rugged.jacoco-maven-plugin.version>0.8.5</rugged.jacoco-maven-plugin.version> + <rugged.maven-bundle-plugin.version>4.2.1</rugged.maven-bundle-plugin.version> <rugged.maven-changes-plugin.version>2.12.1</rugged.maven-changes-plugin.version> - <rugged.maven-checkstyle-plugin.version>3.0.0</rugged.maven-checkstyle-plugin.version> - <rugged.checkstyle.version>8.14</rugged.checkstyle.version> + <rugged.maven-checkstyle-plugin.version>3.1.1</rugged.maven-checkstyle-plugin.version> + <rugged.checkstyle.version>8.33</rugged.checkstyle.version> <rugged.maven-clean-plugin.version>3.1.0</rugged.maven-clean-plugin.version> - <rugged.maven-compiler-plugin.version>3.8.0</rugged.maven-compiler-plugin.version> - <rugged.maven-javadoc-plugin.version>3.0.1</rugged.maven-javadoc-plugin.version> - <rugged.maven-jar-plugin.version>3.1.0</rugged.maven-jar-plugin.version> + <rugged.maven-compiler-plugin.version>3.8.1</rugged.maven-compiler-plugin.version> + <rugged.maven-javadoc-plugin.version>3.2.0</rugged.maven-javadoc-plugin.version> + <rugged.maven-jar-plugin.version>3.2.0</rugged.maven-jar-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.version>1.2018.12</rugged.plantuml.version> - <rugged.maven-project-info-reports-plugin.version>3.0.0</rugged.maven-project-info-reports-plugin.version> + <rugged.plantuml.version>1.2020.14</rugged.plantuml.version> + <rugged.maven-project-info-reports-plugin.version>3.1.0</rugged.maven-project-info-reports-plugin.version> <rugged.maven-resources-plugin.version>3.1.0</rugged.maven-resources-plugin.version> - <rugged.maven-site-plugin.version>3.7.1</rugged.maven-site-plugin.version> - <rugged.maven-source-plugin.version>3.0.1</rugged.maven-source-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.maven-site-plugin.version>3.9.1</rugged.maven-site-plugin.version> + <rugged.maven-source-plugin.version>3.2.1</rugged.maven-source-plugin.version> + <!-- Surefire 2.22.2 is the last to support CentOS/RedHat 7 due to + https://issues.apache.org/jira/browse/SUREFIRE-1628 --> + <rugged.maven-surefire-plugin.version>2.22.2</rugged.maven-surefire-plugin.version> + <rugged.maven-surefire-report-plugin.version>3.0.0-M5</rugged.maven-surefire-report-plugin.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.2.0</rugged.build-helper-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-install-plugin.version>3.0.0-M1</rugged.maven-install-plugin.version> @@ -118,7 +121,7 @@ </contributors> <organization> - <name>CS Systèmes d'Information</name> + <name>CS GROUP</name> <url>http://www.c-s.fr/</url> </organization> @@ -142,9 +145,9 @@ <distributionManagement> <site> - <id>rugged.website</id> + <id>website</id> <name>Rugged Website</name> - <url>https://www.orekit.org/rugged/</url> + <url>scp://cochise@spoutnik.orekit.org/var/www/mvn-sites/site-rugged-${project.version}</url> </site> </distributionManagement> @@ -156,28 +159,6 @@ <type>jar</type> <optional>false</optional> </dependency> - <dependency> - <groupId>org.hipparchus</groupId> - <artifactId>hipparchus-core</artifactId> - <version>${rugged.hipparchus.version}</version> - <type>jar</type> - <optional>false</optional> - </dependency> - <dependency> - <groupId>org.hipparchus</groupId> - <artifactId>hipparchus-geometry</artifactId> - <version>${rugged.hipparchus.version}</version> - <type>jar</type> - <optional>false</optional> - </dependency> - <dependency> - <groupId>org.hipparchus</groupId> - <artifactId>hipparchus-stat</artifactId> - <version>${rugged.hipparchus.version}</version> - <type>jar</type> - <optional>false</optional> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -214,17 +195,6 @@ </archive> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-assembly-plugin</artifactId> - <version>${rugged.maven-assembly-plugin.version}</version> - <configuration> - <descriptors> - <descriptor>src/main/assembly/source-distribution-assembly.xml</descriptor> - <descriptor>src/main/assembly/source-jar-assembly.xml</descriptor> - </descriptors> - </configuration> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> @@ -339,6 +309,13 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>${rugged.maven-site-plugin.version}</version> + <dependencies> + <dependency><!-- add support for ssh/scp --> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + <version>3.3.4</version> + </dependency> + </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -390,7 +367,7 @@ </archive> <manifestLocation>${project.build.directory}/osgi</manifestLocation> <instructions> - <Export-Package>org.orekit.rugged.api.*;version=${project.version};-noimport:=true</Export-Package> + <Export-Package>org.orekit.rugged.*;version=${project.version};-noimport:=true</Export-Package> <Bundle-DocURL>${project.url}</Bundle-DocURL> </instructions> </configuration> @@ -477,6 +454,9 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-changes-plugin</artifactId> <version>${rugged.maven-changes-plugin.version}</version> + <configuration> + <teamlist>team.html</teamlist> + </configuration> <reportSets> <reportSet> <reports> @@ -491,7 +471,7 @@ <version>${rugged.maven-jxr-plugin.version}</version> <configuration> <linkJavadoc>false</linkJavadoc> - <bottom><![CDATA[Copyright © ${project.inceptionYear}-{currentYear} <a href="http://www.c-s.fr">CS Systèmes d'information</a>. All rights reserved.]]></bottom> + <bottom><![CDATA[Copyright © ${project.inceptionYear}-{currentYear} <a href="http://www.c-s.fr">CS GROUP</a>. All rights reserved.]]></bottom> </configuration> </plugin> <plugin> @@ -499,12 +479,14 @@ <artifactId>maven-javadoc-plugin</artifactId> <version>${rugged.maven-javadoc-plugin.version}</version> <configuration> - <bottom><![CDATA[Copyright © ${project.inceptionYear}-{currentYear} <a href="http://www.c-s.fr">CS Systèmes d'information</a>. All rights reserved.]]></bottom> + <bottom><![CDATA[Copyright © ${project.inceptionYear}-{currentYear} <a href="http://www.c-s.fr">CS GROUP</a>. All rights reserved.]]></bottom> <links> <link>https://docs.oracle.com/javase/8/docs/api/</link> <link>https://www.hipparchus.org/apidocs/</link> <link>https://www.orekit.org/site-orekit-${rugged.orekit.version}/apidocs/</link> </links> + <source>${rugged.compiler.source}</source> + <doclint>none</doclint> </configuration> <reportSets> <reportSet> @@ -567,6 +549,16 @@ </profile> <profile> <id>release</id> + <!-- distributionManagement> + <repository> + <id>ossrh</id> + <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> + </repository> + <snapshotRepository> + <id>ossrh</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement--> <build> <plugins> <plugin> @@ -636,6 +628,7 @@ <gpgArguments> <arg>--digest-algo=SHA512</arg> </gpgArguments> + <!-- keyname>0802AB8C87B0B1AEC1C1C5871550FDBD6375C33B</keyname--> </configuration> <executions> <execution> @@ -658,6 +651,20 @@ </plugins> </build> </profile> + <profile> + <!-- A profile to configure staging deployment (for continuous integration process) --> + <id>ci-deploy</id> + <distributionManagement> + <repository> + <id>ci-releases</id> + <url>https://packages.orekit.org/repository/maven-releases/</url> + </repository> + <snapshotRepository> + <id>ci-snapshots</id> + <url>https://packages.orekit.org/repository/maven-snapshots/</url> + </snapshotRepository> + </distributionManagement> + </profile> <profile> <id>eclipse</id> <activation> diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 34bc2525d2a65ee055e77de30a42b9c53f9d56c2..5796e6fcf688346b6fb7b20eaa062a45ad44eb3f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- Copyright 2013-2019 CS Systèmes d'Information - Licensed to CS Systèmes d'Information (CS) under one or more +<!-- Copyright 2013-2020 CS GROUP + Licensed to CS GROUP (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 @@ -20,6 +20,52 @@ <title>Rugged Changes</title> </properties> <body> + <release version="2.2" date="2020-07-31" description="This is a minor release. + It adds access to algorithm identifier, + corrects an Earth constant for model IERS96, + improves documentation and fixes a few bugs. + Automatic building, release and code analysis are available with Gitlab CI. + This version depends on Orekit 10.2 and Hipparchus 1.7."> + <action dev="guylaine" type="update" issue="383"> + Updated dependencies to Orekit 10.2 (and Hipparchus 1.7). + </action> + <action dev="guylaine" type="fix" issue="384"> + Add connection with Gitlab CI to allow automatic building and release, + as well as automatic code analysis (https://sonar.orekit.org/dashboard?id=org.orekit%3Arugged). + </action> + <action dev="luc" type="fix" issue="386"> + Fix a unit test due to CI specificity. + </action> + <action dev="guylaine" type="update" issue="381"> + Give access to algorithm identifier (DUVENHAGE, + CONSTANT_ELEVATION_OVER_ELLIPSOID, ...) with the new method getAlgorithmId(). + </action> + <action dev="guylaine" type="update" issue="385"> + Use the new Derivative<T> interface from Hipparchus. + </action> + <action dev="guylaine" type="fix" issue="379"> + Correct erroneous Earth flattening for model IERS96 in RuggedBuilder. + </action> + <action dev="guylaine" type="update" issue="378"> + Replace in RuggedBuilder hard-coded constants by Orekit Earth constants. + </action> + <action dev="guylaine" type="update"> + Update building explanations in static site and remove redundant BUILDING.txt. + </action> + <action dev="guylaine" type="add"> + Create a release guide in static site. + </action> + <action dev="guylaine" type="update"> + Update deprecated method of Orekit DataProvidersManager class. + </action> + <action dev="guylaine" type="update" issue="382"> + Remove explicit dependency to Hipparchus library. + </action> + <action dev="guylaine" type="add"> + Add package-info documentation. + </action> + </release> + <release version="2.1" date="2019-03-14" description="This is a minor release. It adds refraction in inverse location and fixes a few bugs. This version depends on Orekit 9.3.1 and Hipparchus 1.4."> @@ -100,9 +146,8 @@ <action dev="guylaine" type="add" due-to="Jonathan Guinet, Lucie Labat-Allée"> Added refinement feature, to adjust viewing model parameters </action> - <action dev="luc" type="add" due-to="Lars Næsbye Christensen"> + <action dev="luc" type="add" due-to="Lars Næsbye Christensen" issue="343"> Added Danish translations. - Fixes issue #343. </action> <action dev="luc" type="update"> Updated dependency to Hipparchus 1.1, released on 2017, March 16th. diff --git a/src/design/dem-loading-class-diagram.puml b/src/design/dem-loading-class-diagram.puml index 360ba2320e6d3f90d52bd462c3c6f17bb658a07c..4aadee43391a28c9b43026ca4aac3b0a399ced65 100644 --- a/src/design/dem-loading-class-diagram.puml +++ b/src/design/dem-loading-class-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/direct-location-class-diagram.puml b/src/design/direct-location-class-diagram.puml index 345691fba32960f492ad90e3e9f6c5f5c2da42f8..0357175139e83e015c78d6ae5695a71d8f33a15a 100644 --- a/src/design/direct-location-class-diagram.puml +++ b/src/design/direct-location-class-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/direct-location-sequence-diagram.puml b/src/design/direct-location-sequence-diagram.puml index dd2e5f18ad3fb046e99a7995e236659b853ced66..0a77382a083c6e212fc471f7e398a88966fe62d8 100644 --- a/src/design/direct-location-sequence-diagram.puml +++ b/src/design/direct-location-sequence-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/duvenhage-inner-recursion-activity-diagram.puml b/src/design/duvenhage-inner-recursion-activity-diagram.puml index d7ea4581f16daf14edf257a205ab4caf81ac02e4..ee90b3635d5e888234b2e7d2ccd305970f2647b5 100644 --- a/src/design/duvenhage-inner-recursion-activity-diagram.puml +++ b/src/design/duvenhage-inner-recursion-activity-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/duvenhage-top-loop-activity-diagram.puml b/src/design/duvenhage-top-loop-activity-diagram.puml index 25772bb1788aac3261ab90d17fce375a84053365..2eee57f5130594ee8e5647e83b5275f6e560694c 100644 --- a/src/design/duvenhage-top-loop-activity-diagram.puml +++ b/src/design/duvenhage-top-loop-activity-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/initialization-class-diagram.puml b/src/design/initialization-class-diagram.puml index f13e184c759a0af9ec66cd3da0e1530f5cb2a3d7..a46655221f6d44d4940fcdc04859866f53adae95 100644 --- a/src/design/initialization-class-diagram.puml +++ b/src/design/initialization-class-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/initialization-sequence-diagram.puml b/src/design/initialization-sequence-diagram.puml index d9259e5ea383fce6fbd952df92362e2b1ae96c1a..a56b664f3c3ca3da15356f036fa154ed85f077e2 100644 --- a/src/design/initialization-sequence-diagram.puml +++ b/src/design/initialization-sequence-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/inverse-location-sequence-diagram.puml b/src/design/inverse-location-sequence-diagram.puml index 8f7eb05cbd0ef2ddf672fdd8292b810184e968c8..32c31713c46acf5f0acba70b8ea1387dff7ecdaa 100644 --- a/src/design/inverse-location-sequence-diagram.puml +++ b/src/design/inverse-location-sequence-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/design/parametric-los-class-diagram.puml b/src/design/parametric-los-class-diagram.puml index f75085512a2fbaa603bedf14e275f9515fbf1916..c0eaf26013a53670b3239348f49f2119e689a2af 100644 --- a/src/design/parametric-los-class-diagram.puml +++ b/src/design/parametric-los-class-diagram.puml @@ -1,5 +1,5 @@ -' Copyright 2013-2019 CS Systèmes d'Information -' Licensed to CS Systèmes d'Information (CS) under one or more +' Copyright 2013-2020 CS GROUP +' Licensed to CS GROUP (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 diff --git a/src/main/assembly/source-distribution-assembly.xml b/src/main/assembly/source-distribution-assembly.xml deleted file mode 100644 index c7f81d8b88bc8dfa23c5c9b0e9ab14ef1d51de83..0000000000000000000000000000000000000000 --- a/src/main/assembly/source-distribution-assembly.xml +++ /dev/null @@ -1,25 +0,0 @@ -<assembly> - <id>sources</id> - <formats> - <format>zip</format> - </formats> - <fileSets> - <fileSet> - <includes> - <include>README.txt</include> - <include>LICENSE.txt</include> - <include>NOTICE.txt</include> - <include>BUILDING.txt</include> - <include>pom.xml</include> - <include>checkstyle.xml</include> - <include>spotbugs-exclude-filter.xml</include> - <include>license-header.txt</include> - </includes> - <useDefaultExcludes>true</useDefaultExcludes> - </fileSet> - <fileSet> - <directory>src</directory> - <useDefaultExcludes>true</useDefaultExcludes> - </fileSet> - </fileSets> -</assembly> diff --git a/src/main/assembly/source-jar-assembly.xml b/src/main/assembly/source-jar-assembly.xml deleted file mode 100644 index b79e54ba06f83954e5ad14b26095f2f6f844347d..0000000000000000000000000000000000000000 --- a/src/main/assembly/source-jar-assembly.xml +++ /dev/null @@ -1,24 +0,0 @@ -<assembly> - <id>sources</id> - <formats> - <format>jar</format> - </formats> - <includeBaseDirectory>false</includeBaseDirectory> - <fileSets> - <fileSet> - <includes> - <include>LICENSE.txt</include> - <include>NOTICE.txt</include> - </includes> - <outputDirectory>META-INF</outputDirectory> - </fileSet> - <fileSet> - <directory>src/main/java</directory> - <outputDirectory>.</outputDirectory> - <includes> - <include>**/*.java</include> - </includes> - <useDefaultExcludes>true</useDefaultExcludes> - </fileSet> - </fileSets> -</assembly> diff --git a/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java b/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java index bddfcd96406a0580f383b4aebda1bd14bd1fe255..eac5284cf9a3927da2908737b84ceaf2e21ff3d4 100644 --- a/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java +++ b/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java index 51d3f62d5b1381fd25adb36fe894d84afe11c17f..ec9c758d51204f1173054fd1cdff99c07365274d 100644 --- a/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -21,7 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Gradient; import org.hipparchus.linear.Array2DRowRealMatrix; import org.hipparchus.linear.ArrayRealVector; import org.hipparchus.linear.RealMatrix; @@ -162,7 +162,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder for (final SensorToGroundMapping reference : this.sensorToGroundMappings) { for (final Map.Entry<SensorPixel, GeodeticPoint> mapping : reference.getMapping()) { final GeodeticPoint gp = mapping.getValue(); - final DerivativeStructure[] ilResult = this.rugged.inverseLocationDerivatives(reference.getSensorName(), gp, minLine, maxLine, this.getGenerator()); + final Gradient[] ilResult = this.rugged.inverseLocationDerivatives(reference.getSensorName(), gp, minLine, maxLine, this.getGenerator()); if (ilResult == null) { value.setEntry(l, minLine - 100.0); // arbitrary diff --git a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java index 7083a59b2fc1d2353ef7fb45e3654148e853ca58..4f6b98308a3df3297a4ce9fbac54a38af11df927 100644 --- a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -24,7 +24,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Gradient; import org.hipparchus.linear.Array2DRowRealMatrix; import org.hipparchus.linear.ArrayRealVector; import org.hipparchus.linear.RealMatrix; @@ -207,7 +207,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB final SpacecraftToObservedBody scToBodyA = ruggedA.getScToBody(); - final DerivativeStructure[] ilResult = + final Gradient[] ilResult = ruggedB.distanceBetweenLOSderivatives(lineSensorA, dateA, pixelA, scToBodyA, lineSensorB, dateB, pixelB, this.getGenerator()); diff --git a/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java b/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java index cbd228353c42049433f429517d091f0efc6dd44f..9c893db88a749ef346439484ad5c7fdde10932f2 100644 --- a/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java +++ b/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java index 15891ca950a6715373b5fec67cdb9f43fdcf341b..1dd9945076f6ff4c88170f67045aec3fe29ee375 100644 --- a/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -24,8 +24,9 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.hipparchus.analysis.differentiation.DSFactory; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.Field; +import org.hipparchus.analysis.differentiation.Gradient; +import org.hipparchus.analysis.differentiation.GradientField; import org.hipparchus.optim.ConvergenceChecker; import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem; import org.hipparchus.optim.nonlinear.vector.leastsquares.MultivariateJacobianFunction; @@ -34,7 +35,7 @@ import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.linesensor.LineSensor; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.utils.ParameterDriver; /** @@ -51,8 +52,8 @@ abstract class OptimizationProblemBuilder { /** Margin used in parameters estimation for the inverse location lines range. */ protected static final int ESTIMATION_LINE_RANGE_MARGIN = 100; - /** Derivative structure generator.*/ - private final DSGenerator generator; + /** Gradient generator.*/ + private final DerivativeGenerator<Gradient> generator; /** Parameter drivers list. */ private final List<ParameterDriver> drivers; @@ -151,11 +152,11 @@ abstract class OptimizationProblemBuilder { return validator; } - /** Create the generator for {@link DerivativeStructure} instances. + /** Create the generator for {@link Gradient} instances. * @param selectedSensors list of sensors referencing the parameters drivers * @return a new generator */ - private DSGenerator createGenerator(final List<LineSensor> selectedSensors) { + private DerivativeGenerator<Gradient> createGenerator(final List<LineSensor> selectedSensors) { // Initialize set of drivers name final Set<String> names = new HashSet<>(); @@ -188,10 +189,9 @@ abstract class OptimizationProblemBuilder { }); } - final DSFactory factory = new DSFactory(map.size(), 1); - - // Derivative Structure Generator - return new DSGenerator() { + // gradient Generator + final GradientField field = GradientField.getField(map.size()); + return new DerivativeGenerator<Gradient>() { /** {@inheritDoc} */ @Override @@ -201,21 +201,27 @@ abstract class OptimizationProblemBuilder { /** {@inheritDoc} */ @Override - public DerivativeStructure constant(final double value) { - return factory.constant(value); + public Gradient constant(final double value) { + return Gradient.constant(map.size(), value); } /** {@inheritDoc} */ @Override - public DerivativeStructure variable(final ParameterDriver driver) { - + public Gradient variable(final ParameterDriver driver) { final Integer index = map.get(driver.getName()); if (index == null) { return constant(driver.getValue()); } else { - return factory.variable(index.intValue(), driver.getValue()); + return Gradient.variable(map.size(), index.intValue(), driver.getValue()); } } + + /** {@inheritDoc} */ + @Override + public Field<Gradient> getField() { + return field; + } + }; } @@ -245,7 +251,7 @@ abstract class OptimizationProblemBuilder { * Get the derivative structure generator. * @return the derivative structure generator. */ - protected final DSGenerator getGenerator() { + protected final DerivativeGenerator<Gradient> getGenerator() { return this.generator; } diff --git a/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java b/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java index 30ad99bda7d8813e28bf92980a0d540751fdc64e..3be925295f3412a4105486d1663583c9c3780285 100644 --- a/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java +++ b/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java b/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java index 09ed8dfed9cb574b8737ff1f6c5f7933ca289881..418e06cb5a59c596898c1c74f70d591ecad54429 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java index cc9719a3f1b21042ef64943a727ade2f2d7e7865..64b290b35041a91f4948c283f0e72ab39678bd19 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java index 6a2aa0a410e7bb853d0c9c2fd4bb6cd7daa8b60a..8962a9f221e5e70edb2ee032aed18019ea49e7d6 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java index 3c360c52aecb3a7146ac8c5b0597dbfda24a70d0..f5d950fe4237f3a1d73fd80e4e1a46cb3e3bbbf4 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/package-info.java b/src/main/java/org/orekit/rugged/adjustment/measurements/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..f4cdf80af18638375177a962def144075029b83a --- /dev/null +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/package-info.java @@ -0,0 +1,27 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides tools for measurements generation. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * @author Jonathan Guinet + * @author Lucie Labat-Allee + * + */ +package org.orekit.rugged.adjustment.measurements; diff --git a/src/main/java/org/orekit/rugged/adjustment/package-info.java b/src/main/java/org/orekit/rugged/adjustment/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..04bef2dd1398c701a3ee136b1d0d5f1ec814cdf7 --- /dev/null +++ b/src/main/java/org/orekit/rugged/adjustment/package-info.java @@ -0,0 +1,26 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides tools to deal with viewing model refining. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * @author Jonathan Guinet + * + */ +package org.orekit.rugged.adjustment; diff --git a/src/main/java/org/orekit/rugged/api/AlgorithmId.java b/src/main/java/org/orekit/rugged/api/AlgorithmId.java index e5128966944e4ffee5fac2063b50b536242587c1..1669b0a7e26d8242ef4d470e2bdd4e0cc047806f 100644 --- a/src/main/java/org/orekit/rugged/api/AlgorithmId.java +++ b/src/main/java/org/orekit/rugged/api/AlgorithmId.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/api/BodyRotatingFrameId.java b/src/main/java/org/orekit/rugged/api/BodyRotatingFrameId.java index fc6b0954908f2a77e0865457c85200c854d4f64c..ab8fa1fc8ec7009dbddea21045a74be827ba1351 100644 --- a/src/main/java/org/orekit/rugged/api/BodyRotatingFrameId.java +++ b/src/main/java/org/orekit/rugged/api/BodyRotatingFrameId.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/api/EllipsoidId.java b/src/main/java/org/orekit/rugged/api/EllipsoidId.java index 56976ceec6af8b491b6b0687e42c772be1b12596..d0ddbd1ac65ac447553b9aabead6579de4858cec 100644 --- a/src/main/java/org/orekit/rugged/api/EllipsoidId.java +++ b/src/main/java/org/orekit/rugged/api/EllipsoidId.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/api/InertialFrameId.java b/src/main/java/org/orekit/rugged/api/InertialFrameId.java index e5ca74d969a36da58818cc5ee3d8a07a5b38803a..bc7680307ea1566a3e30fdbe004cdbe50ca012f8 100644 --- a/src/main/java/org/orekit/rugged/api/InertialFrameId.java +++ b/src/main/java/org/orekit/rugged/api/InertialFrameId.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index b7207f9bb3f1e70b70dcd25983556a8209d021ed..6e767b1737f4b1fd7d6298e8eb9c48b0f5705def 100644 --- a/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/src/main/java/org/orekit/rugged/api/Rugged.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -20,10 +20,12 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; +import org.hipparchus.util.MathArrays; import org.orekit.bodies.GeodeticPoint; import org.orekit.frames.Transform; import org.orekit.rugged.errors.DumpManager; @@ -36,7 +38,7 @@ import org.orekit.rugged.linesensor.SensorMeanPlaneCrossing; import org.orekit.rugged.linesensor.SensorPixel; import org.orekit.rugged.linesensor.SensorPixelCrossing; import org.orekit.rugged.refraction.AtmosphericRefraction; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.NormalizedGeodeticPoint; import org.orekit.rugged.utils.SpacecraftToObservedBody; @@ -166,6 +168,14 @@ public class Rugged { return algorithm; } + /** Get the DEM intersection algorithm identifier. + * @return DEM intersection algorithm Id + * @since 2.2 + */ + public AlgorithmId getAlgorithmId() { + return algorithm.getAlgorithmId(); + } + /** Get flag for light time correction. * @return true if the light time between ground and spacecraft is * compensated for more accurate location @@ -944,6 +954,7 @@ public class Rugged { } /** Compute distances between two line sensors with derivatives. + * @param <T> derivative type * @param sensorA line sensor A * @param dateA current date for sensor A * @param pixelA pixel index for sensor A @@ -955,11 +966,11 @@ public class Rugged { * @return distances computed, with derivatives, between LOS and to the ground * @see #distanceBetweenLOS(LineSensor, AbsoluteDate, double, SpacecraftToObservedBody, LineSensor, AbsoluteDate, double) */ - public DerivativeStructure[] distanceBetweenLOSderivatives( + public <T extends Derivative<T>> T[] distanceBetweenLOSderivatives( final LineSensor sensorA, final AbsoluteDate dateA, final double pixelA, final SpacecraftToObservedBody scToBodyA, final LineSensor sensorB, final AbsoluteDate dateB, final double pixelB, - final DSGenerator generator) { + final DerivativeGenerator<T> generator) { // Compute the approximate transforms between spacecraft and observed body // from Rugged instance A @@ -973,59 +984,63 @@ public class Rugged { final Transform transformScToBodyB = new Transform(dateB, scToInertB, inertToBodyB); // Get sensors LOS into local frame - final FieldVector3D<DerivativeStructure> vALocal = sensorA.getLOSDerivatives(dateA, pixelA, generator); - final FieldVector3D<DerivativeStructure> vBLocal = sensorB.getLOSDerivatives(dateB, pixelB, generator); + final FieldVector3D<T> vALocal = sensorA.getLOSDerivatives(dateA, pixelA, generator); + final FieldVector3D<T> vBLocal = sensorB.getLOSDerivatives(dateB, pixelB, generator); // Get sensors LOS into body frame - final FieldVector3D<DerivativeStructure> vA = transformScToBodyA.transformVector(vALocal); // V_a : line of sight's vectorA - final FieldVector3D<DerivativeStructure> vB = transformScToBodyB.transformVector(vBLocal); // V_b : line of sight's vectorB + final FieldVector3D<T> vA = transformScToBodyA.transformVector(vALocal); // V_a : line of sight's vectorA + final FieldVector3D<T> vB = transformScToBodyB.transformVector(vBLocal); // V_b : line of sight's vectorB // Position of sensors into local frame final Vector3D sAtmp = sensorA.getPosition(); final Vector3D sBtmp = sensorB.getPosition(); - final DerivativeStructure scaleFactor = FieldVector3D.dotProduct(vA.normalize(), vA.normalize()); // V_a.V_a=1 + final T scaleFactor = FieldVector3D.dotProduct(vA.normalize(), vA.normalize()); // V_a.V_a=1 // Build a vector from the position and a scale factor (equals to 1). // The vector built will be scaleFactor * sAtmp for example. - final FieldVector3D<DerivativeStructure> sALocal = new FieldVector3D<DerivativeStructure>(scaleFactor, sAtmp); - final FieldVector3D<DerivativeStructure> sBLocal = new FieldVector3D<DerivativeStructure>(scaleFactor, sBtmp); + final FieldVector3D<T> sALocal = new FieldVector3D<>(scaleFactor, sAtmp); + final FieldVector3D<T> sBLocal = new FieldVector3D<>(scaleFactor, sBtmp); // Get sensors position into body frame - final FieldVector3D<DerivativeStructure> sA = transformScToBodyA.transformPosition(sALocal); // S_a : sensorA 's position - final FieldVector3D<DerivativeStructure> sB = transformScToBodyB.transformPosition(sBLocal); // S_b : sensorB 's position + final FieldVector3D<T> sA = transformScToBodyA.transformPosition(sALocal); // S_a : sensorA 's position + final FieldVector3D<T> sB = transformScToBodyB.transformPosition(sBLocal); // S_b : sensorB 's position // Compute distance - final FieldVector3D<DerivativeStructure> vBase = sB.subtract(sA); // S_b - S_a - final DerivativeStructure svA = FieldVector3D.dotProduct(vBase, vA); // SV_a = (S_b - S_a).V_a - final DerivativeStructure svB = FieldVector3D.dotProduct(vBase, vB); // SV_b = (S_b - S_a).V_b + final FieldVector3D<T> vBase = sB.subtract(sA); // S_b - S_a + final T svA = FieldVector3D.dotProduct(vBase, vA); // SV_a = (S_b - S_a).V_a + final T svB = FieldVector3D.dotProduct(vBase, vB); // SV_b = (S_b - S_a).V_b - final DerivativeStructure vAvB = FieldVector3D.dotProduct(vA, vB); // V_a.V_b + final T vAvB = FieldVector3D.dotProduct(vA, vB); // V_a.V_b // Compute lambda_b = (SV_a * V_a.V_b - SV_b) / (1 - (V_a.V_b)²) - final DerivativeStructure lambdaB = (svA.multiply(vAvB).subtract(svB)).divide(vAvB.multiply(vAvB).subtract(1).negate()); + final T lambdaB = (svA.multiply(vAvB).subtract(svB)).divide(vAvB.multiply(vAvB).subtract(1).negate()); // Compute lambda_a = SV_a + lambdaB * V_a.V_b - final DerivativeStructure lambdaA = vAvB.multiply(lambdaB).add(svA); + final T lambdaA = vAvB.multiply(lambdaB).add(svA); // Compute vector M_a: - final FieldVector3D<DerivativeStructure> mA = sA.add(vA.scalarMultiply(lambdaA)); // M_a = S_a + lambda_a * V_a + final FieldVector3D<T> mA = sA.add(vA.scalarMultiply(lambdaA)); // M_a = S_a + lambda_a * V_a // Compute vector M_b - final FieldVector3D<DerivativeStructure> mB = sB.add(vB.scalarMultiply(lambdaB)); // M_b = S_b + lambda_b * V_b + final FieldVector3D<T> mB = sB.add(vB.scalarMultiply(lambdaB)); // M_b = S_b + lambda_b * V_b // Compute vector M_a -> M_B for which distance between LOS is minimum - final FieldVector3D<DerivativeStructure> vDistanceMin = mB.subtract(mA); // M_b - M_a + final FieldVector3D<T> vDistanceMin = mB.subtract(mA); // M_b - M_a // Compute vector from mid point of vector M_a -> M_B to the ground (corresponds to minimum elevation) - final FieldVector3D<DerivativeStructure> midPoint = (mB.add(mA)).scalarMultiply(0.5); + final FieldVector3D<T> midPoint = (mB.add(mA)).scalarMultiply(0.5); // Get the euclidean norms to compute the minimum distances: // between LOS - final DerivativeStructure dMin = vDistanceMin.getNorm(); + final T dMin = vDistanceMin.getNorm(); // to the ground - final DerivativeStructure dCentralBody = midPoint.getNorm(); + final T dCentralBody = midPoint.getNorm(); + + final T[] ret = MathArrays.buildArray(dMin.getField(), 2); + ret[0] = dMin; + ret[1] = dCentralBody; + return ret; - return new DerivativeStructure[] {dMin, dCentralBody}; } @@ -1066,22 +1081,22 @@ public class Rugged { } /** Inverse location of a point with derivatives. + * @param <T> derivative type * @param sensorName name of the line sensor * @param point point to localize * @param minLine minimum line number * @param maxLine maximum line number - * @param generator generator to use for building {@link DerivativeStructure} instances + * @param generator generator to use for building {@link Derivative} instances * @return sensor pixel seeing point with derivatives, or null if point cannot be seen between the * prescribed line numbers * @see #inverseLocation(String, GeodeticPoint, int, int) * @since 2.0 */ - - public DerivativeStructure[] inverseLocationDerivatives(final String sensorName, - final GeodeticPoint point, - final int minLine, - final int maxLine, - final DSGenerator generator) { + public <T extends Derivative<T>> T[] inverseLocationDerivatives(final String sensorName, + final GeodeticPoint point, + final int minLine, + final int maxLine, + final DerivativeGenerator<T> generator) { final LineSensor sensor = getLineSensor(sensorName); @@ -1109,37 +1124,39 @@ public class Rugged { // fix line by considering the closest pixel exact position and line-of-sight // (this pixel might point towards a direction slightly above or below the mean sensor plane) final int lowIndex = FastMath.max(0, FastMath.min(sensor.getNbPixels() - 2, (int) FastMath.floor(coarsePixel))); - final FieldVector3D<DerivativeStructure> lowLOS = + final FieldVector3D<T> lowLOS = sensor.getLOSDerivatives(crossingResult.getDate(), lowIndex, generator); - final FieldVector3D<DerivativeStructure> highLOS = sensor.getLOSDerivatives(crossingResult.getDate(), lowIndex + 1, generator); - final FieldVector3D<DerivativeStructure> localZ = FieldVector3D.crossProduct(lowLOS, highLOS).normalize(); - final DerivativeStructure beta = FieldVector3D.dotProduct(crossingResult.getTargetDirection(), localZ).acos(); - final DerivativeStructure s = FieldVector3D.dotProduct(crossingResult.getTargetDirectionDerivative(), localZ); - final DerivativeStructure minusBetaDer = s.divide(s.multiply(s).subtract(1).negate().sqrt()); - final DerivativeStructure deltaL = beta.subtract(0.5 * FastMath.PI) .divide(minusBetaDer); - final DerivativeStructure fixedLine = deltaL.add(crossingResult.getLine()); - final FieldVector3D<DerivativeStructure> fixedDirection = - new FieldVector3D<DerivativeStructure>(deltaL.getField().getOne(), crossingResult.getTargetDirection(), - deltaL, crossingResult.getTargetDirectionDerivative()).normalize(); + final FieldVector3D<T> highLOS = sensor.getLOSDerivatives(crossingResult.getDate(), lowIndex + 1, generator); + final FieldVector3D<T> localZ = FieldVector3D.crossProduct(lowLOS, highLOS).normalize(); + final T beta = FieldVector3D.dotProduct(crossingResult.getTargetDirection(), localZ).acos(); + final T s = FieldVector3D.dotProduct(crossingResult.getTargetDirectionDerivative(), localZ); + final T minusBetaDer = s.divide(s.multiply(s).subtract(1).negate().sqrt()); + final T deltaL = beta.subtract(0.5 * FastMath.PI) .divide(minusBetaDer); + final T fixedLine = deltaL.add(crossingResult.getLine()); + final FieldVector3D<T> fixedDirection = + new FieldVector3D<>(deltaL.getField().getOne(), crossingResult.getTargetDirection(), + deltaL, crossingResult.getTargetDirectionDerivative()).normalize(); // fix neighbouring pixels final AbsoluteDate fixedDate = sensor.getDate(fixedLine.getValue()); - final FieldVector3D<DerivativeStructure> fixedX = sensor.getLOSDerivatives(fixedDate, lowIndex, generator); - final FieldVector3D<DerivativeStructure> fixedZ = FieldVector3D.crossProduct(fixedX, sensor.getLOSDerivatives(fixedDate, lowIndex + 1, generator)); - final FieldVector3D<DerivativeStructure> fixedY = FieldVector3D.crossProduct(fixedZ, fixedX); + final FieldVector3D<T> fixedX = sensor.getLOSDerivatives(fixedDate, lowIndex, generator); + final FieldVector3D<T> fixedZ = FieldVector3D.crossProduct(fixedX, sensor.getLOSDerivatives(fixedDate, lowIndex + 1, generator)); + final FieldVector3D<T> fixedY = FieldVector3D.crossProduct(fixedZ, fixedX); // fix pixel - final DerivativeStructure hY = FieldVector3D.dotProduct(highLOS, fixedY); - final DerivativeStructure hX = FieldVector3D.dotProduct(highLOS, fixedX); - final DerivativeStructure pixelWidth = hY.atan2(hX); - final DerivativeStructure fY = FieldVector3D.dotProduct(fixedDirection, fixedY); - final DerivativeStructure fX = FieldVector3D.dotProduct(fixedDirection, fixedX); - final DerivativeStructure alpha = fY.atan2(fX); - final DerivativeStructure fixedPixel = alpha.divide(pixelWidth).add(lowIndex); - - return new DerivativeStructure[] { - fixedLine, fixedPixel - }; + final T hY = FieldVector3D.dotProduct(highLOS, fixedY); + final T hX = FieldVector3D.dotProduct(highLOS, fixedX); + final T pixelWidth = hY.atan2(hX); + final T fY = FieldVector3D.dotProduct(fixedDirection, fixedY); + final T fX = FieldVector3D.dotProduct(fixedDirection, fixedX); + final T alpha = fY.atan2(fX); + final T fixedPixel = alpha.divide(pixelWidth).add(lowIndex); + + final T[] ret = MathArrays.buildArray(fixedPixel.getField(), 2); + ret[0] = fixedLine; + ret[1] = fixedPixel; + return ret; + } /** Get transform from spacecraft to inertial frame. diff --git a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java index 58be9580082ae9bf6860c085655834a0b7b2de15..b1ffd05dc0a186e715f96dd846da65abc90c0728 100644 --- a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java +++ b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -918,15 +918,21 @@ public class RuggedBuilder { // set up the ellipsoid switch (ellipsoidID) { case GRS80 : - return new OneAxisEllipsoid(6378137.0, 1.0 / 298.257222101, bodyFrame); + return new OneAxisEllipsoid(Constants.GRS80_EARTH_EQUATORIAL_RADIUS, + Constants.GRS80_EARTH_FLATTENING, + bodyFrame); case WGS84 : return new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, bodyFrame); case IERS96 : - return new OneAxisEllipsoid(6378136.49, 1.0 / 298.25645, bodyFrame); + return new OneAxisEllipsoid(Constants.IERS96_EARTH_EQUATORIAL_RADIUS, + Constants.IERS96_EARTH_FLATTENING, + bodyFrame); case IERS2003 : - return new OneAxisEllipsoid(6378136.6, 1.0 / 298.25642, bodyFrame); + return new OneAxisEllipsoid(Constants.IERS2003_EARTH_EQUATORIAL_RADIUS, + Constants.IERS2003_EARTH_FLATTENING, + bodyFrame); default : // this should never happen throw new RuggedInternalError(null); diff --git a/src/main/java/org/orekit/rugged/api/package-info.java b/src/main/java/org/orekit/rugged/api/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..45405e8f203e2c4fce05afbd8c078a4573b4d11b --- /dev/null +++ b/src/main/java/org/orekit/rugged/api/package-info.java @@ -0,0 +1,26 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides the principal class of Rugged library API, as well as + * the builder for Rugged instances. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.api; diff --git a/src/main/java/org/orekit/rugged/errors/Dump.java b/src/main/java/org/orekit/rugged/errors/Dump.java index 109ee3568b4aece6620e5d7261753b3a40aca0cd..71c5b78bbb91195f3ba750b76e15fdfa61ef692f 100644 --- a/src/main/java/org/orekit/rugged/errors/Dump.java +++ b/src/main/java/org/orekit/rugged/errors/Dump.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/errors/DumpManager.java b/src/main/java/org/orekit/rugged/errors/DumpManager.java index 7fc33bf5bd552e4597739f08aa56f52209fbd767..7804e395467053116c11cd79b2b9ebbc4798ddcf 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpManager.java +++ b/src/main/java/org/orekit/rugged/errors/DumpManager.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/errors/DumpReplayer.java b/src/main/java/org/orekit/rugged/errors/DumpReplayer.java index 4d24e5467090362030a057ac2bf13a68a918bd0d..fb22fd5d58c4322e0f935a74126c9842b4298328 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpReplayer.java +++ b/src/main/java/org/orekit/rugged/errors/DumpReplayer.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -33,9 +33,10 @@ import java.util.List; import java.util.Map; import java.util.NavigableMap; import java.util.TreeMap; +import java.util.regex.Pattern; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.exception.LocalizedCoreFormats; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Rotation; @@ -62,7 +63,7 @@ import org.orekit.rugged.raster.TileUpdater; import org.orekit.rugged.raster.UpdatableTile; import org.orekit.rugged.refraction.AtmosphericRefraction; import org.orekit.rugged.refraction.MultiLayerModel; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.SpacecraftToObservedBody; import org.orekit.time.AbsoluteDate; @@ -224,6 +225,12 @@ public class DumpReplayer { /** Keyword for null result. */ private static final String NULL_RESULT = "NULL"; + /** Pattern for delimiting regular expressions. */ + private static final Pattern SEPARATOR = Pattern.compile("\\s+"); + + /** Empty pattern. */ + private static final Pattern PATTERN = Pattern.compile(" "); + /** Constant elevation for constant elevation algorithm. */ private double constantElevation; @@ -272,6 +279,7 @@ public class DumpReplayer { /** Dumped calls. */ private final List<DumpedCall> calls; + /** Simple constructor. */ public DumpReplayer() { @@ -976,14 +984,14 @@ public class DumpReplayer { final int colon = line.indexOf(':'); if (colon > 0) { - final String parsedKey = line.substring(0, colon).trim().replaceAll(" ", "_").toUpperCase(); + final String parsedKey = PATTERN.matcher(line.substring(0, colon).trim()).replaceAll("_").toUpperCase(); try { final LineParser parser = LineParser.valueOf(parsedKey); final String[] fields; if (colon + 1 >= line.length()) { fields = new String[0]; } else { - fields = line.substring(colon + 1).trim().split("\\s+"); + fields = SEPARATOR.split(line.substring(colon + 1).trim()); } parser.parse(l, file, line, fields, global); } catch (IllegalArgumentException iae) { @@ -1207,12 +1215,12 @@ public class DumpReplayer { /** {@inheritDoc} */ @Override - public FieldVector3D<DerivativeStructure> getLOSDerivatives(final int index, final AbsoluteDate date, - final DSGenerator generator) { + public <T extends Derivative<T>> FieldVector3D<T> getLOSDerivatives(final int index, final AbsoluteDate date, + final DerivativeGenerator<T> generator) { final Vector3D los = getLOS(index, date); - return new FieldVector3D<DerivativeStructure>(generator.constant(los.getX()), - generator.constant(los.getY()), - generator.constant(los.getZ())); + return new FieldVector3D<>(generator.constant(los.getX()), + generator.constant(los.getY()), + generator.constant(los.getZ())); } /** Set a datation pair. diff --git a/src/main/java/org/orekit/rugged/errors/RuggedException.java b/src/main/java/org/orekit/rugged/errors/RuggedException.java index ed04a37dd52eb4a15d5ae059262b64ce9e22a5ac..d13917c0563f003078339232625ca890d175672c 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedException.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedException.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/errors/RuggedExceptionWrapper.java b/src/main/java/org/orekit/rugged/errors/RuggedExceptionWrapper.java index 3c25c83107b8fb99279af407f150278fcbb838cb..77a3507cc62b1ca5ab5d879c57a7c72ff20c98bd 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedExceptionWrapper.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedExceptionWrapper.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/errors/RuggedInternalError.java b/src/main/java/org/orekit/rugged/errors/RuggedInternalError.java index 29362e1a645438cd41aa54992174a63659b9b0d9..7c12634ceddc5e13a96a2dac15996c24df7de680 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedInternalError.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedInternalError.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/errors/RuggedMessages.java b/src/main/java/org/orekit/rugged/errors/RuggedMessages.java index 2d1445e85628caccbf524239966987939dc97933..98accfea1a8d160274ffda1df62ead21d62997bc 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedMessages.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedMessages.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -21,6 +21,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; +import java.nio.charset.StandardCharsets; import java.util.Locale; import java.util.MissingResourceException; import java.util.PropertyResourceBundle; @@ -164,11 +165,9 @@ public enum RuggedMessages implements Localizable { stream = loader.getResourceAsStream(resourceName); } if (stream != null) { - try { + try (InputStreamReader inputStreamReader = new InputStreamReader(stream, StandardCharsets.UTF_8)) { // Only this line is changed to make it to read properties files as UTF-8. - bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8")); - } finally { - stream.close(); + bundle = new PropertyResourceBundle(inputStreamReader); } } return bundle; diff --git a/src/main/java/org/orekit/rugged/errors/package-info.java b/src/main/java/org/orekit/rugged/errors/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..6cecf77acd35499ab85918c7f62d230048379906 --- /dev/null +++ b/src/main/java/org/orekit/rugged/errors/package-info.java @@ -0,0 +1,25 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides classes to generate and handle exceptions. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.errors; diff --git a/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java index a02eccf5f4aa41550e52b5a04c35873b773507b4..18696efb3ad1f988aa97e157fbdc82ff45790c39 100644 --- a/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -39,6 +39,7 @@ import org.orekit.rugged.utils.NormalizedGeodeticPoint; * corner points. It is not designed for operational use. * </p> * @author Luc Maisonobe + * @author Guylaine Prat */ public class BasicScanAlgorithm implements IntersectionAlgorithm { @@ -51,14 +52,19 @@ public class BasicScanAlgorithm implements IntersectionAlgorithm { /** Maximum altitude encountered. */ private double hMax; + /** Algorithm Id. + * @since 2.2 */ + private final AlgorithmId algorithmId; + /** Simple constructor. * @param updater updater used to load Digital Elevation Model tiles * @param maxCachedTiles maximum number of tiles stored in the cache */ public BasicScanAlgorithm(final TileUpdater updater, final int maxCachedTiles) { - cache = new TilesCache<SimpleTile>(new SimpleTileFactory(), updater, maxCachedTiles); - hMin = Double.POSITIVE_INFINITY; - hMax = Double.NEGATIVE_INFINITY; + this.cache = new TilesCache<SimpleTile>(new SimpleTileFactory(), updater, maxCachedTiles); + this.hMin = Double.POSITIVE_INFINITY; + this.hMax = Double.NEGATIVE_INFINITY; + this.algorithmId = AlgorithmId.BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY; } /** {@inheritDoc} */ @@ -66,7 +72,7 @@ public class BasicScanAlgorithm implements IntersectionAlgorithm { public NormalizedGeodeticPoint intersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los) { - DumpManager.dumpAlgorithm(AlgorithmId.BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY); + DumpManager.dumpAlgorithm(this.algorithmId); // find the tiles between the entry and exit point in the Digital Elevation Model NormalizedGeodeticPoint entryPoint = null; @@ -162,7 +168,7 @@ public class BasicScanAlgorithm implements IntersectionAlgorithm { public NormalizedGeodeticPoint refineIntersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los, final NormalizedGeodeticPoint closeGuess) { - DumpManager.dumpAlgorithm(AlgorithmId.BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY); + DumpManager.dumpAlgorithm(this.algorithmId); 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), @@ -182,11 +188,17 @@ public class BasicScanAlgorithm implements IntersectionAlgorithm { /** {@inheritDoc} */ @Override public double getElevation(final double latitude, final double longitude) { - DumpManager.dumpAlgorithm(AlgorithmId.BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY); + DumpManager.dumpAlgorithm(this.algorithmId); final Tile tile = cache.getTile(latitude, longitude); return tile.interpolateElevation(latitude, longitude); } + /** {@inheritDoc} */ + @Override + public AlgorithmId getAlgorithmId() { + return this.algorithmId; + } + /** Check the overall min and max altitudes. * @param tiles tiles to check * @return true if the tile changed either min or max altitude @@ -252,5 +264,4 @@ public class BasicScanAlgorithm implements IntersectionAlgorithm { final int rawIndex = tile.getFloorLongitudeIndex(longitude); return FastMath.min(FastMath.max(0, rawIndex), tile.getLongitudeColumns()); } - } diff --git a/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java index 185ab1f8053d3ce056b1b616a2e000b345db8152..93a24f1e7228d80606c9fdc19239091547ad2005 100644 --- a/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -25,27 +25,33 @@ import org.orekit.rugged.utils.NormalizedGeodeticPoint; /** Intersection ignoring Digital Elevation Model. * <p> - * This dummy implementation simply uses the ellipsoid itself. + * This implementation uses a constant elevation over the ellipsoid. * </p> * @author Luc Maisonobe + * @author Guylaine Prat */ public class ConstantElevationAlgorithm implements IntersectionAlgorithm { /** Constant elevation over ellipsoid. */ private final double constantElevation; + /** Algorithm Id. + * @since 2.2 */ + private final AlgorithmId algorithmId; + /** Simple constructor. * @param constantElevation constant elevation over ellipsoid */ public ConstantElevationAlgorithm(final double constantElevation) { this.constantElevation = constantElevation; + this.algorithmId = AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID; } /** {@inheritDoc} */ @Override public NormalizedGeodeticPoint intersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los) { - DumpManager.dumpAlgorithm(AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID, constantElevation); + DumpManager.dumpAlgorithm(this.algorithmId, 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(), 0.0); @@ -56,7 +62,7 @@ public class ConstantElevationAlgorithm implements IntersectionAlgorithm { public NormalizedGeodeticPoint refineIntersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los, final NormalizedGeodeticPoint closeGuess) { - DumpManager.dumpAlgorithm(AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID, constantElevation); + DumpManager.dumpAlgorithm(this.algorithmId, 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(), @@ -71,8 +77,13 @@ public class ConstantElevationAlgorithm implements IntersectionAlgorithm { */ @Override public double getElevation(final double latitude, final double longitude) { - DumpManager.dumpAlgorithm(AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID, constantElevation); + DumpManager.dumpAlgorithm(this.algorithmId, constantElevation); return constantElevation; } + /** {@inheritDoc} */ + @Override + public AlgorithmId getAlgorithmId() { + return this.algorithmId; + } } diff --git a/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java index 29f0421d8dd429a4e57ad82c9ca385a282285599..68f331a67ac47eb332b73466e68e20b025f1a2f5 100644 --- a/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -27,19 +27,25 @@ import org.orekit.rugged.utils.NormalizedGeodeticPoint; * This dummy implementation simply uses the ellipsoid itself. * </p> * @author Luc Maisonobe + * @author Guylaine Prat */ public class IgnoreDEMAlgorithm implements IntersectionAlgorithm { + /** Algorithm Id. + * @since 2.2 */ + private final AlgorithmId algorithmId; + /** Simple constructor. */ public IgnoreDEMAlgorithm() { + this.algorithmId = AlgorithmId.IGNORE_DEM_USE_ELLIPSOID; } /** {@inheritDoc} */ @Override public NormalizedGeodeticPoint intersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los) { - DumpManager.dumpAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID); + DumpManager.dumpAlgorithm(this.algorithmId); return ellipsoid.pointOnGround(position, los, 0.0); } @@ -48,7 +54,7 @@ public class IgnoreDEMAlgorithm implements IntersectionAlgorithm { public NormalizedGeodeticPoint refineIntersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los, final NormalizedGeodeticPoint closeGuess) { - DumpManager.dumpAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID); + DumpManager.dumpAlgorithm(this.algorithmId); return intersection(ellipsoid, position, los); } @@ -60,8 +66,13 @@ public class IgnoreDEMAlgorithm implements IntersectionAlgorithm { */ @Override public double getElevation(final double latitude, final double longitude) { - DumpManager.dumpAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID); + DumpManager.dumpAlgorithm(this.algorithmId); return 0.0; } + /** {@inheritDoc} */ + @Override + public AlgorithmId getAlgorithmId() { + return this.algorithmId; + } } diff --git a/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java index a003c9fc5eaf8425312cb9ba8f15bc02ed647364..438e7b05bdd106ed51328ca4290eb8a617b9011a 100644 --- a/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,11 +18,13 @@ package org.orekit.rugged.intersection; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.orekit.bodies.GeodeticPoint; +import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.NormalizedGeodeticPoint; /** Interface for Digital Elevation Model intersection algorithm. * @author Luc Maisonobe + * @author Guylaine Prat */ public interface IntersectionAlgorithm { @@ -58,4 +60,9 @@ public interface IntersectionAlgorithm { */ double getElevation(double latitude, double longitude); + /** Get the algorithmId. + * @return the algorithmId + * @since 2.2 + */ + AlgorithmId getAlgorithmId(); } diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java index a3abd8b3050b2500887b4d7f33d8a522f857116a..1b9f23e312f54563ae80e988148f05be41db4983 100644 --- a/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -58,6 +58,10 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { /** Flag for flat-body hypothesis. */ private final boolean flatBody; + /** Algorithm Id. + * @since 2.2 */ + private final AlgorithmId algorithmId; + /** Simple constructor. * @param updater updater used to load Digital Elevation Model tiles * @param maxCachedTiles maximum number of tiles stored in the cache @@ -72,6 +76,7 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { final boolean flatBody) { this.cache = new TilesCache<MinMaxTreeTile>(new MinMaxTreeTileFactory(), updater, maxCachedTiles); this.flatBody = flatBody; + this.algorithmId = flatBody ? AlgorithmId.DUVENHAGE_FLAT_BODY : AlgorithmId.DUVENHAGE; } /** {@inheritDoc} */ @@ -79,7 +84,7 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { public NormalizedGeodeticPoint intersection(final ExtendedEllipsoid ellipsoid, final Vector3D position, final Vector3D los) { - DumpManager.dumpAlgorithm(flatBody ? AlgorithmId.DUVENHAGE_FLAT_BODY : AlgorithmId.DUVENHAGE); + DumpManager.dumpAlgorithm(this.algorithmId); // compute intersection with ellipsoid final NormalizedGeodeticPoint gp0 = ellipsoid.pointOnGround(position, los, 0.0); @@ -194,7 +199,7 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { final Vector3D position, final Vector3D los, final NormalizedGeodeticPoint closeGuess) { - DumpManager.dumpAlgorithm(flatBody ? AlgorithmId.DUVENHAGE_FLAT_BODY : AlgorithmId.DUVENHAGE); + DumpManager.dumpAlgorithm(this.algorithmId); if (flatBody) { // under the (bad) flat-body assumption, the reference point must remain @@ -284,11 +289,17 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { @Override public double getElevation(final double latitude, final double longitude) { - DumpManager.dumpAlgorithm(flatBody ? AlgorithmId.DUVENHAGE_FLAT_BODY : AlgorithmId.DUVENHAGE); + DumpManager.dumpAlgorithm(this.algorithmId); final Tile tile = cache.getTile(latitude, longitude); return tile.interpolateElevation(latitude, longitude); } + /** {@inheritDoc} */ + @Override + public AlgorithmId getAlgorithmId() { + return this.algorithmId; + } + /** Compute intersection of line with Digital Elevation Model in a sub-tile. * @param depth recursion depth * @param ellipsoid reference ellipsoid @@ -737,5 +748,4 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { } } - } diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java index c56754a04103e49922494583b51f3822b8586711..e7032157dd9d79051887d3f7ab1514d585398ec9 100644 --- a/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java +++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileFactory.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileFactory.java index ddf6677bbf0ce9407bbbbde6b924e97f4377a447..4657ad4b59888e95fb5d7be765cd8d2b6d1c4559 100644 --- a/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileFactory.java +++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileFactory.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/package-info.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..be6b0bebdfaac429e060dab369527528835f05c8 --- /dev/null +++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/package-info.java @@ -0,0 +1,26 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides the Digital Elevation Model intersection using + * Bernardt Duvenhage's algorithm. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.intersection.duvenhage; diff --git a/src/main/java/org/orekit/rugged/intersection/package-info.java b/src/main/java/org/orekit/rugged/intersection/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..a8761e29a17cb8e687851d47ffe9d3faa8246207 --- /dev/null +++ b/src/main/java/org/orekit/rugged/intersection/package-info.java @@ -0,0 +1,27 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides the interface for Digital Elevation Model intersection + * algorithm, as well as some simple implementations. + * + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.intersection; diff --git a/src/main/java/org/orekit/rugged/linesensor/LineDatation.java b/src/main/java/org/orekit/rugged/linesensor/LineDatation.java index 903474a729efa44e4fad3c0b5bcf2070e1a7675c..34527fb54120772343a30d3250e149ab9914d561 100644 --- a/src/main/java/org/orekit/rugged/linesensor/LineDatation.java +++ b/src/main/java/org/orekit/rugged/linesensor/LineDatation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/linesensor/LineSensor.java b/src/main/java/org/orekit/rugged/linesensor/LineSensor.java index 9f4569b4833c4c9945633a3a137620977699a253..ca9fd053173413b20682e728b868f9fad85741c5 100644 --- a/src/main/java/org/orekit/rugged/linesensor/LineSensor.java +++ b/src/main/java/org/orekit/rugged/linesensor/LineSensor.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,13 +18,13 @@ package org.orekit.rugged.linesensor; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.rugged.errors.DumpManager; import org.orekit.rugged.los.TimeDependentLOS; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; @@ -113,37 +113,36 @@ public class LineSensor { /** Get the pixel normalized line-of-sight at some date, * and their derivatives with respect to estimated parameters. + * @param <T> derivative type * @param date current date * @param i pixel index (must be between 0 and {@link #getNbPixels()} - 1 - * @param generator generator to use for building {@link DerivativeStructure} instances + * @param generator generator to use for building {@link Derivative} instances * @return pixel normalized line-of-sight - * @since 2.0 */ - public FieldVector3D<DerivativeStructure> getLOSDerivatives(final AbsoluteDate date, final int i, - final DSGenerator generator) { + public <T extends Derivative<T>> FieldVector3D<T> getLOSDerivatives(final AbsoluteDate date, final int i, + final DerivativeGenerator<T> generator) { return los.getLOSDerivatives(i, date, generator); } /** Get the pixel normalized line-of-sight at some date, * and their derivatives with respect to estimated parameters. + * @param <T> derivative type * @param date current date * @param i pixel index (must be between 0 and {@link #getNbPixels()} - 1 - * @param generator generator to use for building {@link DerivativeStructure} instances + * @param generator generator to use for building {@link Derivative} instances * @return pixel normalized line-of-sight * @since 2.0 */ - public FieldVector3D<DerivativeStructure> getLOSDerivatives(final AbsoluteDate date, final double i, - final DSGenerator generator) { + public <T extends Derivative<T>> FieldVector3D<T> getLOSDerivatives(final AbsoluteDate date, final double i, + final DerivativeGenerator<T> generator) { // find surrounding pixels of pixelB (in order to interpolate LOS from pixelB (that is not an integer) final int iInf = FastMath.max(0, FastMath.min(getNbPixels() - 2, (int) FastMath.floor(i))); final int iSup = iInf + 1; - final FieldVector3D<DerivativeStructure> interpolatedLos = new FieldVector3D<DerivativeStructure> ( - iSup - i, - los.getLOSDerivatives(iInf, date, generator), - i - iInf, - los.getLOSDerivatives(iSup, date, generator)).normalize(); + final FieldVector3D<T> interpolatedLos = + new FieldVector3D<> (iSup - i, los.getLOSDerivatives(iInf, date, generator), + i - iInf, los.getLOSDerivatives(iSup, date, generator)).normalize(); return interpolatedLos; } diff --git a/src/main/java/org/orekit/rugged/linesensor/LinearLineDatation.java b/src/main/java/org/orekit/rugged/linesensor/LinearLineDatation.java index a073a17c3938f749c81d48f1b67f730c7a83451e..aa0d2bb14c2e0447aa7d0ee9b0a52fbffa3e7b20 100644 --- a/src/main/java/org/orekit/rugged/linesensor/LinearLineDatation.java +++ b/src/main/java/org/orekit/rugged/linesensor/LinearLineDatation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java b/src/main/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java index d737a401edbd609eada887c943925a1cc50d344d..06f3b81fd27e9485fa8713e67a25dd20fbc3e5e9 100644 --- a/src/main/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java +++ b/src/main/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/linesensor/SensorPixel.java b/src/main/java/org/orekit/rugged/linesensor/SensorPixel.java index a0f65e239573330d40221e3778e5310368d77ede..04526b63ef8002adf76cc2a9118da1929d8fa4b3 100644 --- a/src/main/java/org/orekit/rugged/linesensor/SensorPixel.java +++ b/src/main/java/org/orekit/rugged/linesensor/SensorPixel.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/linesensor/SensorPixelCrossing.java b/src/main/java/org/orekit/rugged/linesensor/SensorPixelCrossing.java index 0ae635599a68475f86fffacefd21628b3baab9d1..da77e0715fb12df04175159bbc21934656d82fda 100644 --- a/src/main/java/org/orekit/rugged/linesensor/SensorPixelCrossing.java +++ b/src/main/java/org/orekit/rugged/linesensor/SensorPixelCrossing.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/linesensor/package-info.java b/src/main/java/org/orekit/rugged/linesensor/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..85e6b78adf04d8e26e7737ab27d260a059a24333 --- /dev/null +++ b/src/main/java/org/orekit/rugged/linesensor/package-info.java @@ -0,0 +1,25 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides all the tools needed to deal with line sensor model. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.linesensor; diff --git a/src/main/java/org/orekit/rugged/los/FixedRotation.java b/src/main/java/org/orekit/rugged/los/FixedRotation.java index 83ab388c215b6e928446a7ec3fb7453fabd4b4ed..40187de276418cfd0b68d7ca9da3b86192640aa4 100644 --- a/src/main/java/org/orekit/rugged/los/FixedRotation.java +++ b/src/main/java/org/orekit/rugged/los/FixedRotation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,14 +18,14 @@ package org.orekit.rugged.los; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.geometry.euclidean.threed.FieldRotation; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; @@ -50,7 +50,7 @@ public class FixedRotation implements TimeIndependentLOSTransform { private Rotation rotation; /** Underlying rotation with derivatives. */ - private FieldRotation<DerivativeStructure> rDS; + private FieldRotation<?> rDS; /** Driver for rotation angle. */ private final ParameterDriver angleDriver; @@ -96,19 +96,31 @@ public class FixedRotation implements TimeIndependentLOSTransform { } /** {@inheritDoc} */ + @SuppressWarnings("unchecked") @Override - public FieldVector3D<DerivativeStructure> transformLOS(final int i, final FieldVector3D<DerivativeStructure> los, - final DSGenerator generator) { - if (rDS == null) { + public <T extends Derivative<T>> FieldVector3D<T> transformLOS(final int i, final FieldVector3D<T> los, + final DerivativeGenerator<T> generator) { + final FieldRotation<T> rD; + if (rDS == null || !rDS.getQ0().getField().equals(generator.getField())) { + // lazy evaluation of the rotation - final FieldVector3D<DerivativeStructure> axisDS = - new FieldVector3D<DerivativeStructure>(generator.constant(axis.getX()), - generator.constant(axis.getY()), - generator.constant(axis.getZ())); - final DerivativeStructure angleDS = generator.variable(angleDriver); - rDS = new FieldRotation<DerivativeStructure>(axisDS, angleDS, RotationConvention.VECTOR_OPERATOR); + final FieldVector3D<T> axisDS = + new FieldVector3D<>(generator.constant(axis.getX()), + generator.constant(axis.getY()), + generator.constant(axis.getZ())); + final T angleDS = generator.variable(angleDriver); + rD = new FieldRotation<>(axisDS, angleDS, RotationConvention.VECTOR_OPERATOR); + + // cache evaluated rotation + rDS = rD; + + } else { + // reuse cached value + rD = (FieldRotation<T>) rDS; } - return rDS.applyTo(los); + + return rD.applyTo(los); + } } diff --git a/src/main/java/org/orekit/rugged/los/FixedZHomothety.java b/src/main/java/org/orekit/rugged/los/FixedZHomothety.java index d27e544d8a248a8fab533a548bb52387bf36c755..071b5672b8d04544d44e298a10499d112da102ce 100644 --- a/src/main/java/org/orekit/rugged/los/FixedZHomothety.java +++ b/src/main/java/org/orekit/rugged/los/FixedZHomothety.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,11 +18,11 @@ package org.orekit.rugged.los; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; @@ -46,7 +46,7 @@ public class FixedZHomothety implements TimeIndependentLOSTransform { private double factor; /** Underlying homothety with derivatives. */ - private DerivativeStructure factorDS; + private Derivative<?> factorDS; /** Driver for homothety factor. */ private final ParameterDriver factorDriver; @@ -91,14 +91,26 @@ public class FixedZHomothety implements TimeIndependentLOSTransform { } /** {@inheritDoc} */ + @SuppressWarnings("unchecked") @Override - public FieldVector3D<DerivativeStructure> transformLOS(final int i, final FieldVector3D<DerivativeStructure> los, - final DSGenerator generator) { - if (factorDS == null) { + public <T extends Derivative<T>> FieldVector3D<T> transformLOS(final int i, final FieldVector3D<T> los, + final DerivativeGenerator<T> generator) { + final T factorD; + if (factorDS == null || !factorDS.getField().equals(generator.getField())) { + // lazy evaluation of the homothety - factorDS = generator.variable(factorDriver); + factorD = generator.variable(factorDriver); + + // cache evaluated homothety + factorDS = factorD; + + } else { + // reuse cached value + factorD = (T) factorDS; } - return new FieldVector3D<DerivativeStructure>(los.getX(), los.getY(), factorDS.multiply(los.getZ())); + + return new FieldVector3D<>(los.getX(), los.getY(), factorD.multiply(los.getZ())); + } } diff --git a/src/main/java/org/orekit/rugged/los/LOSBuilder.java b/src/main/java/org/orekit/rugged/los/LOSBuilder.java index 9ff9c2406bba2ce48391692eda580f20b6e00bc4..c65796850490c5ffcbdeb59c3caa5c2a09e0e816 100644 --- a/src/main/java/org/orekit/rugged/los/LOSBuilder.java +++ b/src/main/java/org/orekit/rugged/los/LOSBuilder.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -21,10 +21,10 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; @@ -122,8 +122,8 @@ public class LOSBuilder { /** {@inheritDoc} */ @Override - public FieldVector3D<DerivativeStructure> transformLOS(final int i, final FieldVector3D<DerivativeStructure> los, - final AbsoluteDate date, final DSGenerator generator) { + public <T extends Derivative<T>> FieldVector3D<T> transformLOS(final int i, final FieldVector3D<T> los, + final AbsoluteDate date, final DerivativeGenerator<T> generator) { return transform.transformLOS(i, los, generator); } @@ -179,14 +179,13 @@ public class LOSBuilder { /** {@inheritDoc} */ @Override - public FieldVector3D<DerivativeStructure> getLOSDerivatives(final int index, final AbsoluteDate date, - final DSGenerator generator) { + public <T extends Derivative<T>> FieldVector3D<T> getLOSDerivatives(final int index, final AbsoluteDate date, + final DerivativeGenerator<T> generator) { // the raw line of sights are considered to be constant - FieldVector3D<DerivativeStructure> los = - new FieldVector3D<DerivativeStructure>(generator.constant(raw[index].getX()), - generator.constant(raw[index].getY()), - generator.constant(raw[index].getZ())); + FieldVector3D<T> los = new FieldVector3D<>(generator.constant(raw[index].getX()), + generator.constant(raw[index].getY()), + generator.constant(raw[index].getZ())); // apply the transforms, which depend on parameters and hence may introduce non-zero derivatives for (final LOSTransform transform : transforms) { diff --git a/src/main/java/org/orekit/rugged/los/LOSTransform.java b/src/main/java/org/orekit/rugged/los/LOSTransform.java index 62e6bd1fe15913aa07b02b2128640d57a3e1e7b9..7fd71d574c401662e96f19351d1904b9e6eb8600 100644 --- a/src/main/java/org/orekit/rugged/los/LOSTransform.java +++ b/src/main/java/org/orekit/rugged/los/LOSTransform.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,10 +18,11 @@ package org.orekit.rugged.los; import java.util.stream.Stream; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; @@ -46,14 +47,15 @@ public interface LOSTransform { * are typically polynomials coefficients representing rotation angles. * These polynomials can be used for example to model thermo-elastic effects. * </p> + * @param <T> derivative type * @param index los pixel index * @param los line-of-sight to transform * @param date date * @param generator generator to use for building {@link DerivativeStructure} instances * @return line of sight, and its first partial derivatives with respect to the parameters */ - FieldVector3D<DerivativeStructure> transformLOS(int index, FieldVector3D<DerivativeStructure> los, - AbsoluteDate date, DSGenerator generator); + <T extends Derivative<T>> FieldVector3D<T> transformLOS(int index, FieldVector3D<T> los, + AbsoluteDate date, DerivativeGenerator<T> generator); /** Get the drivers for LOS parameters. * @return drivers for LOS parameters diff --git a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java index 9bdcbdb1c80dcce8dc10bc321e78b65fad18c932..e548781a69f8fa548625a1324075ddad916ab807 100644 --- a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java +++ b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,7 +18,8 @@ package org.orekit.rugged.los; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.Field; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.analysis.polynomials.PolynomialFunction; import org.hipparchus.geometry.euclidean.threed.FieldRotation; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; @@ -26,7 +27,8 @@ import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.rugged.utils.DSGenerator; +import org.hipparchus.util.MathArrays; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; @@ -52,10 +54,10 @@ public class PolynomialRotation implements LOSTransform { private PolynomialFunction angle; /** Rotation axis and derivatives. */ - private FieldVector3D<DerivativeStructure> axisDS; + private FieldVector3D<?> axisDS; /** Rotation angle polynomial and derivatives. */ - private DerivativeStructure[] angleDS; + private Derivative<?>[] angleDS; /** Reference date for polynomial evaluation. */ private final AbsoluteDate referenceDate; @@ -143,30 +145,44 @@ public class PolynomialRotation implements LOSTransform { } /** {@inheritDoc} */ + @SuppressWarnings("unchecked") @Override - public FieldVector3D<DerivativeStructure> transformLOS(final int i, final FieldVector3D<DerivativeStructure> los, - final AbsoluteDate date, final DSGenerator generator) { + public <T extends Derivative<T>> FieldVector3D<T> transformLOS(final int i, final FieldVector3D<T> los, + final AbsoluteDate date, + final DerivativeGenerator<T> generator) { + + final Field<T> field = generator.getField(); + final FieldVector3D<T> axisD; + final T[] angleD; + if (axisDS == null || !axisDS.getX().getField().equals(field)) { - if (angleDS == null) { // lazy evaluation of the rotation - axisDS = new FieldVector3D<DerivativeStructure>(generator.constant(axis.getX()), - generator.constant(axis.getY()), - generator.constant(axis.getZ())); - angleDS = new DerivativeStructure[coefficientsDrivers.length]; - for (int k = 0; k < angleDS.length; ++k) { - angleDS[k] = generator.variable(coefficientsDrivers[k]); + axisD = new FieldVector3D<>(generator.constant(axis.getX()), + generator.constant(axis.getY()), + generator.constant(axis.getZ())); + angleD = MathArrays.buildArray(field, coefficientsDrivers.length); + for (int k = 0; k < angleD.length; ++k) { + angleD[k] = generator.variable(coefficientsDrivers[k]); } + + // cache evaluated rotation parameters + axisDS = axisD; + angleDS = angleD; + + } else { + // reuse cached values + axisD = (FieldVector3D<T>) axisDS; + angleD = (T[]) angleDS; } + // evaluate polynomial, with all its partial derivatives final double t = date.durationFrom(referenceDate); - DerivativeStructure alpha = axisDS.getX().getField().getZero(); + T alpha = field.getZero(); for (int k = angleDS.length - 1; k >= 0; --k) { - alpha = alpha.multiply(t).add(angleDS[k]); + alpha = alpha.multiply(t).add(angleD[k]); } - return new FieldRotation<DerivativeStructure>(axisDS, - alpha, - RotationConvention.VECTOR_OPERATOR).applyTo(los); + return new FieldRotation<>(axisD, alpha, RotationConvention.VECTOR_OPERATOR).applyTo(los); } diff --git a/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java b/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java index 08aca9937f58478d280dbdec46c6a4c5f671c6e6..d12d6aba476b96f143276acab8c6088030a217c6 100644 --- a/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java +++ b/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,10 +18,10 @@ package org.orekit.rugged.los; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; @@ -56,14 +56,15 @@ public interface TimeDependentLOS { * method must have been set to {@code true} for the various parameters returned * by {@link #getParametersDrivers()} that should be estimated. * </p> + * @param <T> derivative type * @param index los pixel index * @param date date - * @param generator generator to use for building {@link DerivativeStructure} instances + * @param generator generator to use for building {@link Derivative} instances * @return line of sight, and its first partial derivatives with respect to the parameters * @since 2.0 */ - FieldVector3D<DerivativeStructure> getLOSDerivatives(int index, AbsoluteDate date, - DSGenerator generator); + <T extends Derivative<T>> FieldVector3D<T> getLOSDerivatives(int index, AbsoluteDate date, + DerivativeGenerator<T> generator); /** Get the drivers for LOS parameters. * @return drivers for LOS parameters diff --git a/src/main/java/org/orekit/rugged/los/TimeIndependentLOSTransform.java b/src/main/java/org/orekit/rugged/los/TimeIndependentLOSTransform.java index f1abc03f3e1278c075620bd083fa454a3e453943..6c433a6fb96f8d00776e4441694491a52b77c391 100644 --- a/src/main/java/org/orekit/rugged/los/TimeIndependentLOSTransform.java +++ b/src/main/java/org/orekit/rugged/los/TimeIndependentLOSTransform.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,10 +18,10 @@ package org.orekit.rugged.los; import java.util.stream.Stream; -import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Derivative; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.utils.ParameterDriver; /** Interface for lines-of-sight tranforms that do not depend on time. @@ -50,13 +50,14 @@ public interface TimeIndependentLOSTransform { * method must have been set to {@code true} for the various parameters returned * by {@link #getParametersDrivers()} that should be estimated. * </p> + * @param <T> derivative type * @param index los pixel index * @param los line-of-sight to transform - * @param generator generator to use for building {@link DerivativeStructure} instances + * @param generator generator to use for building {@link Derivative} instances * @return line of sight, and its first partial derivatives with respect to the parameters */ - FieldVector3D<DerivativeStructure> transformLOS(int index, FieldVector3D<DerivativeStructure> los, - DSGenerator generator); + <T extends Derivative<T>> FieldVector3D<T> transformLOS(int index, FieldVector3D<T> los, + DerivativeGenerator<T> generator); /** Get the drivers for LOS parameters. * @return drivers for LOS parameters diff --git a/src/main/java/org/orekit/rugged/los/package-info.java b/src/main/java/org/orekit/rugged/los/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..5bfad94445f8b863fc5fa668a9f1f38dc6bc5e4f --- /dev/null +++ b/src/main/java/org/orekit/rugged/los/package-info.java @@ -0,0 +1,25 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides all the tools to build lines-of-sight (LOS). + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.los; diff --git a/src/main/java/org/orekit/rugged/raster/SimpleTile.java b/src/main/java/org/orekit/rugged/raster/SimpleTile.java index 5db49b4e9a39f3976aeb54029f43eb4fef3421f0..07e8dade5c703ed1d61abd65f3cccaf403d976b8 100644 --- a/src/main/java/org/orekit/rugged/raster/SimpleTile.java +++ b/src/main/java/org/orekit/rugged/raster/SimpleTile.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/raster/SimpleTileFactory.java b/src/main/java/org/orekit/rugged/raster/SimpleTileFactory.java index b05b7cd361bb4adab2921da78bafc607ac139b1e..c032d6b319f207c38d04ac8f7076c1fb51289600 100644 --- a/src/main/java/org/orekit/rugged/raster/SimpleTileFactory.java +++ b/src/main/java/org/orekit/rugged/raster/SimpleTileFactory.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -16,8 +16,6 @@ */ package org.orekit.rugged.raster; -import org.orekit.rugged.raster.TileFactory; - /** Simple implementation of a {@link TileFactory} for {@link SimpleTile}. * @author Luc Maisonobe */ diff --git a/src/main/java/org/orekit/rugged/raster/Tile.java b/src/main/java/org/orekit/rugged/raster/Tile.java index 634da34d6b56a4247aeca5a2958dcff375df63be..ce66a12607a7b4fe809a0d791882eb7aa6da90e0 100644 --- a/src/main/java/org/orekit/rugged/raster/Tile.java +++ b/src/main/java/org/orekit/rugged/raster/Tile.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/raster/TileFactory.java b/src/main/java/org/orekit/rugged/raster/TileFactory.java index 19cef8ebfd50f3f09f5a2661b51eee128f27a950..ca889f682736226d9e1afd248f3ab6b0d28a4353 100644 --- a/src/main/java/org/orekit/rugged/raster/TileFactory.java +++ b/src/main/java/org/orekit/rugged/raster/TileFactory.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/raster/TileUpdater.java b/src/main/java/org/orekit/rugged/raster/TileUpdater.java index 659942f1357ec736ad3249b096508891805e2444..509ca6e9075dcf955e3fb52bbf87e8979a1645cd 100644 --- a/src/main/java/org/orekit/rugged/raster/TileUpdater.java +++ b/src/main/java/org/orekit/rugged/raster/TileUpdater.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -18,7 +18,7 @@ package org.orekit.rugged.raster; /** Interface used to update Digital Elevation Model tiles. * <p> - * Implementations of this interface are must be provided by + * Implementations of this interface must be provided by * the image processing mission-specific layer, thus allowing * the Rugged library to access the Digital Elevation Model data. * </p> diff --git a/src/main/java/org/orekit/rugged/raster/TilesCache.java b/src/main/java/org/orekit/rugged/raster/TilesCache.java index 528048e17c4297f8fb9609498e1429e14de3d2fd..43c1191029b9bc9fe53d501ab13373a58fb5a672 100644 --- a/src/main/java/org/orekit/rugged/raster/TilesCache.java +++ b/src/main/java/org/orekit/rugged/raster/TilesCache.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/raster/UpdatableTile.java b/src/main/java/org/orekit/rugged/raster/UpdatableTile.java index c34af1ae4ce07f62f142187d554cbb793c9267f6..5cb18f92ee9e31ef67d8af0526f69bcf32266909 100644 --- a/src/main/java/org/orekit/rugged/raster/UpdatableTile.java +++ b/src/main/java/org/orekit/rugged/raster/UpdatableTile.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/raster/package-info.java b/src/main/java/org/orekit/rugged/raster/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..e349af7381d5b97041047aa2f397429c31f7edba --- /dev/null +++ b/src/main/java/org/orekit/rugged/raster/package-info.java @@ -0,0 +1,29 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides the interface used to update Digital Elevation + * Model tiles to be implemented by the user, + * the interface representing a raster tile, as well as a simple model. + * It provides also the interface representing a factory for raster tile, + * as well as a simple implementation. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.raster; diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java index 8baf276011c5a9defa27d20b606e2f5d14ced966..2b30c63e36794d970f31f4f74072b339f02e076b 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -94,13 +94,9 @@ public class AtmosphericComputationParameters { } 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 + this.uGrid = GridCreation.createLinearGrid(0, sensorNbPxs - 1, this.nbPixelGrid); + this.vGrid = GridCreation.createLinearGrid(minLine + MARGIN_LINE, maxLine - MARGIN_LINE, this.nbLineGrid); } diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java index 16c3c9c42b4f9a903b00e9b02ce833d48dec9a6c..17aaf40fb7ac0c4e67fd495a2af944196f4575c8 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/refraction/ConstantRefractionLayer.java b/src/main/java/org/orekit/rugged/refraction/ConstantRefractionLayer.java index 37567e0be8d57624133966f13dd946263ed20908..65e40c968dff686bbe8de7ba01d8f11f20db51c3 100644 --- a/src/main/java/org/orekit/rugged/refraction/ConstantRefractionLayer.java +++ b/src/main/java/org/orekit/rugged/refraction/ConstantRefractionLayer.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java b/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java index 2c1f1918896c3c2e8f545848727254d3cb7d80bc..8f294997848b74177813277dc51e7fd47e01bf33 100644 --- a/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java +++ b/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/refraction/package-info.java b/src/main/java/org/orekit/rugged/refraction/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..fa2a897cf50c8b01dc2137192a31cd34c9c80d2f --- /dev/null +++ b/src/main/java/org/orekit/rugged/refraction/package-info.java @@ -0,0 +1,27 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides the interface for atmospheric refraction model, as well as + * some classical models. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * @author Sergio Esteves + * + */ +package org.orekit.rugged.refraction; diff --git a/src/main/java/org/orekit/rugged/utils/DSGenerator.java b/src/main/java/org/orekit/rugged/utils/DSGenerator.java index 535474fa07e1f13a90e2b032a292f712cda501eb..938a32bae1a9290496b322293167d083dc834552 100644 --- a/src/main/java/org/orekit/rugged/utils/DSGenerator.java +++ b/src/main/java/org/orekit/rugged/utils/DSGenerator.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -16,8 +16,6 @@ */ package org.orekit.rugged.utils; -import java.util.List; - import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.orekit.utils.ParameterDriver; @@ -27,29 +25,8 @@ import org.orekit.utils.ParameterDriver; * </p> * @author Luc Maisonobe * @since 2.0 + * @deprecated as of 2.2, replaced by {@link DerivativeGenerator} */ -public interface DSGenerator { - - /** Get the parameters selected for estimation. - * @return parameters selected for estimation - */ - List<ParameterDriver> getSelected(); - - /** Generate a constant {@link DerivativeStructure}. - * @param value value of the constant - * @return constant {@link DerivativeStructure} - */ - DerivativeStructure constant(double value); - - /** Generate a {@link DerivativeStructure} representing the - * parameter driver either as a canonical variable or a constant. - * <p> - * The instance created is a variable only if the parameter - * has been selected for estimation, otherwise it is a constant. - * </p> - * @param driver driver for the variable - * @return variable {@link DerivativeStructure} - */ - DerivativeStructure variable(ParameterDriver driver); - +public interface DSGenerator extends DerivativeGenerator<DerivativeStructure> { + // nothing specialized here } diff --git a/src/main/java/org/orekit/rugged/utils/DerivativeGenerator.java b/src/main/java/org/orekit/rugged/utils/DerivativeGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..be87b7e7f953114597eb05121f56b8b37d2bf9a7 --- /dev/null +++ b/src/main/java/org/orekit/rugged/utils/DerivativeGenerator.java @@ -0,0 +1,64 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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; + +import java.util.List; + +import org.hipparchus.Field; +import org.hipparchus.analysis.differentiation.Derivative; +import org.orekit.utils.ParameterDriver; + +/** Generator for {@link Derivative} instances from {@link ParameterDriver}. + * <p> + * Note that this interface is for Rugged library internal use only. + * </p> + * @author Luc Maisonobe + * @since 2.0 + */ +public interface DerivativeGenerator<T extends Derivative<T>> { + + /** Get the parameters selected for estimation. + * @return parameters selected for estimation + */ + List<ParameterDriver> getSelected(); + + /** Generate a constant {@link Derivative}. + * @param value value of the constant + * @return constant {@link Derivative} + */ + T constant(double value); + + /** Generate a {@link Derivative} representing the + * parameter driver either as a canonical variable or a constant. + * <p> + * The instance created is a variable only if the parameter + * has been selected for estimation, otherwise it is a constant. + * </p> + * @param driver driver for the variable + * @return variable {@link Derivative} + */ + T variable(ParameterDriver driver); + + /** Get the {@link Field} to which the generated derivatives belongs. + * @return {@link Field} to which the generated derivatives belongs + * @since 2.2 + */ + default Field<T> getField() { + return constant(0).getField(); + } + +} diff --git a/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java b/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java index 6cc42556f3e35e6a0bc278f492de761824411c12..96e64f45e9d4cb2550f731f3fdfb5237235e4cb8 100644 --- a/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java +++ b/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/GridCreation.java b/src/main/java/org/orekit/rugged/utils/GridCreation.java index d31612b527614af1ba0a88194cc1a7b5461ff937..308c0b978baf73a0805fd41598fa3e51aaf421cd 100644 --- a/src/main/java/org/orekit/rugged/utils/GridCreation.java +++ b/src/main/java/org/orekit/rugged/utils/GridCreation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/MaxSelector.java b/src/main/java/org/orekit/rugged/utils/MaxSelector.java index 7037eddd72efa173f3313eb071d8363b5f22fbc8..ee6a073fbad139be602ba55a6b99f412d7ca803e 100644 --- a/src/main/java/org/orekit/rugged/utils/MaxSelector.java +++ b/src/main/java/org/orekit/rugged/utils/MaxSelector.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/MinSelector.java b/src/main/java/org/orekit/rugged/utils/MinSelector.java index ec126ed1d218f5f59e7147baa0e4b2b7b523b5f2..4a411825488fd7128eae07f50316c59aa2bf79ac 100644 --- a/src/main/java/org/orekit/rugged/utils/MinSelector.java +++ b/src/main/java/org/orekit/rugged/utils/MinSelector.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java b/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java index 543e8bec5d706de361bd63f7d90ce018ed6e438a..5f673de2460e13456eaabf29cf2a44304a92a6eb 100644 --- a/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java +++ b/src/main/java/org/orekit/rugged/utils/NormalizedGeodeticPoint.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java b/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java index 98c7bd0cf0c82c4f6d77ee6b6defac4ef99f897c..44c5bbc328124d02eeb7c2b952f53fe519e4fcd3 100644 --- a/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java +++ b/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/Selector.java b/src/main/java/org/orekit/rugged/utils/Selector.java index c3dc0b034851af38f9aad0acee3d3168f43b9f91..880e8d7726a16d9aa6fe9396fff2d2da1c0d5932 100644 --- a/src/main/java/org/orekit/rugged/utils/Selector.java +++ b/src/main/java/org/orekit/rugged/utils/Selector.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java b/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java index aca3456a1aa23cff4db4992520e152d6958d0314..decb81efaec6ae5c664585fbd09fbd67a207ae4b 100644 --- a/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java +++ b/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/main/java/org/orekit/rugged/utils/package-info.java b/src/main/java/org/orekit/rugged/utils/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..7507188f080836dd29f3dd07e051988d1a138654 --- /dev/null +++ b/src/main/java/org/orekit/rugged/utils/package-info.java @@ -0,0 +1,25 @@ +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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. + */ +/** + * + * This package provides useful objects. + * + * @author Luc Maisonobe + * @author Guylaine Prat + * + */ +package org.orekit.rugged.utils; diff --git a/src/site/markdown/building.md b/src/site/markdown/building.md index d620655a8bdeb797009e2711b352b3fce87ca6d6..6bdfaaefaf320bdcbff9e8e18372dadc0861104c 100644 --- a/src/site/markdown/building.md +++ b/src/site/markdown/building.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -35,8 +35,9 @@ For systems not providing maven as a package, maven can be Apache Software Foundation. This site also explains the installation procedure. -As with all maven enabled projects, building Rugged is straightforward, simply -run: +As with all maven enabled projects, building official released versions of +Rugged is straightforward (see below for the special case of development versions), +simply run: mvn package @@ -46,12 +47,54 @@ the target directory, including one file named rugged-x.y.jar where x.y is the version number. This is the jar file you can use in your project using Rugged. +This command should always work for released Rugged versions as they +always depend only on released Orekit versions. Maven knows how +to download the pre-built binary for released Orekit versions. +The previous command may not work for development Rugged versions as they +may depend on unreleased Orekit versions. Maven cannot download +pre-built binaries for unreleased Orekit versions as none are +publicly available. In this case the command above will end with an error message +like: + + [ERROR] Failed to execute goal on project rugged: Could not resolve dependencies for project org.orekit:rugged:jar:X.x-SNAPSHOT: Could not find artifact org.orekit:orekit:jar:Y.y-SNAPSHOT + +In this case, you should build the missing Orekit artifact and +install it in your local maven repository beforehand. This is done by cloning +the Orekit source from Orekit git repository at Gitlab in some +temporary folder and install it with maven. This is done by +running the commands below (using Linux command syntax): + + git clone -b develop https://gitlab.orekit.org/orekit/orekit.git + cd orekit + mvn install + +If, in a similar way, the command above ends with an error message like: + + [ERROR] Failed to execute goal on project orekit: Could not resolve dependencies for project org.orekit:orekit:jar:Y.y-SNAPSHOT: + The following artifacts could not be resolved: org.hipparchus:hipparchus-core:jar:Z.z-SNAPSHOT, org.hipparchus:hipparchus-geometry:jar:Z.z-SNAPSHOT, + ... + Could not find artifact org.hipparchus:hipparchus-core:jar:Z.Z-SNAPSHOT + +Before building the Orekit artefact, you should start by building the missing Hipparchus artifact +and install it in your local maven repository +beforehand, in the same way as Orekit, by cloning +the Hipparchus source from Hipparchus git repository at GitHub: + + git clone https://github.com/Hipparchus-Math/hipparchus.git + cd hipparchus + mvn install + +Once the Orekit (and possibly Hipparchus) development version has been installed locally using +the previous commands, you can delete the cloned folder if you want. You can then +attempt again the mvn command at Rugged level, this time it should succeed as the +necessary artifact is now locally available. + If you need to configure a proxy server for dependencies retrieval, see the [Guide to using proxies](http://maven.apache.org/guides/mini/guide-proxies.html) page at the maven site. If you already use maven for your own projects (or simply eclipse, see -below), you may want to install rugged in your local repository. This is done +below), you may want to install rugged in your local maven repository. This is done with the following command: mvn install @@ -72,25 +115,27 @@ site at the [Eclipse Foundation](http://www.eclipse.org/downloads/). The simplest way to use Rugged with Eclipse is to follow these steps: - * unpack the distribution inside your Eclipse workspace + * using your operating system tools, unpack the source distribution directly + inside your Eclipse workspace. The source distribution file name has a name + of the form rugged-x.y-sources.zip where x.y is the version number. Unpacking + this zip file should create a folder of the form rugged-x.y in your workspace. + + + * using Eclipse, import the project by selecting in the top level "File" menu + the entry "Import..." + + * in the wizard that should appear, select "Maven -> Existing Maven Projects" - * create a new java project from existing sources and direct Eclipse to the - directory where you unpacked Rugged + * select the folder you just created in your workspace by unpacking the + source distribution. The "pom.xml" file describing the project will be + automatically selected. Click finish - * set the source folders to - * src/main/java - * src/test/java - * src/main/resources - * src/test/resources +The Rugged library should be configured automatically, including the dependency +to the underlying Orekit library. - in the source tab of the Configure Build Path dialog +Now you have an rugged-x.y project in you workspace, and you can create your +own application projects that will depend on the Rugged project. - * set the external libraries to JRE system library (provided by Eclipse), - Junit 4.x (provided by Eclipse), Hipparchus (available at - Hipparchus project - [downloads page](https://www.hipparchus.org/downloads.html)), - and Orekit (available at Orekit - [download page](https://www.orekit.org/download.html)) - in the libraries tab of the Configure Build Path dialog +You can also check everything works correctly by running the junit tests. -[Top of the page](#top) \ No newline at end of file +[Top of the page](#top) diff --git a/src/site/markdown/configuration.md b/src/site/markdown/configuration.md index 0239a94378744748c6b7a47dda87ce1896eac830..d11f53a013f6a11ddb790423fe7c4cbd5c4305eb 100644 --- a/src/site/markdown/configuration.md +++ b/src/site/markdown/configuration.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -27,7 +27,7 @@ into `orekit-data` and add the following lines at the start of your program (bef first time): File orekitData = new File("/path/to/the/folder/orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); This is sufficient to start working. diff --git a/src/site/markdown/contact.md b/src/site/markdown/contact.md index 9209202aa66b6c217e72128a21b7f47c13f2888c..fae9fc0b2e65f72beadf1370c7053ad49a459ada 100644 --- a/src/site/markdown/contact.md +++ b/src/site/markdown/contact.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -30,24 +30,24 @@ The main categories are: ## Technical contact If for some reason you cannot use the public forums, you can reach the CS -Systèmes d'Information Rugged team for any question (either technically +GROUP Rugged team for any question (either technically oriented or administrative) at the following email address: -[rugged@c-s.fr](mailto:rugged@c-s.fr) +[rugged@csgroup.eu](mailto:rugged@csgroup.eu) ## Administrative contact -If you want to discuss with the space division staff at CS Systèmes d'Information, +If you want to discuss with the space division staff at CS GROUP, please use the following address: - CS Systèmes d'Information - BU E-space & Geoinformation - parc de la plaine - 5 rue Brindejonc des Moulinais + CS GROUP + Space Business Unit + Parc de la Plaine - 6 rue Brindejonc des Moulinais BP 15872 - 31506 Toulouse CEDEX 5 + 31506 Toulouse Cedex 5 FRANCE phone: +33 5-61-17-66-66 (ask for Luc Maisonobe or Jonathan Guinet) - fax: +33 5-61-34-84-15 + [Top of the page](#top) diff --git a/src/site/markdown/contributing.md b/src/site/markdown/contributing.md index 0e3eb12e1164024f8ba215c138cb8bb0a3290928..dc367dffacfe03361f466911c6c88afb9f0d9175 100644 --- a/src/site/markdown/contributing.md +++ b/src/site/markdown/contributing.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/design/design.md b/src/site/markdown/design/design-major-functions.md similarity index 99% rename from src/site/markdown/design/design.md rename to src/site/markdown/design/design-major-functions.md index d7509c87df757aa2304d83423b61fa974ac9c91b..c44bfeb4ef921e167f47b38eb9d12ddb814a8237 100644 --- a/src/site/markdown/design/design.md +++ b/src/site/markdown/design/design-major-functions.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/design/digital-elevation-model.md b/src/site/markdown/design/digital-elevation-model.md index ad2c9e5c5897f91e840a710cb7e147ee2a21a67a..4c88f6cae8244b8d1a99fa89baccd146a8afcd69 100644 --- a/src/site/markdown/design/digital-elevation-model.md +++ b/src/site/markdown/design/digital-elevation-model.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/design/overview.md b/src/site/markdown/design/overview.md index 18c3819f6fe2ca670ad64023376d924669a2efed..c1ffb0baa92a636662da467225735ea9c58854da 100644 --- a/src/site/markdown/design/overview.md +++ b/src/site/markdown/design/overview.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/design/technical-choices.md b/src/site/markdown/design/technical-choices.md index 7526760f5168af9fcfba9c55c71c045809fd0f0e..65a1eaedc7628023fbae1f9b0d04bc49abaf437c 100644 --- a/src/site/markdown/design/technical-choices.md +++ b/src/site/markdown/design/technical-choices.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/downloads.md b/src/site/markdown/downloads.md.vm similarity index 61% rename from src/site/markdown/downloads.md rename to src/site/markdown/downloads.md.vm index d955d8430634d4a80134f6f1ae7f707d78bdaacc..16afd1b245f041ebd6d25a6b0a98fad003b12542 100644 --- a/src/site/markdown/downloads.md +++ b/src/site/markdown/downloads.md.vm @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -16,7 +16,7 @@ # Downloads -## Development Library version +<h2>Development Library version</h2> The development version of the Rugged library is always available to download from our version control system. We use [Git](http://git-scm.com/ "Git homepage") @@ -31,7 +31,7 @@ development environment: git clone -b develop https://gitlab.orekit.org/orekit/rugged.git -## Released Library versions +<h2>Released Library versions</h2> Rugged is provided both in several packaging systems. You can pick up the one that better suits your needs. Source packages are the most complete @@ -43,29 +43,20 @@ with groupID org.orekit and artifactId rugged so maven internal mechanism will download automatically all artifacts and dependencies as required. +#set ( $versions = {"2.2": "2020-07-31", "2.1": "2019-03-14", "2.0": "2017-12-19", "1.0": "2016-02-10"} ) +#foreach( $version in $versions.entrySet() ) -| package | link | -|----------|-----------------------------------------------------------------------------------------------------------| -| source | [`rugged-2.1-sources.zip`](https://gitlab.orekit.org/orekit/rugged/uploads/a8ed096b6e9b5d1088ad135ac29fce9d/rugged-2.1-sources.zip) | -| binary | [`rugged-2.1.jar`](https://gitlab.orekit.org/orekit/rugged/uploads/4b9041f962ed8cd3b55164873bb5c861/rugged-2.1.jar) | -version 2.1 downloads (release date: 2019-03-14) +| package | link | +|----------|---------------------------------------------------------------------------------------------------------------------------------------| +| source | [rugged-${version.key}-sources.jar](https://search.maven.org/remotecontent?filepath=org/orekit/rugged/${version.key}/rugged-${version.key}-sources.jar) | +| binary | [rugged-${version.key}.jar](https://search.maven.org/remotecontent?filepath=org/orekit/rugged/${version.key}/rugged-${version.key}.jar) | +| javadoc | [rugged-${version.key}-javadoc.jar](https://search.maven.org/remotecontent?filepath=org/orekit/rugged/${version.key}/rugged-${version.key}-javadoc.jar) | +version ${version.key} downloads (release date: ${version.value}) -| package | link | -|----------|-----------------------------------------------------------------------------------------------------------| -| source | [`rugged-2.0-sources.zip`](https://gitlab.orekit.org/orekit/rugged/uploads/f7f30111d4d3cef19636cb7c504530dd/rugged-2.0-sources.zip) | -| binary | [`rugged-2.0.jar`](https://gitlab.orekit.org/orekit/rugged/uploads/8393279152c0cad15659e145018fa834/rugged-2.0.jar) | -| javadoc | [`rugged-2.0-javadoc.jar`](https://gitlab.orekit.org/orekit/rugged/uploads/b42c3ef2fcff36aa44570d114102a439/rugged-2.0-javadoc.jar) | -version 2.0 downloads (release date: 2017-12-19) +#end -| package | link | -|----------|-----------------------------------------------------------------------------------------------------------| -| source | [`rugged-1.0-sources.zip`](https://gitlab.orekit.org/orekit/rugged/uploads/0a5e5a39e72dfa94f54c3193170d5ee2/rugged-1.0-sources.zip) | -| binary | [`rugged-1.0.jar`](https://gitlab.orekit.org/orekit/rugged/uploads/55df1454320b8f625c05d9bee5c9abcd/rugged-1.0.jar) | -| javadoc | [`rugged-1.0-javadoc.jar`](https://gitlab.orekit.org/orekit/rugged/uploads/8f7f399b1dd6ebf55b17f9a49fc88782/rugged-1.0-javadoc.jar) | -version 1.0 downloads (release date: 2016-02-10) - -## Data +<h2>Data</h2> For convenience, a zip archive containing some configuration data is available for download. Similar files can be custom made by users with updated data. @@ -76,7 +67,7 @@ file from the forge, to unzip it anywhere you want, rename the `orekit-data-mast into `orekit-data` and add the following lines at the start of your program: File orekitData = new File("/path/to/the/folder/orekit-data"); - DataProvidersManager manager = DataProvidersManager.getInstance(); + DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager(); manager.addProvider(new DirectoryCrawler(orekitData)); This file contains the following data sets. Note that the data is updated only diff --git a/src/site/markdown/faq.md b/src/site/markdown/faq.md index 697867b8a25ae906a2f2495744a547205f1f83cf..77088e7243c2bb33182327165477f34dde77c499 100644 --- a/src/site/markdown/faq.md +++ b/src/site/markdown/faq.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -85,7 +85,7 @@ file from the forge, to unzip it anywhere you want, rename the `orekit-data-mast into `orekit-data` and add the following lines at the start of your program: File orekitData = new File("/path/to/the/folder/orekit-data"); - DataProvidersManager manager = DataProvidersManager.getInstance(); + DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager(); manager.addProvider(new DirectoryCrawler(orekitData)); Using a folder allows one to change the data in it after the initial download, e.g., adding new EOP files as they diff --git a/src/site/markdown/guidelines.md b/src/site/markdown/guidelines.md index fc6746dca77d10d6c01cd87e71bf4de5f310046e..692f03c8e4bd4a555a5854417981137dc8b9396e 100644 --- a/src/site/markdown/guidelines.md +++ b/src/site/markdown/guidelines.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -234,4 +234,4 @@ root directory. fix _all_ errors and warnings found by checkstyle [Top of the page](#top) - \ No newline at end of file + diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index ea5d6286546fefcc09896c0820188bceab18da69..da4f937de519388509304be8c0573628a82769ae 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -98,7 +98,7 @@ interoperability in space systems. ## Maintained library -Rugged has been in development since 2014 inside [CS Systèmes d'Information](http://www.c-s.fr/ "CS SI homepage") +Rugged has been in development since 2014 inside [CS GROUP](http://www.c-s.fr/ "CS GROUP homepage") and is still used and maintained by its dual teams of space dynamics and image processing experts. @@ -106,7 +106,10 @@ Rugged is used for image processing of the Sentinel 2 mission at European Space Agency (ESA), as well as in the frame of ESA Scientific Exploitation of Operational Missions (SEOM), to calculate topographic shadow masks for Sentinel 2 products. -Rugged has been also used as a Research Library by the French Space Agency (CNES) for -study on refining for VHR push broom sensors (Pleiades). +Rugged has been used to validate Airbus Defence and Space (ADS) geolocation library. -[Top of the page](#top) \ No newline at end of file +Rugged has been also used as a Research Library by the French Space Agency (CNES) for refinement studies for VHR push broom sensors (Pleiades). + +Rugged is used for study purposes inside CS GROUP. + +[Top of the page](#top) diff --git a/src/site/markdown/release-guide.md b/src/site/markdown/release-guide.md new file mode 100644 index 0000000000000000000000000000000000000000..238d31ddfd2d4565e6699d1aeeb8e6101a9c2067 --- /dev/null +++ b/src/site/markdown/release-guide.md @@ -0,0 +1,379 @@ +# Rugged Release Guide + +This release guide is largely inspired from [Hipparchus Release +Guide](https://www.hipparchus.org/release-guide.html) and [Orekit Release Guide](https://www.orekit.org/site-orekit-development/release-guide.html). It lists the steps that +have been used in the past to release a new version of Rugged. When in doubt +ask the experts: Sébastien Dinot <sebastien.dinot@csgroup.eu> for website questions +and Luc Maisonobe <luc.maisonobe@csgroup.eu> for everything else. + +## Prerequisites + +1. Obtain private key of the Rugged Signing Key, key id: + `9A928E5485FBC44A2A4F9C2E9128808ECB6C9DED` +2. Register for account on OSSRH and associate it with the Rugged project, see: + https://central.sonatype.org/pages/ossrh-guide.html + +If you need help with either, ask on the [development section of the Rugged +forum](https://forum.orekit.org/c/rugged-development/). + +Once you have a SonaType OSS account, the corresponding credentials must be set +in the `servers` section of your `$HOME/.m2/settings.xml` file, using an id of +`ossrh`: + + <servers> + <server> + <id>ossrh</id> + <username>the user name to connect to the OSS site</username> + <password>the encrypted password</password> + </server> + </servers> + +Use `mvn -ep` to generate an encrypted password. + +## Install Graphviz + +[Graphviz (dot)](https://graphviz.org) is used to generated diagrams of +the technical documentation (static site). + +## Verify the status of develop branch + +Before anything, check on the [continuous integration +site](https://sonar.orekit.org/dashboard?id=org.orekit%3Arugged) that everything is fine on +develop branch: + +* All tests pass; +* Code coverage is up to the requirements; +* There are no bugs, vulnerabilities or code smells. + +If not, fix the warnings and errors first ! + +It is also necessary to check on the [Gitlab CI/CD](https://gitlab.orekit.org/orekit/rugged/pipelines) +that everything is fine on develop branch (i.e. all stages are passed). + +## Prepare Git branch for release + +Release will be performed on a dedicated branch, not directly on master or +develop branch. So a new branch must be created as follows and used for +everything else: + + git branch release-X.Y + git checkout release-X.Y + +## Update maven plugins versions + +Release is a good opportunity to update the maven plugin versions. They are all +gathered at one place, in a set of properties in `rugged/pom.xml`, for instance: + + <rugged.spotbugs-maven-plugin.version>4.0.4</rugged.spotbugs-maven-plugin.version> + <rugged.jacoco-maven-plugin.version>0.8.5</rugged.jacoco-maven-plugin.version> + <rugged.maven-assembly-plugin.version>3.1.1</rugged.maven-assembly-plugin.version> + ... + +You can find the latest version of the plugins using the search feature at +[http://search.maven.org/#search](http://search.maven.org/#search). The +properties name all follow the pattern `rugged.some-plugin-name.version`, the +plugin name should be used in the web form to check for available versions. + +Beware that in some cases, the latest version cannot be used due to +incompatibilities. For example when a plugin was not recently updated and +conflicts appear with newer versions of its dependencies. + +Beware also that some plugins use configuration files that may need update too. +This is typically the case with `maven-checkstyle-plugin` and +`spotbugs-maven-plugin`. The `/checkstyle.xml` and `/spotbugs-exclude-filter.xml` files may need to be checked. + +Before committing these changes, you have to check that everything works. So +run the following command: + + mvn clean + LANG=C mvn -Prelease site + +If something goes wrong, either fix it by changing the plugin configuration or +roll back to an earlier version of the plugin. + +Browse the generated site starting at page `target/site/index.html` and check +that everything is rendered properly. You may also check the contents of the pages. + +When everything runs fine and the generated site is OK, then you can commit the +changes: + + git add rugged/pom.xml rugged/checkstyle.xml rugged/spotbugs-exclude-filter.xml + git commit -m "Updated maven plugins versions." + +## Updating changes.xml + +Finalize the file `src/changes/changes.xml` file. + +The release date and description, which are often only set to `TBD` during +development, must be set to appropriate values. The release date at this step +is only a guess one or two weeks in the future, in order to take into account +the 5 days release vote delay. + +Replace the `TBD` description with a text describing the version released: +state if it is a minor or major version, list the major features introduced by +the version etc (see examples in descriptions of former versions). + +Commit the `changes.xml` file. + + git add src/changes/changes.xml + git commit -m "Updated changes.xml for official release." + +## Updating documentation + +Several files must be updated to take into account the new version: + +| file name | usage | required update | +|-------------------------------------|----------------------------|--------------------------------------------------------------------------------------------------------| +| `src/site/markdown/index.md` | site home page | Update the text about the new features (see changes from **changes.xml**) | +| `src/site/markdown/downloads.md.vm` | downloads links | Declare the new versions, don't forget the date | + +Once the files have been updated, commit the changes: + + git add src/site/markdown/*.md + git commit -m "Updated documentation for the release." + +## Change library version number + +The `pom.xml` file contains the version number of the library. During +development, this version number has the form `X.Y-SNAPSHOT`. For release, the +`-SNAPSHOT` part must be removed. + +Commit the change: + + git add pom.xml + git commit -m "Dropped -SNAPSHOT in version number for official release." + +## Check the JavaDoc + +Depending the JDK version (Oracle, OpenJDK, etc), some JavaDoc warnings can be present. +Make sure there is no JavaDoc warnings by running the following command: + + mvn javadoc:javadoc + +If possible, run the above command with different JDK versions. + +## Tag and sign the git repository + +When all previous steps have been performed, the local git repository holds the +final state of the sources and build files for the release. It must be tagged +and the tag must be signed. Note that before the vote is finished, the tag can +only signed with a `-RCx` suffix to denote Release Candidate. The final tag +without the `-RCx` suffix will be put once the vote succeeds, on the same +commit (which will therefore have two tags). Tagging and signing is done using +the following command, with `-RCn` replaced with the Release Candidate number: + + git tag X.Y-RCn -s -u 9A928E5485FBC44A2A4F9C2E9128808ECB6C9DED -m "Release Candidate n for version X.Y." + +The tag should be verified using command: + + git tag -v X.Y-RCn + +## Pushing the branch and the tag + +When the tag is ready, the branch and the tag must be pushed to Gitlab so +everyone can review it: + + git push --tags origin release-X.Y + +## Static site (technical documentation) + +The static site is generated locally using: + + mvn clean + LANG=C mvn site + +The official site is automatically updated on the hosting platform when work is +merged into branches `develop`, `release-*` or `master`. + +## Generating signed artifacts + +When these settings have been set up, generating the artifacts is done by +running the following commands: + + mvn deploy -DskipStagingRepositoryClose=true -Prelease + +During the generation, maven will trigger gpg which will ask the user for the +pass phrase to access the signing key. If maven didn’t prompt to you, you have to +add `-Dgpg.passphrase=[passphrase]` + +Once the commands ends, log into the SonaType OSS site +[https://oss.sonatype.org/](https://oss.sonatype.org/) and check the staging +repository contains the expected artifacts with associated signatures and +checksums: + +- rugged-X.Y.pom +- rugged-X.Y.jar +- rugged-X.Y-sources.jar +- rugged-X.Y-javadoc.jar + +The signature and checksum files have similar names with added extensions `.asc`, +`.md5` and `.sha1`. + +Sometimes, the deployment to Sonatype OSS site also adds files with double extension +`.asc.md5` and `.asc.sha1`, which are in fact checksum files on a signature file +and serve no purpose and can be deleted. + +Remove `rugged-X.Y.source-jar*` since they are duplicates of the +`rugged-X.Y-sources.jar*` artifacts. Then click the “Close†button. + +## Update Rugged version in Rugged test website + +One edit needs to be made to the Rugged website before calling the vote. Fetch the current code: + + git clone https://gitlab.orekit.org/orekit/website-2015 + +Switch to `develop` branch and edit `_data/rugged/versions.yml` by adding the new version X.Y +to the list. + +Once the modification pushed to develop branch, the [test website](https://test.orekit.org/rugged) will be updated + +## Calling for the vote + +Everything is now ready so the developers and PMC can vote for the release. +Create a post in the [Rugged development category of the forum](https://forum.orekit.org/c/rugged-development/) +with a subject line of the form: + + [VOTE] Releasing Rugged X.Y from release candidate n + +and content of the form: + + This is a VOTE in order to release version X.Y of the Rugged library. + Version X.Y is a maintenance release. + + + Highlights in the X.Y release are: + - feature 1 description + ... + - feature n description + + The release candidate n can be found on the GitLab repository as + tag X.Y-RCn in the release-X.Y branch: + <https://gitlab.orekit.org/orekit/rugged/tree/X.Y-RCn> + + The release notes can be read here: + <https://test.orekit.org/site-rugged-X.Y/changes-report.html> + + Maven artifacts are available at + <https://oss.sonatype.org/content/repositories/orgorekit-xxxx/> + + The votes will be tallied in 120 hours for now, on 20yy-mm-ddThh:mm:00Z + (this is UTC time). + +You should also ping PMC members so they are aware of the vote. Their +vote is essential for a release as per project governance. + +## Failed vote + +If the vote fails, the maven artifacts must be removed from OSS site by +dropping the repository. Then a new release candidate must +be created, with a new number, a new tag and new artifacts. Another vote is +needed for this new release candidate. So make the necessary changes and then +start from the “Tag and sign the git repository†step. + +## Successful vote + +When the vote for a release candidate succeeds, follow the steps below to +publish the release. + +## Tag release version + +As the vote passed, a final signed tag must be added to the succeeding release +candidate, verified and pushed: + + git tag X.Y -s -u 9A928E5485FBC44A2A4F9C2E9128808ECB6C9DED -m "Version X.Y." + git tag -v X.Y + git push --tags + +## Merge release branch into master + +Merge the release branch into the `master` branch to include any changes made. + + git checkout master + git merge --no-ff release-X.Y + +Then commit and push. + +## Merge master branch into develop + +Merge the `master` branch into the `develop` branch to include any changes made. + + git checkout develop + git merge --no-ff master + +Then update the version number to prepare for the next development cycle: + +- edit the pom.xml to update version to a SNAPSHOT, +- make space in the `/src/changes/changes.xml` file for new changes. + +Then commit and push. + +## Publish maven artifacts + +The maven artifacts must be published using OSS site to release the repository. +Select the Rugged repository in "Staging Repositories" and click the “Release†+button in [Nexus Repository Manager](https://oss.sonatype.org/). + +## Upload to Gitlab + +Navigate to Projects > Rugged > Repository > Tags. Find the X.Y tag and +click the edit button to enter release notes. Use the **path** in the [Nexus +repository](https://packages.orekit.org/#browse/browse:maven-releases:org%2Forekit%2Frugged) to +set the artifacts in the release notes. + +- rugged-X.Y.jar +- rugged-X.Y-sources.jar +- rugged-X.Y-javadoc.jar + +Navigate to Projects > Rugged > Project Overview > Releases and make sure it looks nice. + +## Update Rugged website + +Several edits need to be made to the Rugged website after the vote. + +Edit `download/.htaccess` and replace the URLs of the 3 Rugged artifacts +with the ones used to create the release notes. + +Edit `_layouts/home_rugged.html` and edit the text of the button to use the new version. + +Edit `rugged/overview.html` with the new Orekit and Hipparchus versions. Don't forget to update the +rugged/img/overview.png image with the new dependencies. + +Create a new post for the release in `_post/` using as template a previous Rugged post (in order to be published in the Rugged News page). + +Run: + + jekyll serve + +and make sure the website looks nice. View it on http://localhost:4000/ + +## Close X.Y milestone + +In Gitlab, navigate to Projects > Rugged > Issues > Milestones. +Click “Close Milestone†for the line corresponding to the release X.Y. + +## Announce release + +The last step is to announce the release by creating a post in the +[Rugged announcements category of the forum](https://forum.orekit.org/c/rugged-announcements/) +with a subject line of the form: + + Rugged X.Y released + +and content of the form: + + The Rugged team is pleased to announce the release of Rugged version X.Y. + This is a minor/major version, including both new features and bug fixes. + The main changes are: + + - feature 1 description + ... + - feature n description + + This version depends on Orekit X.x and Hipparchus Y.y. + + For complete release notes please see: + https://www.orekit.org/site-rugged-X.Y/changes-report.html + + The maven artifacts are available in maven central. + The source and binaries can be retrieved from the forge releases page: + https://gitlab.orekit.org/orekit/rugged/-/releases diff --git a/src/site/markdown/sources.md b/src/site/markdown/sources.md index 27344b7d3846a03afb0ccb38515719d3d1e224f0..44db518110a8c13d894a52fc775d58a7ed6e13ff 100644 --- a/src/site/markdown/sources.md +++ b/src/site/markdown/sources.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 @@ -52,4 +52,4 @@ tab in Rugged Gitlab. git clone -b develop git@gitlab.orekit.org:orekit/rugged.git -[Top of the page](#top) \ No newline at end of file +[Top of the page](#top) diff --git a/src/site/markdown/tutorials/direct-location-with-DEM.md b/src/site/markdown/tutorials/direct-location-with-DEM.md index 26798b6a9dbee49b2cdb8bbc000d7ecbcc2e02ae..7dde63d46e50e8c751f47b4099482fd34c8d308e 100644 --- a/src/site/markdown/tutorials/direct-location-with-DEM.md +++ b/src/site/markdown/tutorials/direct-location-with-DEM.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/tutorials/direct-location.md b/src/site/markdown/tutorials/direct-location.md index 3b74860cfa93a112a786fed9facdeb2e4c4aee12..f26b31b039fe4911d424be15b9c09d82aca75cf2 100644 --- a/src/site/markdown/tutorials/direct-location.md +++ b/src/site/markdown/tutorials/direct-location.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/tutorials/inverse-location.md b/src/site/markdown/tutorials/inverse-location.md index 72b2cbda670b68e93afca9c0d0538d53662358af..da9a60315d66c6b3443854d3f7fc9c52d832b3e3 100644 --- a/src/site/markdown/tutorials/inverse-location.md +++ b/src/site/markdown/tutorials/inverse-location.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/tutorials/matlab-example.md b/src/site/markdown/tutorials/matlab-example.md index eedd485683bfb58f922bdaaf95d32d1654a8b36c..c664b7534fac45eba077b24b9a537984db81678f 100644 --- a/src/site/markdown/tutorials/matlab-example.md +++ b/src/site/markdown/tutorials/matlab-example.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/markdown/tutorials/tile-updater.md b/src/site/markdown/tutorials/tile-updater.md index 84eedc7a3f2238bafd1d4445556cbafe2d4ade1a..fda9dd34771328605e98a1074071bc5f457d06ec 100644 --- a/src/site/markdown/tutorials/tile-updater.md +++ b/src/site/markdown/tutorials/tile-updater.md @@ -1,4 +1,4 @@ -<!--- Copyright 2013-2019 CS Systèmes d'Information +<!--- Copyright 2013-2020 CS GROUP Licensed 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 diff --git a/src/site/resources/images/rugged-architecture.odg b/src/site/resources/images/rugged-architecture.odg index d359ffba99b6d8372a574dce39a188b2241a7101..de5aeba4847f6441e3d9b1bcd9794ecfb35896b2 100644 Binary files a/src/site/resources/images/rugged-architecture.odg and b/src/site/resources/images/rugged-architecture.odg differ diff --git a/src/site/resources/images/rugged-architecture.png b/src/site/resources/images/rugged-architecture.png index 74d597cf7a5a1050c76803127d15b49ce54fa946..49d69e940a8fa4d661963544d84fba29072af632 100644 Binary files a/src/site/resources/images/rugged-architecture.png and b/src/site/resources/images/rugged-architecture.png differ diff --git a/src/site/site.xml b/src/site/site.xml index 6c5f116c1d01ed471fed3343676325af4b759956..4b9af80723657a8d02610519b7b32804c02e278d 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright 2013-2019 CS Systèmes d'Information + Copyright 2013-2020 CS GROUP Licensed 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 @@ -15,7 +15,7 @@ --> <project name="Rugged"> <bannerLeft> - <name>CS Systèmes d'Information</name> + <name>CS GROUP</name> <src>/images/logo_cs_2008_baseline_ang.jpg</src> <height>180</height> <href>http://www.c-s.fr/</href> @@ -32,16 +32,16 @@ <item name="Building" href="/building.html" /> <item name="Configuration" href="/configuration.html" /> <item name="FAQ" href="/faq.html" /> - <item name="License" href="/licenses.html" /> + <item name="License" href="/licenses.html" /> <item name="Downloads" href="/downloads.html" /> <item name="Changes" href="/changes-report.html" /> <item name="Contact" href="/contact.html" /> </menu> <menu name="Design"> - <item name="Overview" href="/design/overview.html" /> - <item name="Technical choices" href="/design/technical-choices.html" /> - <item name="Digital Elevation Model" href="/design/digital-elevation-model.html" /> - <item name="Design" href="/design/design.html" /> + <item name="Overview" href="/design/overview.html" /> + <item name="Technical choices" href="/design/technical-choices.html" /> + <item name="Digital Elevation Model" href="/design/digital-elevation-model.html" /> + <item name="Design of the major functions" href="/design/design-major-functions.html" /> </menu> <menu name="Tutorials"> <item name="Direct location" href="/tutorials/direct-location.html" /> @@ -53,7 +53,8 @@ <item name="Contributing" href="/contributing.html" /> <item name="Guidelines" href="/guidelines.html" /> <item name="Javadoc" href="/apidocs/index.html" /> - </menu> + <item name="Release guide" href="/release-guide.html" /> + </menu> <menu ref="reports"/> </body> <poweredBy> diff --git a/src/test/java/org/orekit/rugged/TestUtils.java b/src/test/java/org/orekit/rugged/TestUtils.java index 1c8c97e2353361f59c4033f78154f2ac7e4992aa..418a9a1b3b9288e447ebadca51284889d6c1f9ce 100644 --- a/src/test/java/org/orekit/rugged/TestUtils.java +++ b/src/test/java/org/orekit/rugged/TestUtils.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -38,7 +38,7 @@ import org.orekit.bodies.BodyShape; import org.orekit.bodies.CelestialBodyFactory; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel; import org.orekit.forces.gravity.ThirdBodyAttraction; import org.orekit.forces.gravity.potential.GravityFieldFactory; @@ -107,8 +107,8 @@ public class TestUtils { TimeScalesFactory.clearUTCTAIOffsetsLoaders(); GravityFieldFactory.clearPotentialCoefficientsReaders(); GravityFieldFactory.clearOceanTidesReaders(); - DataProvidersManager.getInstance().clearProviders(); - DataProvidersManager.getInstance().clearLoadedDataNames(); + DataContext.getDefault().getDataProvidersManager().clearProviders(); + DataContext.getDefault().getDataProvidersManager().clearLoadedDataNames(); } /** Clean up of factory map diff --git a/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java b/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java index aed3c818e5294399abedbf40e083359da72b2fc8..c5682cb84f8be7f3d254a76627ae99cf59b306d5 100644 --- a/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java b/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java index e6f9d0e4fd6419a359c07efa01670428b5a32516..a28d45fff05a7699721fcf3629ea35bc9f7fa28b 100644 --- a/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java b/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java index ce0739a6403b752c939c8f6bb10f313c3b39751d..be6bcff6e04742467792bd309dea538e00bcb4d0 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java @@ -12,7 +12,7 @@ import org.hipparchus.util.FastMath; import org.junit.Assert; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.orbits.Orbit; @@ -79,7 +79,7 @@ public class InitGroundRefiningTest { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); // Initialize refining context // --------------------------- diff --git a/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java b/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java index ecb5679fbd4889df6b4c5a5388bdae216bca04f5..e9991d95bfbd75b6eb53484dde11c3cd5297d415 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java @@ -8,6 +8,7 @@ import java.util.Arrays; import java.util.List; import org.hipparchus.analysis.differentiation.DerivativeStructure; +import org.hipparchus.analysis.differentiation.Gradient; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.random.GaussianRandomGenerator; import org.hipparchus.random.UncorrelatedRandomVectorGenerator; @@ -17,7 +18,7 @@ import org.junit.After; import org.junit.Assert; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.orbits.Orbit; @@ -33,7 +34,7 @@ import org.orekit.rugged.api.Rugged; import org.orekit.rugged.api.RuggedBuilder; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.rugged.utils.SpacecraftToObservedBody; import org.orekit.time.AbsoluteDate; import org.orekit.utils.AngularDerivativesFilter; @@ -104,7 +105,7 @@ public class InitInterRefiningTest { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); // Initialize refining context // --------------------------- @@ -268,11 +269,29 @@ public class InitInterRefiningTest { * @param realPixelA real pixel from sensor A * @param realPixelB real pixel from sensor B * @return the distances of two real pixels computed between LOS and to the ground + * @deprecated as of 2.2, replaced by {@link #computeDistancesBetweenLOSGradient(SensorPixel, SensorPixel, double, double)} */ public DerivativeStructure[] computeDistancesBetweenLOSDerivatives(final SensorPixel realPixelA, final SensorPixel realPixelB, - double losDistance, double earthDistance) + final double losDistance, final double earthDistance) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { - + final Gradient[] gradient = computeDistancesBetweenLOSGradient(realPixelA, realPixelB, losDistance, earthDistance); + final DerivativeStructure[] ds = new DerivativeStructure[gradient.length]; + for (int i = 0; i < gradient.length; ++i) { + ds[i] = gradient[i].toDerivativeStructure(); + } + return ds; + } + + /** Compute the distances with derivatives between LOS of two real pixels (one from sensor A and one from sensor B) + * @param realPixelA real pixel from sensor A + * @param realPixelB real pixel from sensor B + * @return the distances of two real pixels computed between LOS and to the ground + * @since 2.2 + */ + public Gradient[] computeDistancesBetweenLOSGradient(final SensorPixel realPixelA, final SensorPixel realPixelB, + final double losDistance, final double earthDistance) + throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + final SpacecraftToObservedBody scToBodyA = ruggedA.getScToBody(); final AbsoluteDate realDateA = lineSensorA.getDate(realPixelA.getLineNumber()); @@ -301,15 +320,14 @@ public class InitInterRefiningTest { listLineSensor.addAll(ruggedA.getLineSensors()); listLineSensor.addAll(ruggedB.getLineSensors()); - DSGenerator generator = (DSGenerator) createGenerator.invoke(optimizationPbBuilder, listLineSensor); + @SuppressWarnings("unchecked") + DerivativeGenerator<Gradient> generator = (DerivativeGenerator<Gradient>) createGenerator.invoke(optimizationPbBuilder, listLineSensor); - final DerivativeStructure[] distanceLOSwithDS = ruggedB.distanceBetweenLOSderivatives( - lineSensorA, realDateA, realPixelA.getPixelNumber(), - scToBodyA, - lineSensorB, realDateB, realPixelB.getPixelNumber(), - generator); + return ruggedB.distanceBetweenLOSderivatives(lineSensorA, realDateA, realPixelA.getPixelNumber(), + scToBodyA, + lineSensorB, realDateB, realPixelB.getPixelNumber(), + generator); - return distanceLOSwithDS; } /** Generate noisy measurements (sensor to sensor mapping) diff --git a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java index bce3be642ac73371c432a4c326badb470f0cd367..f24730bda5eee803bbd53af9ca1afa73f77473f8 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -46,7 +46,7 @@ import org.orekit.bodies.BodyShape; import org.orekit.bodies.CelestialBodyFactory; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel; import org.orekit.forces.gravity.ThirdBodyAttraction; @@ -99,7 +99,7 @@ public class RuggedBuilderTest { throws URISyntaxException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); AbsoluteDate t0 = new AbsoluteDate("2012-01-01T00:00:00", TimeScalesFactory.getUTC()); List<TimeStampedPVCoordinates> pv = Arrays.asList( @@ -315,7 +315,7 @@ public class RuggedBuilderTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); BodyShape earth = createEarth(); NormalizedSphericalHarmonicsProvider gravityField = createGravityField(); Orbit orbit = createOrbit(gravityField.getMu()); @@ -360,7 +360,7 @@ public class RuggedBuilderTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); AbsoluteDate t0 = new AbsoluteDate("2012-01-01T00:00:00", TimeScalesFactory.getUTC()); List<TimeStampedPVCoordinates> pv = Arrays.asList( @@ -464,7 +464,7 @@ public class RuggedBuilderTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = createEarth(); final Orbit orbit = createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -533,7 +533,7 @@ public class RuggedBuilderTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = createEarth(); final Orbit orbit = createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -583,7 +583,7 @@ public class RuggedBuilderTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = createEarth(); final Orbit orbit = createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -642,7 +642,7 @@ public class RuggedBuilderTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); // the following array is a real serialization file corresponding to the following // made-up empty class that does not exist in Rugged: diff --git a/src/test/java/org/orekit/rugged/api/RuggedTest.java b/src/test/java/org/orekit/rugged/api/RuggedTest.java index 0b2b555a2f79efde76578bd2ac73e2e828fc98e1..cd8aae3f4f3f95bc64e7b56894fc2eb6032b2c78 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -35,8 +35,8 @@ import java.util.List; import java.util.Locale; import org.hipparchus.analysis.differentiation.DSFactory; -import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator; +import org.hipparchus.analysis.differentiation.Gradient; import org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction; import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; @@ -52,7 +52,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider; @@ -77,7 +77,7 @@ import org.orekit.rugged.los.TimeDependentLOS; import org.orekit.rugged.raster.RandomLandscapeUpdater; import org.orekit.rugged.raster.TileUpdater; import org.orekit.rugged.raster.VolcanicConeElevationUpdater; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScale; import org.orekit.time.TimeScalesFactory; @@ -106,7 +106,7 @@ public class RuggedTest { int dimension = 2000; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); BodyShape earth = TestUtils.createEarth(); NormalizedSphericalHarmonicsProvider gravityField = TestUtils.createGravityField(); Orbit orbit = TestUtils.createOrbit(gravityField.getMu()); @@ -196,7 +196,7 @@ public class RuggedTest { int dimension = 400; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -274,7 +274,7 @@ public class RuggedTest { int dimension = 400; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -331,7 +331,7 @@ public class RuggedTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -393,7 +393,7 @@ public class RuggedTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -451,7 +451,7 @@ public class RuggedTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -512,7 +512,7 @@ public class RuggedTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -577,7 +577,7 @@ public class RuggedTest { int nbSensors = 3; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -708,7 +708,7 @@ public class RuggedTest { public void testInverseLocNearLineEnd() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); Vector3D offset = Vector3D.ZERO; TimeScale gps = TimeScalesFactory.getGPS(); Frame eme2000 = FramesFactory.getEME2000(); @@ -810,7 +810,7 @@ public class RuggedTest { public void testInverseLoc() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); Vector3D offset = Vector3D.ZERO; TimeScale gps = TimeScalesFactory.getGPS(); Frame eme2000 = FramesFactory.getEME2000(); @@ -911,7 +911,7 @@ public class RuggedTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -967,7 +967,7 @@ public class RuggedTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -1081,7 +1081,7 @@ public class RuggedTest { public void testInverseLocationDerivativesWithAllCorrections() { doTestInverseLocationDerivatives(2000, true, true, - 3.0e-10, 5.0e-10, 2.0e-12, 7.0e-8); + 7.0e-10, 5.0e-10, 2.0e-12, 7.0e-8); } /** @@ -1104,7 +1104,7 @@ public class RuggedTest { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -1170,7 +1170,8 @@ public class RuggedTest { java.lang.reflect.Method getGenerator = GroundOptimizationProblemBuilder.class.getSuperclass().getDeclaredMethod("getGenerator"); getGenerator.setAccessible(true); - DSGenerator generator = (DSGenerator) getGenerator.invoke(optimizationPbBuilder); + @SuppressWarnings("unchecked") + DerivativeGenerator<Gradient> generator = (DerivativeGenerator<Gradient>) getGenerator.invoke(optimizationPbBuilder); double referenceLine = 0.87654 * dimension; GeodeticPoint[] gp = rugged.directLocation("line", referenceLine); @@ -1178,13 +1179,13 @@ public class RuggedTest { Method inverseLoc = Rugged.class.getDeclaredMethod("inverseLocationDerivatives", String.class, GeodeticPoint.class, Integer.TYPE, Integer.TYPE, - DSGenerator.class); + DerivativeGenerator.class); inverseLoc.setAccessible(true); int referencePixel = (3 * dimension) / 4; - DerivativeStructure[] result = - (DerivativeStructure[]) inverseLoc.invoke(rugged, - "line", gp[referencePixel], 0, dimension, - generator); + Gradient[] result = + (Gradient[]) inverseLoc.invoke(rugged, + "line", gp[referencePixel], 0, dimension, + generator); Assert.assertEquals(referenceLine, result[0].getValue(), lineTolerance); Assert.assertEquals(referencePixel, result[1].getValue(), pixelTolerance); Assert.assertEquals(2, result[0].getFreeParameters()); @@ -1245,7 +1246,7 @@ public class RuggedTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -1324,7 +1325,7 @@ public class RuggedTest { throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); AbsoluteDate crossing = new AbsoluteDate("2012-01-01T12:30:00.000", TimeScalesFactory.getUTC()); @@ -1388,27 +1389,27 @@ public class RuggedTest { // Expected derivatives for // minimum distance between LOS - double[] expectedDminDerivatives = {3.88800245, -153874.01319097, -678866.03112033, 191294.06938169, 668600.16715270} ; + double[] expectedDminDerivatives = {-153874.01319097, -678866.03112033, 191294.06938169, 668600.16715270} ; // minimum distance to the ground - double[] expectedDcentralBodyDerivatives = {6368020.55910153, 7007767.46926062, -1577060.82402054, -6839286.39593802, 1956452.66636262}; + double[] expectedDcentralBodyDerivatives = {7007767.46926062, -1577060.82402054, -6839286.39593802, 1956452.66636262}; - DerivativeStructure[] distancesBetweenLOSwithDS = refiningTest.computeDistancesBetweenLOSDerivatives(realPixelA, realPixelB, expectedDistanceBetweenLOS, expectedDistanceToTheGround); + Gradient[] distancesBetweenLOSGradient = refiningTest.computeDistancesBetweenLOSGradient(realPixelA, realPixelB, expectedDistanceBetweenLOS, expectedDistanceToTheGround); // Minimum distance between LOS - DerivativeStructure dMin = distancesBetweenLOSwithDS[0]; + Gradient dMin = distancesBetweenLOSGradient[0]; // Minimum distance to the ground - DerivativeStructure dCentralBody = distancesBetweenLOSwithDS[1]; + Gradient dCentralBody = distancesBetweenLOSGradient[1]; Assert.assertEquals(expectedDistanceBetweenLOS, dMin.getValue(), 1.e-8); Assert.assertEquals(expectedDistanceToTheGround, dCentralBody.getValue() , 1.e-5); - for (int i = 0; i < dMin.getAllDerivatives().length; i++) { - Assert.assertEquals(expectedDminDerivatives[i], dMin.getAllDerivatives()[i], 1.e-8); + for (int i = 0; i < dMin.getFreeParameters(); i++) { + Assert.assertEquals(expectedDminDerivatives[i], dMin.getPartialDerivative(i), 1.e-8); } - for (int i = 0; i < dCentralBody.getAllDerivatives().length; i++) { - Assert.assertEquals(expectedDcentralBodyDerivatives[i], dCentralBody.getAllDerivatives()[i], 1.e-8); + for (int i = 0; i < dCentralBody.getFreeParameters(); i++) { + Assert.assertEquals(expectedDcentralBodyDerivatives[i], dCentralBody.getPartialDerivative(i), 3.e-8); } } @@ -1418,7 +1419,7 @@ public class RuggedTest { int dimension = 400; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -1464,6 +1465,9 @@ public class RuggedTest { // Get the algorithm assertTrue(rugged.getAlgorithm().getClass().isInstance(new IgnoreDEMAlgorithm())); + // Get the algorithm Id + assertEquals(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID, rugged.getAlgorithmId()); + // Change the min and max line in inverse location to update the SensorMeanPlaneCrossing when the planeCrossing is not null int minLine = firstLine; int maxLine = lastLine; diff --git a/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java b/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java index a4b626afdf60bee541a3d1c59fe69af29c389fa6..92d4f041164013032469c6e0f04b3b7bef1d0ace 100644 --- a/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java +++ b/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -33,7 +33,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.orbits.Orbit; import org.orekit.rugged.TestUtils; @@ -150,7 +150,7 @@ public class DumpManagerTest { int dimension = 200; String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); @@ -234,9 +234,7 @@ public class DumpManagerTest { @Test public void testWriteError() throws URISyntaxException, IOException { try { - File dump = tempFolder.newFile(); - dump.setReadOnly(); - DumpManager.activate(dump); + DumpManager.activate(tempFolder.getRoot()); Assert.fail("an exception should have been thrown"); } catch (RuggedException re) { Assert.assertEquals(RuggedMessages.DEBUG_DUMP_ACTIVATION_ERROR, re.getSpecifier()); diff --git a/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java b/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java index 6b75ff3c25d7e7899e6fa6d1e7039dac56508f67..dd0330c9494c178a12df4fc12c0b9c8dbe809ada 100644 --- a/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java +++ b/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -48,12 +48,12 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.linesensor.SensorPixel; import org.orekit.rugged.refraction.MultiLayerModel; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScalesFactory; import org.orekit.utils.ParameterDriver; @@ -67,7 +67,7 @@ public class DumpReplayerTest { public void testDirectLoc01() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-01.txt").toURI().getPath(); DumpReplayer replayer = new DumpReplayer(); @@ -90,7 +90,7 @@ public class DumpReplayerTest { public void testDirectLoc02() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-02.txt").toURI().getPath(); DumpReplayer replayer = new DumpReplayer(); @@ -113,7 +113,7 @@ public class DumpReplayerTest { public void testDirectLoc03() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-03.txt").toURI().getPath(); DumpReplayer replayer = new DumpReplayer(); @@ -136,7 +136,7 @@ public class DumpReplayerTest { public void testDirectLoc04() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-04.txt").toURI().getPath(); File dump = tempFolder.newFile(); @@ -167,7 +167,7 @@ public class DumpReplayerTest { public void testDirectLocNull() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -194,7 +194,7 @@ public class DumpReplayerTest { public void testInverseLoc01() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-inverse-loc-01.txt").toURI().getPath(); DumpReplayer replayer = new DumpReplayer(); @@ -216,7 +216,7 @@ public class DumpReplayerTest { public void testInverseLoc02() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-inverse-loc-02.txt").toURI().getPath(); DumpReplayer replayer = new DumpReplayer(); @@ -238,7 +238,7 @@ public class DumpReplayerTest { public void testInverseLoc03() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-inverse-loc-03.txt").toURI().getPath(); DumpReplayer replayer = new DumpReplayer(); @@ -260,7 +260,7 @@ public class DumpReplayerTest { public void testInverseLocNull() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -284,7 +284,7 @@ public class DumpReplayerTest { public void testCorruptedFiles() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File folder = new File(getClass().getClassLoader().getResource("replay/replay-direct-loc-01.txt").toURI().getPath()).getParentFile(); for (final File file : folder.listFiles()) { @@ -336,7 +336,7 @@ public class DumpReplayerTest { public void testDirectLocIssue376_01() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-Issue376-01.txt").toURI().getPath(); @@ -356,7 +356,7 @@ public class DumpReplayerTest { public void testDirectLocIssue376_02() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-Issue376-02.txt").toURI().getPath(); @@ -376,7 +376,7 @@ public class DumpReplayerTest { public void testDirectLocIssue376_03() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-direct-loc-Issue376-03.txt").toURI().getPath(); @@ -398,7 +398,7 @@ public class DumpReplayerTest { public void testCreateRuggedWithAtmosphere() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -423,7 +423,7 @@ public class DumpReplayerTest { public void testCreateRuggedNoDEMdata() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -456,7 +456,7 @@ public class DumpReplayerTest { public void testLineParserBadKey() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -485,7 +485,7 @@ public class DumpReplayerTest { public void testLineParserEndColon() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -510,7 +510,7 @@ public class DumpReplayerTest { public void testLineParserNoColon() throws URISyntaxException, IOException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); File tempFile = tempFolder.newFile(); try (FileOutputStream fos = new FileOutputStream(tempFile); @@ -537,7 +537,7 @@ public class DumpReplayerTest { InvocationTargetException, NoSuchMethodException, SecurityException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); // ParsedSensor inner class Class<?> innerClass = Class.forName("org.orekit.rugged.errors.DumpReplayer$ParsedSensor"); @@ -590,7 +590,7 @@ public class DumpReplayerTest { InvocationTargetException, NoSuchMethodException, SecurityException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); // ParsedSensor inner class Class<?> innerClass = Class.forName("org.orekit.rugged.errors.DumpReplayer$ParsedSensor"); @@ -620,7 +620,7 @@ public class DumpReplayerTest { InvocationTargetException, NoSuchMethodException, SecurityException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); // ParsedSensor inner class Class<?> innerClass = Class.forName("org.orekit.rugged.errors.DumpReplayer$ParsedSensor"); @@ -643,11 +643,11 @@ public class DumpReplayerTest { // ParsedSensor.getLOSDerivatives // Needs some LOS to be set - Method getLOSDerivatives = innerClass.getDeclaredMethod("getLOSDerivatives", int.class, AbsoluteDate.class, DSGenerator.class); + Method getLOSDerivatives = innerClass.getDeclaredMethod("getLOSDerivatives", int.class, AbsoluteDate.class, DerivativeGenerator.class); getLOSDerivatives.setAccessible(true); final DSFactory factory = new DSFactory(1, 1); - DSGenerator generator = new DSGenerator() { + DerivativeGenerator<DerivativeStructure> generator = new DerivativeGenerator<DerivativeStructure>() { @Override public List<ParameterDriver> getSelected() { return null; diff --git a/src/test/java/org/orekit/rugged/errors/DumpTest.java b/src/test/java/org/orekit/rugged/errors/DumpTest.java index a6d14929ec8524ac0a5df5b88dd6b2508c60ded8..fd79d081fd193a552da563f57ce2810f22902416 100644 --- a/src/test/java/org/orekit/rugged/errors/DumpTest.java +++ b/src/test/java/org/orekit/rugged/errors/DumpTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -33,7 +33,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.frames.Frame; import org.orekit.frames.FramesFactory; @@ -126,7 +126,7 @@ public class DumpTest { IllegalArgumentException, InvocationTargetException, IOException, URISyntaxException { String orekitPath = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(orekitPath))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(orekitPath))); String dumpPath = getClass().getClassLoader().getResource("replay/replay-inverse-loc-02.txt").toURI().getPath(); diff --git a/src/test/java/org/orekit/rugged/errors/RuggedExceptionTest.java b/src/test/java/org/orekit/rugged/errors/RuggedExceptionTest.java index 1a4025063a6aa4a172e8195e7d6fa56dba05b5d7..5a65a3983703e9bf04dd141aca27bc6dd6eee0a8 100644 --- a/src/test/java/org/orekit/rugged/errors/RuggedExceptionTest.java +++ b/src/test/java/org/orekit/rugged/errors/RuggedExceptionTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/errors/RuggedMessagesTest.java b/src/test/java/org/orekit/rugged/errors/RuggedMessagesTest.java index af285d19e697ed5a7933d9fd358c242608ed134e..3a3c98a321a07f7da13560e0b1ddcda82ae6b88c 100644 --- a/src/test/java/org/orekit/rugged/errors/RuggedMessagesTest.java +++ b/src/test/java/org/orekit/rugged/errors/RuggedMessagesTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java index b7741d2e56195829ff2ecaada0fc60d155f7c846..6503cf02233dc5d59996f7e8a348de841e65b109 100644 --- a/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -30,7 +30,7 @@ import org.junit.Before; import org.junit.Test; import org.orekit.attitudes.Attitude; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.frames.FramesFactory; import org.orekit.frames.Transform; @@ -271,7 +271,7 @@ public abstract class AbstractAlgorithmTest { public void setUp() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); earth = new ExtendedEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true)); diff --git a/src/test/java/org/orekit/rugged/intersection/BasicScanAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/BasicScanAlgorithmTest.java index a5bfe3a1a3cf8abe812a013ab9798a7f7368c36f..8584941939aee3ce27a9226da3304a9c64dee113 100644 --- a/src/test/java/org/orekit/rugged/intersection/BasicScanAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/BasicScanAlgorithmTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -17,8 +17,10 @@ package org.orekit.rugged.intersection; -import org.orekit.rugged.intersection.BasicScanAlgorithm; -import org.orekit.rugged.intersection.IntersectionAlgorithm; +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.raster.TileUpdater; public class BasicScanAlgorithmTest extends AbstractAlgorithmTest { @@ -27,4 +29,10 @@ public class BasicScanAlgorithmTest extends AbstractAlgorithmTest { return new BasicScanAlgorithm(updater, maxCachedTiles); } + @Test + public void testAlgorithmId() { + setUpMayonVolcanoContext(); + final IntersectionAlgorithm algorithm = createAlgorithm(updater, 8); + assertEquals(AlgorithmId.BASIC_SLOW_EXHAUSTIVE_SCAN_FOR_TESTS_ONLY, algorithm.getAlgorithmId()); + } } diff --git a/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java index a9360c60fcd29b9cd8aef268bb98a6db60b7da66..af5933c68a53a6d34a4a07586c56c826a485823d 100644 --- a/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -17,6 +17,8 @@ package org.orekit.rugged.intersection; +import static org.junit.Assert.assertEquals; + import java.io.File; import java.net.URISyntaxException; @@ -28,11 +30,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.orekit.attitudes.Attitude; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.frames.FramesFactory; import org.orekit.orbits.CartesianOrbit; import org.orekit.propagation.SpacecraftState; +import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.intersection.duvenhage.DuvenhageAlgorithm; import org.orekit.rugged.raster.CheckedPatternElevationUpdater; import org.orekit.rugged.raster.TileUpdater; @@ -96,11 +99,20 @@ public class ConstantElevationAlgorithmTest { double elevation0 = ignore.getElevation(gpRef.getLatitude(), gpConst.getLatitude()); Assert.assertEquals(elevation0, 0.0, 1.e-15); } + + @Test + public void testAlgorithmId() { + IntersectionAlgorithm constantElevation = new ConstantElevationAlgorithm(0.0); + assertEquals(AlgorithmId.CONSTANT_ELEVATION_OVER_ELLIPSOID, constantElevation.getAlgorithmId()); + + IntersectionAlgorithm ignore = new IgnoreDEMAlgorithm(); + assertEquals(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID, ignore.getAlgorithmId()); + } @Before public void setUp() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); earth = new ExtendedEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getITRF(IERSConventions.IERS_2010, true)); diff --git a/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java index 9a23632c14f3fba5cffb2bb51c264f8a79c5b3c5..55830c25d237d94f705758f75afb5b601c663fdc 100644 --- a/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -19,6 +19,9 @@ package org.orekit.rugged.intersection.duvenhage; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; + +import static org.junit.Assert.assertEquals; + import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -27,6 +30,7 @@ import org.junit.Assert; import org.junit.Test; import org.orekit.bodies.GeodeticPoint; import org.orekit.errors.OrekitException; +import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.intersection.AbstractAlgorithmTest; @@ -191,6 +195,17 @@ public class DuvenhageAlgorithmTest extends AbstractAlgorithmTest { 1.0e-6); } + + @Test + public void testAlgorithmId() { + setUpMayonVolcanoContext(); + + final IntersectionAlgorithm algorithm = new DuvenhageAlgorithm(updater, 8, false); + assertEquals(AlgorithmId.DUVENHAGE, algorithm.getAlgorithmId()); + + final IntersectionAlgorithm algorithmFlatBody = new DuvenhageAlgorithm(updater, 8, true); + assertEquals(AlgorithmId.DUVENHAGE_FLAT_BODY, algorithmFlatBody.getAlgorithmId()); + } private NormalizedGeodeticPoint findExit(IntersectionAlgorithm algorithm, Tile tile, Vector3D position, Vector3D los) { diff --git a/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java b/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java index 78b87a5278febd633fa0bcb9d7fc9a27ec933008..06532770e7b7d7f767749744e732699f1733b385 100644 --- a/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java +++ b/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java b/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java index 571c8ac85a1978a567dda09f599008838d56890f..cad43aeaac0cacb56540a6b8fa05bab3838ea67a 100644 --- a/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java +++ b/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -40,7 +40,7 @@ import org.junit.Test; import org.orekit.rugged.los.FixedRotation; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.TimeDependentLOS; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; @@ -158,7 +158,7 @@ public class FixedRotationTest { driver.setSelected(true); } final DSFactory factoryS = new DSFactory(selected.size(), 1); - DSGenerator generator = new DSGenerator() { + DerivativeGenerator<DerivativeStructure> generator = new DerivativeGenerator<DerivativeStructure>() { /** {@inheritDoc} */ @Override diff --git a/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java b/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java index 7c095bfd2bef5ea8c373887400bc5db22143baa1..338bb26d6dc1fed2eed8cfd552436c30197f636f 100644 --- a/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java +++ b/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -21,10 +21,13 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; +import org.hipparchus.Field; import org.hipparchus.analysis.UnivariateMatrixFunction; import org.hipparchus.analysis.differentiation.DSFactory; import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator; +import org.hipparchus.analysis.differentiation.Gradient; +import org.hipparchus.analysis.differentiation.GradientField; import org.hipparchus.analysis.differentiation.UnivariateDifferentiableMatrixFunction; import org.hipparchus.analysis.polynomials.PolynomialFunction; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; @@ -41,7 +44,7 @@ import org.junit.Test; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.PolynomialRotation; import org.orekit.rugged.los.TimeDependentLOS; -import org.orekit.rugged.utils.DSGenerator; +import org.orekit.rugged.utils.DerivativeGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; @@ -173,8 +176,8 @@ public class PolynomialRotationTest { for (final ParameterDriver driver : selected) { driver.setSelected(true); } - final DSFactory factoryS = new DSFactory(selected.size(), 1); - DSGenerator generator = new DSGenerator() { + final GradientField field = GradientField.getField(selected.size()); + DerivativeGenerator<Gradient> generator = new DerivativeGenerator<Gradient>() { /** {@inheritDoc} */ @Override @@ -184,23 +187,29 @@ public class PolynomialRotationTest { /** {@inheritDoc} */ @Override - public DerivativeStructure constant(final double value) { - return factoryS.constant(value); + public Gradient constant(final double value) { + return Gradient.constant(selected.size(), value); } /** {@inheritDoc} */ @Override - public DerivativeStructure variable(final ParameterDriver driver) { + public Gradient variable(final ParameterDriver driver) { int index = 0; for (ParameterDriver d : getSelected()) { if (d == driver) { - return factoryS.variable(index, driver.getValue()); + return Gradient.variable(selected.size(), index, driver.getValue()); } ++index; } return constant(driver.getValue()); } + /** {@inheritDoc} */ + @Override + public Field<Gradient> getField() { + return field; + } + }; Assert.assertEquals(7, generator.getSelected().size()); @@ -226,7 +235,7 @@ public class PolynomialRotationTest { DerivativeStructure[][] mDS = f.value(factory11.variable(0, driver.getValue())); for (int i = 0; i < raw.size(); ++i) { Vector3D los = tdl.getLOS(i, date); - FieldVector3D<DerivativeStructure> losDS = tdl.getLOSDerivatives(i, date, generator); + FieldVector3D<Gradient> losDS = tdl.getLOSDerivatives(i, date, generator); Assert.assertEquals(los.getX(), losDS.getX().getValue(), 2.0e-15); Assert.assertEquals(los.getY(), losDS.getY().getValue(), 2.0e-15); Assert.assertEquals(los.getZ(), losDS.getZ().getValue(), 2.0e-15); diff --git a/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java b/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java index d80aa5d8805ef42cf844053b6bad383326dcbddf..9107078602bfd311812dc4fd407ff33d9d07f6c9 100644 --- a/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java +++ b/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -36,7 +36,7 @@ import org.orekit.attitudes.YawCompensation; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.frames.FramesFactory; import org.orekit.frames.Transform; @@ -202,8 +202,8 @@ public class SensorMeanPlaneCrossingTest { Assert.assertTrue(result.getLine() - refLine > 1.9); } else { // the simple model from which reference results have been compute applies here - Assert.assertEquals(refLine, result.getLine(), 7.0e-14 * refLine); - Assert.assertEquals(0.0, result.getDate().durationFrom(refDate), 2.0e-13); + Assert.assertEquals(refLine, result.getLine(), 5.0e-11* refLine); + Assert.assertEquals(0.0, result.getDate().durationFrom(refDate), 1.0e-9); Assert.assertEquals(0.0, Vector3D.angle(los.get(refPixel), result.getTargetDirection()), 5.4e-15); } @@ -351,7 +351,7 @@ public class SensorMeanPlaneCrossingTest { public void setUp() throws URISyntaxException { TestUtils.clearFactories(); String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); } } diff --git a/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java b/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java index f450c008ba370290e35c4d335ed8839a9403b928..2768168fa710d1d2043326d3c872e45758cca902 100644 --- a/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java b/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java index 0a5e9b9bc54d5275d4304dd8b2ac8cfceb573cfe..75961fbc3cf6e85cbcf9bf40947193fcf1365b17 100644 --- a/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/raster/CountingFactory.java b/src/test/java/org/orekit/rugged/raster/CountingFactory.java index 7256f0e59f250cd23f4ca78f39bd1429419334c9..03bbad8e8d09b83d1c4a36d51134d703f07da4c0 100644 --- a/src/test/java/org/orekit/rugged/raster/CountingFactory.java +++ b/src/test/java/org/orekit/rugged/raster/CountingFactory.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -16,10 +16,6 @@ */ package org.orekit.rugged.raster; -import org.orekit.rugged.raster.SimpleTile; -import org.orekit.rugged.raster.SimpleTileFactory; -import org.orekit.rugged.raster.TileFactory; - public class CountingFactory implements TileFactory<SimpleTile> { private int count; diff --git a/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java b/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java index 0b29e0b8552be6bbd23deea2acacf0ae84a7d272..2ba204cd2a431559607d36c0277366b8a52b910a 100644 --- a/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/raster/SimpleTileTest.java b/src/test/java/org/orekit/rugged/raster/SimpleTileTest.java index ceea009d15237ab357a189734d03c1a57eeea58f..a5b219ed3328bcb73862adc3823432512042db4d 100644 --- a/src/test/java/org/orekit/rugged/raster/SimpleTileTest.java +++ b/src/test/java/org/orekit/rugged/raster/SimpleTileTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -23,9 +23,6 @@ import org.junit.Test; import org.orekit.bodies.GeodeticPoint; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; -import org.orekit.rugged.raster.SimpleTile; -import org.orekit.rugged.raster.SimpleTileFactory; -import org.orekit.rugged.raster.Tile; import org.orekit.rugged.raster.Tile.Location; public class SimpleTileTest { diff --git a/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java b/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java index 4f3d8ffb670e2882f1222c9e830df8a54b1f4129..8e588239dcfc282c04deeb3fd965d82600bf426b 100644 --- a/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java +++ b/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java b/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java index 71e605ea69a02d3dea9a33641038dbcc311a3297..2425d01f234047a96c7a29f4c5a3409cb907a078 100644 --- a/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/refraction/AtmosphericRefractionTest.java b/src/test/java/org/orekit/rugged/refraction/AtmosphericRefractionTest.java index dda307f328f287f934e0359e0e194c5a1b9a9562..ab6bf69e7559d8eb023457a99160e83ef2308687 100644 --- a/src/test/java/org/orekit/rugged/refraction/AtmosphericRefractionTest.java +++ b/src/test/java/org/orekit/rugged/refraction/AtmosphericRefractionTest.java @@ -17,7 +17,7 @@ import org.junit.Assert; import org.junit.Test; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.orbits.Orbit; import org.orekit.rugged.TestUtils; @@ -128,7 +128,7 @@ public class AtmosphericRefractionTest { private RuggedBuilder initRuggedForAtmosphericTests(final int dimension, final String sensorName) throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); final BodyShape earth = TestUtils.createEarth(); final Orbit orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); diff --git a/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java b/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java index cadca6e1c02a12940ec4144ff8f5d6091aef13f9..9436db32754085a5d7203535d4c541ab7aba8455 100644 --- a/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java +++ b/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/utils/ExtendedEllipsoidTest.java b/src/test/java/org/orekit/rugged/utils/ExtendedEllipsoidTest.java index c065f18c3d78ba4e50c6cb33e87a91d268106af9..90848214b940304353f9d7ac828288af3d3d64ee 100644 --- a/src/test/java/org/orekit/rugged/utils/ExtendedEllipsoidTest.java +++ b/src/test/java/org/orekit/rugged/utils/ExtendedEllipsoidTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -16,25 +16,24 @@ */ package org.orekit.rugged.utils; -import org.hipparchus.geometry.euclidean.threed.Line; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.util.FastMath; import java.io.File; import java.net.URISyntaxException; +import org.hipparchus.geometry.euclidean.threed.Line; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; import org.orekit.frames.FramesFactory; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; -import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.utils.Constants; import org.orekit.utils.IERSConventions; @@ -287,7 +286,7 @@ public class ExtendedEllipsoidTest { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true); ellipsoid = new ExtendedEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, diff --git a/src/test/java/org/orekit/rugged/utils/GeodeticUtilities.java b/src/test/java/org/orekit/rugged/utils/GeodeticUtilities.java index 3b8ea48e7c8cd14ba18a3d3d57de253d964f934b..9c203d5d8b50b548e4bd82f13c16b687d5ae5164 100644 --- a/src/test/java/org/orekit/rugged/utils/GeodeticUtilities.java +++ b/src/test/java/org/orekit/rugged/utils/GeodeticUtilities.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -262,4 +262,4 @@ enum CardinalDirection { } return null; } -} \ No newline at end of file +} diff --git a/src/test/java/org/orekit/rugged/utils/NormalizedGeodeticPointTest.java b/src/test/java/org/orekit/rugged/utils/NormalizedGeodeticPointTest.java index c607cc844f17557e2689a8e34dba616802a0d2f6..1b60d7a06155fd201cc38833aec80f833ce0e418 100644 --- a/src/test/java/org/orekit/rugged/utils/NormalizedGeodeticPointTest.java +++ b/src/test/java/org/orekit/rugged/utils/NormalizedGeodeticPointTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java b/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java index f6e782b92650c36724e5ecff681c1e41dd5777d6..e26b8eaf21381954906f9a64544905e0116e9b14 100644 --- a/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java +++ b/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -34,7 +34,7 @@ import org.orekit.bodies.BodyShape; import org.orekit.bodies.CelestialBodyFactory; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel; @@ -63,7 +63,7 @@ public class RoughVisibilityEstimatorTest { public void testThreeOrbitsSpan() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); BodyShape earth = createEarth(); NormalizedSphericalHarmonicsProvider gravityField = createGravityField(); Orbit orbit = createOrbit(gravityField.getMu()); @@ -88,7 +88,7 @@ public class RoughVisibilityEstimatorTest { public void testOneOrbitsSpan() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); BodyShape earth = createEarth(); NormalizedSphericalHarmonicsProvider gravityField = createGravityField(); Orbit orbit = createOrbit(gravityField.getMu()); @@ -176,7 +176,7 @@ public class RoughVisibilityEstimatorTest { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true); ellipsoid = new ExtendedEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, diff --git a/src/test/java/org/orekit/rugged/utils/SpacecraftToObservedBodyTest.java b/src/test/java/org/orekit/rugged/utils/SpacecraftToObservedBodyTest.java index cbd67c2f133df021bf4556515db6173f4670e9d2..f95bbe2f03b7a50a8abc231240faae35a008975d 100644 --- a/src/test/java/org/orekit/rugged/utils/SpacecraftToObservedBodyTest.java +++ b/src/test/java/org/orekit/rugged/utils/SpacecraftToObservedBodyTest.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -33,7 +33,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import org.orekit.bodies.BodyShape; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.frames.FramesFactory; @@ -115,7 +115,7 @@ public class SpacecraftToObservedBodyTest { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(new File(path))); earth = TestUtils.createEarth(); orbit = TestUtils.createOrbit(Constants.EIGEN5C_EARTH_MU); diff --git a/src/tutorials/java/fr/cs/examples/AtmosphericRefractionExamples.java b/src/tutorials/java/fr/cs/examples/AtmosphericRefractionExamples.java index f4c527984df37b0b4fa7759dcda6cb1c106b0217..a6e9706695d505088c0778d4ea204b6833f604ab 100644 --- a/src/tutorials/java/fr/cs/examples/AtmosphericRefractionExamples.java +++ b/src/tutorials/java/fr/cs/examples/AtmosphericRefractionExamples.java @@ -13,7 +13,7 @@ import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.stat.descriptive.DescriptiveStatistics; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.frames.Frame; import org.orekit.frames.FramesFactory; @@ -52,7 +52,7 @@ public class AtmosphericRefractionExamples { // Initialize Orekit, assuming an orekit-data folder is in user home directory File home = new File(System.getProperty("user.home")); File orekitData = new File(home, "orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); // Sensor's definition // =================== diff --git a/src/tutorials/java/fr/cs/examples/DirectLocation.java b/src/tutorials/java/fr/cs/examples/DirectLocation.java index dbc1d63c99e04d667453158ae7b5742d485a897d..8381d588beb387f9a487666a30d249665fb12687 100644 --- a/src/tutorials/java/fr/cs/examples/DirectLocation.java +++ b/src/tutorials/java/fr/cs/examples/DirectLocation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -16,16 +16,16 @@ */ package fr.cs.examples; -import org.hipparchus.geometry.euclidean.threed.Rotation; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.util.FastMath; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Locale; +import org.hipparchus.geometry.euclidean.threed.Rotation; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; @@ -40,8 +40,8 @@ import org.orekit.rugged.api.RuggedBuilder; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.LinearLineDatation; -import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.FixedRotation; +import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.TimeDependentLOS; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScale; @@ -62,7 +62,7 @@ public class DirectLocation { // Initialize Orekit, assuming an orekit-data folder is in user home directory File home = new File(System.getProperty("user.home")); File orekitData = new File(home, "orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); // Sensor's definition // =================== diff --git a/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java b/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java index 48fc8da974a582fff279e7d6b1428837facb2d83..6ca882eb4d220fcf9a704c7af8055a026df66364 100644 --- a/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java +++ b/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -25,7 +25,7 @@ import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; @@ -65,7 +65,7 @@ public class DirectLocationWithDEM { // Initialize Orekit, assuming an orekit-data folder is in user home directory File home = new File(System.getProperty("user.home")); File orekitData = new File(home, "orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); // Sensor's definition // =================== diff --git a/src/tutorials/java/fr/cs/examples/InverseLocation.java b/src/tutorials/java/fr/cs/examples/InverseLocation.java index b03bee91722c232692e9fb8f845ce3cf71440cfc..9e9613354a5f2db3d66d1f8ecb96ef8e7170834a 100644 --- a/src/tutorials/java/fr/cs/examples/InverseLocation.java +++ b/src/tutorials/java/fr/cs/examples/InverseLocation.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -26,7 +26,7 @@ import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; @@ -65,7 +65,7 @@ public class InverseLocation { // Initialize Orekit, assuming an orekit-data folder is in user home directory File home = new File(System.getProperty("user.home")); File orekitData = new File(home, "orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); // Sensor's definition // =================== diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/GroundRefining.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/GroundRefining.java index 0b35215a14785be729de97f0b7d3eaef00c03149..61d8d1eb55e6bc2a2f2d8c6e1f672a8eeef3376d 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/GroundRefining.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/GroundRefining.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -24,11 +24,12 @@ import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider; import org.orekit.orbits.Orbit; +import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.api.BodyRotatingFrameId; import org.orekit.rugged.api.EllipsoidId; @@ -37,7 +38,6 @@ import org.orekit.rugged.api.Rugged; import org.orekit.rugged.api.RuggedBuilder; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; -import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.time.AbsoluteDate; import org.orekit.utils.AngularDerivativesFilter; import org.orekit.utils.CartesianDerivativesFilter; @@ -79,7 +79,7 @@ public class GroundRefining extends Refining { // --------------------------------------------------------------------------- File home = new File(System.getProperty("user.home")); File orekitData = new File(home, "orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); // Initialize refining context // --------------------------- diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/InterRefining.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/InterRefining.java index 5c6516bcc2e4ce1a309b2b1de366f435581610c3..e5a6e94e488c7fe71ff0ab0d0b94f95d980fd4d9 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/InterRefining.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/InterRefining.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 @@ -25,10 +25,11 @@ import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; -import org.orekit.data.DataProvidersManager; +import org.orekit.data.DataContext; import org.orekit.data.DirectoryCrawler; import org.orekit.errors.OrekitException; import org.orekit.orbits.Orbit; +import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.api.BodyRotatingFrameId; import org.orekit.rugged.api.EllipsoidId; @@ -37,7 +38,6 @@ import org.orekit.rugged.api.Rugged; import org.orekit.rugged.api.RuggedBuilder; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; -import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.time.AbsoluteDate; import org.orekit.utils.AngularDerivativesFilter; import org.orekit.utils.CartesianDerivativesFilter; @@ -87,7 +87,7 @@ public class InterRefining extends Refining { // --------------------------------------------------------------------------- File home = new File(System.getProperty("user.home")); File orekitData = new File(home, "orekit-data"); - DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); + DataContext.getDefault().getDataProvidersManager().addProvider(new DirectoryCrawler(orekitData)); // Initialize refining context // --------------------------- diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java index 9fe09bae06923963ff98bc283fb33db8c6509be3..8849672d4da43a0c38d7f8aacfee33a89284fa87 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2017 Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java index 18023f41782aa83aed012683f406b23c3f3766c2..fc5c21530624be5ca0b1dbccc4916edac9a5cea0 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java index 367dff1f121b498b34f457eaee137000459f6d31..3efb9fe5045a5264a77af1bc469620b33787805d 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Measurable.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Measurable.java index 36521946d3badf98bfcb93183cce14a3edfb0ce2..d399514f6b194dbbe7048fdee696bc75b3a7c025 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Measurable.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Measurable.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Noise.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Noise.java index 963acf8067642d33006fdcaca8a7434c9a77b13d..d921ffef77b159c7d77f6ca9af0dbb78a8126941 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Noise.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/Noise.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/DistanceTools.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/DistanceTools.java index da083fb62ff354e7f2b7c70bd016ea86d14ef1a5..ba2d1bed21e0352b5b2960e61fc089db60f9d64b 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/DistanceTools.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/DistanceTools.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java index fd8d05c82e38a435916d69b769bd7af66aaaf226..ef196d162cfe3dacb555b3fd02ef2ef4d00a0e56 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java index 31fe0895a2e2223fd6f17cfae667ca40911acf38..b72877a3ae84b9a53a89e3cbff91f73217fc1db4 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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 diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java index 8e21a7851907fc98624c459f9bb6499fd185df04..17080e5e4965cb3e3e9c212f25e8d4568a40cd59 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java @@ -1,5 +1,5 @@ -/* Copyright 2013-2019 CS Systèmes d'Information - * Licensed to CS Systèmes d'Information (CS) under one or more +/* Copyright 2013-2020 CS GROUP + * Licensed to CS GROUP (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