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
fe99d2b6
Commit
fe99d2b6
authored
Oct 12, 2019
by
Adam Paquette
Committed by
Jesse Mapel
Oct 16, 2019
Browse files
Options
Downloads
Patches
Plain Diff
Added lookup table to dawn driver and reordered drivers for spiceinit
parent
116e05b7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
ale/base/data_naif.py
+15
-10
15 additions, 10 deletions
ale/base/data_naif.py
ale/drivers/__init__.py
+1
-1
1 addition, 1 deletion
ale/drivers/__init__.py
ale/drivers/dawn_drivers.py
+6
-1
6 additions, 1 deletion
ale/drivers/dawn_drivers.py
tests/pytests/test_load.py
+1
-1
1 addition, 1 deletion
tests/pytests/test_load.py
with
23 additions
and
13 deletions
ale/base/data_naif.py
+
15
−
10
View file @
fe99d2b6
...
@@ -295,14 +295,20 @@ class NaifSpice():
...
@@ -295,14 +295,20 @@ class NaifSpice():
: (sun_positions, sun_velocities)
: (sun_positions, sun_velocities)
a tuple containing a list of sun positions, a list of sun velocities
a tuple containing a list of sun positions, a list of sun velocities
"""
"""
times
=
[
self
.
center_ephemeris_time
]
positions
=
[]
velocities
=
[]
for
time
in
times
:
sun_state
,
_
=
spice
.
spkezr
(
"
SUN
"
,
sun_state
,
_
=
spice
.
spkezr
(
"
SUN
"
,
self
.
center_ephemeris_
time
,
time
,
self
.
reference_frame
,
self
.
reference_frame
,
'
LT+S
'
,
'
LT+S
'
,
self
.
target_name
)
self
.
target_name
)
positions
=
1000
*
np
.
asarray
([
sun_state
[:
3
]])
positions
.
append
(
sun_state
[:
3
])
velocities
=
1000
*
np
.
asarray
([
sun_state
[
3
:
6
]])
velocities
.
append
(
sun_state
[
3
:
6
])
times
=
np
.
asarray
([
self
.
center_ephemeris_time
])
positions
=
1000
*
np
.
asarray
(
positions
)
velocities
=
1000
*
np
.
asarray
(
velocities
)
return
positions
,
velocities
,
times
return
positions
,
velocities
,
times
...
@@ -526,4 +532,3 @@ class NaifSpice():
...
@@ -526,4 +532,3 @@ class NaifSpice():
self
.
_naif_keywords
=
{
**
self
.
_naif_keywords
,
**
util
.
query_kernel_pool
(
f
"
*
{
self
.
ikid
}
*
"
),
**
util
.
query_kernel_pool
(
f
"
*
{
self
.
target_id
}
*
"
)}
self
.
_naif_keywords
=
{
**
self
.
_naif_keywords
,
**
util
.
query_kernel_pool
(
f
"
*
{
self
.
ikid
}
*
"
),
**
util
.
query_kernel_pool
(
f
"
*
{
self
.
target_id
}
*
"
)}
return
self
.
_naif_keywords
return
self
.
_naif_keywords
This diff is collapsed.
Click to expand it.
ale/drivers/__init__.py
+
1
−
1
View file @
fe99d2b6
...
@@ -28,7 +28,7 @@ __formatters__ = {'usgscsm': to_usgscsm,
...
@@ -28,7 +28,7 @@ __formatters__ = {'usgscsm': to_usgscsm,
'
isis
'
:
to_isis
}
'
isis
'
:
to_isis
}
def
sort_drivers
(
drivers
=
[]):
def
sort_drivers
(
drivers
=
[]):
return
list
(
sorted
(
drivers
,
key
=
lambda
x
:
IsisSpice
in
x
.
__bases__
,
reverse
=
Tru
e
))
return
list
(
sorted
(
drivers
,
key
=
lambda
x
:
IsisSpice
in
x
.
__bases__
,
reverse
=
Fals
e
))
class
AleJsonEncoder
(
json
.
JSONEncoder
):
class
AleJsonEncoder
(
json
.
JSONEncoder
):
def
default
(
self
,
obj
):
def
default
(
self
,
obj
):
...
...
This diff is collapsed.
Click to expand it.
ale/drivers/dawn_drivers.py
+
6
−
1
View file @
fe99d2b6
...
@@ -10,6 +10,11 @@ from ale.base.data_naif import NaifSpice
...
@@ -10,6 +10,11 @@ from ale.base.data_naif import NaifSpice
from
ale.base.label_pds3
import
Pds3Label
from
ale.base.label_pds3
import
Pds3Label
from
ale.base.type_sensor
import
Framer
from
ale.base.type_sensor
import
Framer
ID_LOOKUP
=
{
"
FC1
"
:
"
DAWN_FC1
"
,
"
FC2
"
:
"
DAWN_FC2
"
}
class
DawnFcPds3NaifSpiceDriver
(
Framer
,
Pds3Label
,
NaifSpice
,
Driver
):
class
DawnFcPds3NaifSpiceDriver
(
Framer
,
Pds3Label
,
NaifSpice
,
Driver
):
"""
"""
Dawn driver for generating an ISD from a Dawn PDS3 image.
Dawn driver for generating an ISD from a Dawn PDS3 image.
...
@@ -32,7 +37,7 @@ class DawnFcPds3NaifSpiceDriver(Framer, Pds3Label, NaifSpice, Driver):
...
@@ -32,7 +37,7 @@ class DawnFcPds3NaifSpiceDriver(Framer, Pds3Label, NaifSpice, Driver):
instrument_id
=
super
().
instrument_id
instrument_id
=
super
().
instrument_id
filter_number
=
self
.
filter_number
filter_number
=
self
.
filter_number
return
"
DAWN_
{}_FILTER_{}
"
.
format
(
instrument_id
,
filter_number
)
return
"
{}_FILTER_{}
"
.
format
(
ID_LOOKUP
[
instrument_id
]
,
filter_number
)
@property
@property
def
label
(
self
):
def
label
(
self
):
...
...
This diff is collapsed.
Click to expand it.
tests/pytests/test_load.py
+
1
−
1
View file @
fe99d2b6
...
@@ -22,7 +22,7 @@ def mess_kernels():
...
@@ -22,7 +22,7 @@ def mess_kernels():
def
test_priority
(
tmpdir
,
monkeypatch
):
def
test_priority
(
tmpdir
,
monkeypatch
):
drivers
=
[
type
(
'
FooNaifSpice
'
,
(
NaifSpice
,),
{}),
type
(
'
BarIsisSpice
'
,
(
IsisSpice
,),
{}),
type
(
'
BazNaifSpice
'
,
(
NaifSpice
,),
{}),
type
(
'
FubarIsisSpice
'
,
(
IsisSpice
,),
{})]
drivers
=
[
type
(
'
FooNaifSpice
'
,
(
NaifSpice
,),
{}),
type
(
'
BarIsisSpice
'
,
(
IsisSpice
,),
{}),
type
(
'
BazNaifSpice
'
,
(
NaifSpice
,),
{}),
type
(
'
FubarIsisSpice
'
,
(
IsisSpice
,),
{})]
sorted_drivers
=
sort_drivers
(
drivers
)
sorted_drivers
=
sort_drivers
(
drivers
)
assert
all
([
IsisSpice
in
klass
.
__bases__
for
klass
in
sorted_drivers
[
:
2
]])
assert
all
([
IsisSpice
in
klass
.
__bases__
for
klass
in
sorted_drivers
[
2
:
]])
def
test_mess_load
(
mess_kernels
):
def
test_mess_load
(
mess_kernels
):
updated_kernels
=
mess_kernels
updated_kernels
=
mess_kernels
...
...
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