Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ale
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Ale
Commits
14ccd67f
Commit
14ccd67f
authored
Sep 28, 2022
by
acpaquette
Browse files
Options
Downloads
Patches
Plain Diff
Fixed erronious spiceql calls
parent
24cf474a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ale/base/data_naif.py
+14
-16
14 additions, 16 deletions
ale/base/data_naif.py
ale/drivers/mro_drivers.py
+1
-1
1 addition, 1 deletion
ale/drivers/mro_drivers.py
tests/pytests/test_util.py
+0
-2
0 additions, 2 deletions
tests/pytests/test_util.py
with
15 additions
and
19 deletions
ale/base/data_naif.py
+
14
−
16
View file @
14ccd67f
...
@@ -143,7 +143,7 @@ class NaifSpice():
...
@@ -143,7 +143,7 @@ class NaifSpice():
Radial distortion coefficients
Radial distortion coefficients
"""
"""
if
not
hasattr
(
self
,
"
_odtk
"
):
if
not
hasattr
(
self
,
"
_odtk
"
):
self
.
_odtk
=
pyspiceql
.
getKernelVectorValue
(
'
INS{}_OD_K
'
.
format
(
self
.
ikid
))
.
toList
(
)
self
.
_odtk
=
list
(
pyspiceql
.
getKernelVectorValue
(
'
INS{}_OD_K
'
.
format
(
self
.
ikid
)))
return
self
.
_odtk
return
self
.
_odtk
@property
@property
...
@@ -250,7 +250,7 @@ class NaifSpice():
...
@@ -250,7 +250,7 @@ class NaifSpice():
: list<double>
: list<double>
focal plane to detector samples
focal plane to detector samples
"""
"""
if
not
hasattr
(
self
,
"
_focal2pixel_
lin
es
"
):
if
not
hasattr
(
self
,
"
_focal2pixel_
sampl
es
"
):
self
.
_focal2pixel_samples
=
list
(
pyspiceql
.
getKernelVectorValue
(
'
INS{}_ITRANSS
'
.
format
(
self
.
ikid
)))
self
.
_focal2pixel_samples
=
list
(
pyspiceql
.
getKernelVectorValue
(
'
INS{}_ITRANSS
'
.
format
(
self
.
ikid
)))
return
self
.
_focal2pixel_samples
return
self
.
_focal2pixel_samples
...
@@ -278,7 +278,7 @@ class NaifSpice():
...
@@ -278,7 +278,7 @@ class NaifSpice():
: list<double>
: list<double>
detector to focal plane y
detector to focal plane y
"""
"""
if
not
hasattr
(
self
,
"
_pixel2focal_
x
"
):
if
not
hasattr
(
self
,
"
_pixel2focal_
y
"
):
self
.
_pixel2focal_y
=
list
(
pyspiceql
.
getKernelVectorValue
(
'
INS{}_ITRANSY
'
.
format
(
self
.
ikid
)))
self
.
_pixel2focal_y
=
list
(
pyspiceql
.
getKernelVectorValue
(
'
INS{}_ITRANSY
'
.
format
(
self
.
ikid
)))
return
self
.
_pixel2focal_y
return
self
.
_pixel2focal_y
...
@@ -294,7 +294,7 @@ class NaifSpice():
...
@@ -294,7 +294,7 @@ class NaifSpice():
focal length
focal length
"""
"""
if
not
hasattr
(
self
,
"
_focal_length
"
):
if
not
hasattr
(
self
,
"
_focal_length
"
):
self
.
_focal_length
=
float
(
pyspiceql
.
getKernel
String
Value
(
'
INS{}_FOCAL_LENGTH
'
.
format
(
self
.
ikid
))[
0
])
self
.
_focal_length
=
float
(
pyspiceql
.
getKernel
Vector
Value
(
'
INS{}_FOCAL_LENGTH
'
.
format
(
self
.
ikid
))[
0
])
return
self
.
_focal_length
return
self
.
_focal_length
@property
@property
...
@@ -307,7 +307,7 @@ class NaifSpice():
...
@@ -307,7 +307,7 @@ class NaifSpice():
: float pixel size
: float pixel size
"""
"""
if
not
hasattr
(
self
,
"
_pixel_size
"
):
if
not
hasattr
(
self
,
"
_pixel_size
"
):
self
.
_pixel_size
=
pyspiceql
.
getKernel
String
Value
(
'
INS{}_PIXEL_SIZE
'
.
format
(
self
.
ikid
)
,
0
,
1
)[
0
]
*
0.001
self
.
_pixel_size
=
pyspiceql
.
getKernel
Vector
Value
(
'
INS{}_PIXEL_SIZE
'
.
format
(
self
.
ikid
))[
0
]
*
0.001
return
self
.
_pixel_size
return
self
.
_pixel_size
@property
@property
...
@@ -371,7 +371,7 @@ class NaifSpice():
...
@@ -371,7 +371,7 @@ class NaifSpice():
self
.
spacecraft_name
,
self
.
spacecraft_name
,
'
J2000
'
,
'
J2000
'
,
self
.
light_time_correction
)
self
.
light_time_correction
)
sun_state
=
sun_lt_state
.
starg
sun_state
=
np
.
array
(
list
(
sun_lt_state
.
starg
))
positions
.
append
(
sun_state
[:
3
])
positions
.
append
(
sun_state
[:
3
])
velocities
.
append
(
sun_state
[
3
:
6
])
velocities
.
append
(
sun_state
[
3
:
6
])
positions
=
1000
*
np
.
asarray
(
positions
)
positions
=
1000
*
np
.
asarray
(
positions
)
...
@@ -418,7 +418,6 @@ class NaifSpice():
...
@@ -418,7 +418,6 @@ class NaifSpice():
observer
,
observer
,
'
J2000
'
,
'
J2000
'
,
self
.
light_time_correction
)
self
.
light_time_correction
)
obs_tar_state
=
obs_tar
.
starg
obs_tar_lt
=
obs_tar
.
lt
obs_tar_lt
=
obs_tar
.
lt
# ssb to spacecraft
# ssb to spacecraft
...
@@ -427,8 +426,7 @@ class NaifSpice():
...
@@ -427,8 +426,7 @@ class NaifSpice():
'
SSB
'
,
'
SSB
'
,
'
J2000
'
,
'
J2000
'
,
"
NONE
"
)
"
NONE
"
)
ssb_obs_state
=
ssb_obs
.
starg
ssb_obs_state
=
np
.
array
(
list
(
ssb_obs
.
starg
))
ssb_obs_lt
=
ssb_obs
.
lt
radius_lt
=
(
self
.
target_body_radii
[
2
]
+
self
.
target_body_radii
[
0
])
/
2
/
(
scipy
.
constants
.
c
/
1000.0
)
radius_lt
=
(
self
.
target_body_radii
[
2
]
+
self
.
target_body_radii
[
0
])
/
2
/
(
scipy
.
constants
.
c
/
1000.0
)
adjusted_time
=
time
-
obs_tar_lt
+
radius_lt
adjusted_time
=
time
-
obs_tar_lt
+
radius_lt
...
@@ -438,8 +436,7 @@ class NaifSpice():
...
@@ -438,8 +436,7 @@ class NaifSpice():
'
SSB
'
,
'
SSB
'
,
'
J2000
'
,
'
J2000
'
,
"
NONE
"
)
"
NONE
"
)
ssb_tar_state
=
ssb_tar
.
starg
ssb_tar_state
=
np
.
array
(
list
(
ssb_tar
.
starg
))
ssb_tar_lt
=
ssb_tar
.
lt
state
=
ssb_tar_state
-
ssb_obs_state
state
=
ssb_tar_state
-
ssb_obs_state
matrix
=
spice
.
sxform
(
"
J2000
"
,
self
.
reference_frame
,
time
)
matrix
=
spice
.
sxform
(
"
J2000
"
,
self
.
reference_frame
,
time
)
...
@@ -450,19 +447,20 @@ class NaifSpice():
...
@@ -450,19 +447,20 @@ class NaifSpice():
observer
,
observer
,
self
.
reference_frame
,
self
.
reference_frame
,
self
.
light_time_correction
)
self
.
light_time_correction
)
state
=
np
.
array
(
list
(
state
.
starg
))
if
self
.
swap_observer_target
:
if
self
.
swap_observer_target
:
pos
.
append
(
-
state
.
starg
[:
3
])
pos
.
append
(
-
state
[:
3
])
vel
.
append
(
-
state
.
starg
[
3
:])
vel
.
append
(
-
state
[
3
:])
else
:
else
:
pos
.
append
(
state
.
starg
[:
3
])
pos
.
append
(
state
[:
3
])
vel
.
append
(
state
.
starg
[
3
:])
vel
.
append
(
state
[
3
:])
# By default, SPICE works in km, so convert to m
# By default, SPICE works in km, so convert to m
self
.
_position
=
1000
*
np
.
asarray
(
pos
)
self
.
_position
=
1000
*
np
.
asarray
(
pos
)
self
.
_velocity
=
1000
*
np
.
asarray
(
vel
)
self
.
_velocity
=
1000
*
np
.
asarray
(
vel
)
return
self
.
_position
,
self
.
_velocity
,
self
.
ephemeris_time
return
self
.
_position
,
self
.
_velocity
,
ephem
@property
@property
def
frame_chain
(
self
):
def
frame_chain
(
self
):
...
...
This diff is collapsed.
Click to expand it.
ale/drivers/mro_drivers.py
+
1
−
1
View file @
14ccd67f
...
@@ -358,7 +358,7 @@ class MroCtxIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, RadialDi
...
@@ -358,7 +358,7 @@ class MroCtxIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, RadialDi
"""
"""
if
not
hasattr
(
self
,
'
_ephemeris_start_time
'
):
if
not
hasattr
(
self
,
'
_ephemeris_start_time
'
):
sclock
=
self
.
label
[
'
IsisCube
'
][
'
Instrument
'
][
'
SpacecraftClockCount
'
]
sclock
=
self
.
label
[
'
IsisCube
'
][
'
Instrument
'
][
'
SpacecraftClockCount
'
]
self
.
_ephemeris_start_time
=
pyspiceql
.
sclkToEt
(
self
.
spacecraft_
id
,
sclock
)
self
.
_ephemeris_start_time
=
pyspiceql
.
sclkToEt
(
str
(
self
.
spacecraft_
name
).
lower
()
,
sclock
)
return
self
.
_ephemeris_start_time
return
self
.
_ephemeris_start_time
@property
@property
...
...
This diff is collapsed.
Click to expand it.
tests/pytests/test_util.py
+
0
−
2
View file @
14ccd67f
...
@@ -6,9 +6,7 @@ import networkx as nx
...
@@ -6,9 +6,7 @@ import networkx as nx
import
pytest
import
pytest
import
tempfile
import
tempfile
import
spiceypy
as
spice
import
pvl
import
pvl
from
unittest
import
mock
from
unittest.mock
import
MagicMock
,
patch
from
unittest.mock
import
MagicMock
,
patch
from
collections
import
OrderedDict
from
collections
import
OrderedDict
...
...
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