Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Rugged
Commits
319a8159
Commit
319a8159
authored
3 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Clarified test.
parent
06e40c84
No related branches found
No related tags found
No related merge requests found
Pipeline
#1589
passed
3 years ago
Stage: verify
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/orekit/rugged/api/Rugged.java
+10
-4
10 additions, 4 deletions
src/main/java/org/orekit/rugged/api/Rugged.java
src/test/java/org/orekit/rugged/refraction/AtmosphericRefractionTest.java
+20
-0
20 additions, 0 deletions
...g/orekit/rugged/refraction/AtmosphericRefractionTest.java
with
30 additions
and
4 deletions
src/main/java/org/orekit/rugged/api/Rugged.java
+
10
−
4
View file @
319a8159
...
...
@@ -814,10 +814,7 @@ public class Rugged {
}
// Check if the pixel is inside the sensor (with a margin) OR if the inverse location was impossible (null result)
if
(
sensorPixelGrid
[
uIndex
][
vIndex
]
!=
null
&&
(
sensorPixelGrid
[
uIndex
][
vIndex
].
getPixelNumber
()
<
-
INVLOC_MARGIN
||
sensorPixelGrid
[
uIndex
][
vIndex
].
getPixelNumber
()
>
(
INVLOC_MARGIN
+
sensor
.
getNbPixels
()
-
1
))
||
sensorPixelGrid
[
uIndex
][
vIndex
]
==
null
)
{
if
(!
pixelIsInside
(
sensorPixelGrid
[
uIndex
][
vIndex
],
sensor
))
{
// In order for the dump to end nicely
DumpManager
.
endNicely
();
// Impossible to find the point in the given min line
...
...
@@ -839,6 +836,15 @@ public class Rugged {
return
sensorPixelGrid
;
}
/** Check if pixel is inside the sensor with a margin.
* @param pixel pixel to check (may be null if not found)
* @param sensor the line sensor
* @return true if the pixel is inside the sensor
*/
private
boolean
pixelIsInside
(
final
SensorPixel
pixel
,
final
LineSensor
sensor
)
{
return
pixel
!=
null
&&
pixel
.
getPixelNumber
()
>=
-
INVLOC_MARGIN
&&
pixel
.
getPixelNumber
()
<
INVLOC_MARGIN
+
sensor
.
getNbPixels
()
-
1
;
}
/** Computation, for the sensor pixels grid, of the direct location WITH atmospheric refraction.
* (full computation)
* @param pixelGrid the pixel grid
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/orekit/rugged/refraction/AtmosphericRefractionTest.java
+
20
−
0
View file @
319a8159
...
...
@@ -120,9 +120,29 @@ public class AtmosphericRefractionTest {
GeodeticPoint
dummyGP
=
new
GeodeticPoint
(
dummyLat
,
dummyLon
,
0
.);
try
{
ruggedWith
.
inverseLocation
(
sensorName
,
dummyGP
,
minLine
,
maxLine
);
Assert
.
fail
(
"an exeption should have been thrown"
);
}
catch
(
RuggedException
re
)
{
Assert
.
assertEquals
(
RuggedMessages
.
INVALID_RANGE_FOR_LINES
,
re
.
getSpecifier
());
}
try
{
ruggedWith
.
inverseLocation
(
sensorName
,
gpWithAtmosphericRefractionCorrection
[
0
],
210
,
maxLine
);
Assert
.
fail
(
"an exeption should have been thrown"
);
}
catch
(
RuggedException
re
)
{
Assert
.
assertEquals
(
RuggedMessages
.
INVALID_RANGE_FOR_LINES
,
re
.
getSpecifier
());
}
try
{
ruggedWith
.
inverseLocation
(
sensorName
,
gpWithAtmosphericRefractionCorrection
[
0
],
minLine
,
190
);
Assert
.
fail
(
"an exeption should have been thrown"
);
}
catch
(
RuggedException
re
)
{
Assert
.
assertEquals
(
RuggedMessages
.
INVALID_RANGE_FOR_LINES
,
re
.
getSpecifier
());
}
}
private
RuggedBuilder
initRuggedForAtmosphericTests
(
final
int
dimension
,
final
String
sensorName
)
throws
URISyntaxException
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment