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
88c48c01
Unverified
Commit
88c48c01
authored
3 years ago
by
Lauren Adoram-Kershner
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Expanding formatter to populate ISD information for Radar instruments (#473)
* initial commit * removing print * fixing tests
parent
a3e109f3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ale/formatters/formatter.py
+35
-33
35 additions, 33 deletions
ale/formatters/formatter.py
tests/pytests/data/isds/lrominirf_isd.json
+344
-44
344 additions, 44 deletions
tests/pytests/data/isds/lrominirf_isd.json
with
379 additions
and
77 deletions
ale/formatters/formatter.py
+
35
−
33
View file @
88c48c01
...
@@ -23,7 +23,6 @@ def to_isd(driver):
...
@@ -23,7 +23,6 @@ def to_isd(driver):
The ISIS compatible meta data as a JSON encoded string.
The ISIS compatible meta data as a JSON encoded string.
"""
"""
meta_data
=
{}
meta_data
=
{}
meta_data
[
'
isis_camera_version
'
]
=
driver
.
sensor_model_version
meta_data
[
'
isis_camera_version
'
]
=
driver
.
sensor_model_version
...
@@ -45,10 +44,9 @@ def to_isd(driver):
...
@@ -45,10 +44,9 @@ def to_isd(driver):
meta_data
[
'
interpolation_method
'
]
=
'
lagrange
'
meta_data
[
'
interpolation_method
'
]
=
'
lagrange
'
start_lines
,
start_times
,
scan_rates
=
driver
.
line_scan_rate
start_lines
,
start_times
,
scan_rates
=
driver
.
line_scan_rate
center_time
=
driver
.
center_ephemeris_time
meta_data
[
'
line_scan_rate
'
]
=
[[
line
,
time
,
rate
]
for
line
,
time
,
rate
in
zip
(
start_lines
,
start_times
,
scan_rates
)]
meta_data
[
'
line_scan_rate
'
]
=
[[
line
,
time
,
rate
]
for
line
,
time
,
rate
in
zip
(
start_lines
,
start_times
,
scan_rates
)]
meta_data
[
'
starting_ephemeris_time
'
]
=
driver
.
ephemeris_start_time
meta_data
[
'
starting_ephemeris_time
'
]
=
driver
.
ephemeris_start_time
meta_data
[
'
center_ephemeris_time
'
]
=
center
_time
meta_data
[
'
center_ephemeris_time
'
]
=
driver
.
center_ephemeris
_time
# frame sensor model specifics
# frame sensor model specifics
if
isinstance
(
driver
,
Framer
):
if
isinstance
(
driver
,
Framer
):
...
@@ -116,7 +114,6 @@ def to_isd(driver):
...
@@ -116,7 +114,6 @@ def to_isd(driver):
body_rotation
[
"
reference_frame
"
]
=
destination_frame
body_rotation
[
"
reference_frame
"
]
=
destination_frame
meta_data
[
'
body_rotation
'
]
=
body_rotation
meta_data
[
'
body_rotation
'
]
=
body_rotation
if
isinstance
(
driver
,
LineScanner
)
or
isinstance
(
driver
,
Framer
)
or
isinstance
(
driver
,
PushFrame
):
# sensor orientation
# sensor orientation
sensor_frame
=
driver
.
sensor_frame_id
sensor_frame
=
driver
.
sensor_frame_id
...
@@ -146,8 +143,12 @@ def to_isd(driver):
...
@@ -146,8 +143,12 @@ def to_isd(driver):
# interiror orientation
# interiror orientation
meta_data
[
'
naif_keywords
'
]
=
driver
.
naif_keywords
meta_data
[
'
naif_keywords
'
]
=
driver
.
naif_keywords
if
isinstance
(
driver
,
LineScanner
)
or
isinstance
(
driver
,
Framer
)
or
isinstance
(
driver
,
PushFrame
):
meta_data
[
'
detector_sample_summing
'
]
=
driver
.
sample_summing
meta_data
[
'
detector_sample_summing
'
]
=
driver
.
sample_summing
meta_data
[
'
detector_line_summing
'
]
=
driver
.
line_summing
meta_data
[
'
detector_line_summing
'
]
=
driver
.
line_summing
meta_data
[
'
focal_length_model
'
]
=
{
meta_data
[
'
focal_length_model
'
]
=
{
'
focal_length
'
:
driver
.
focal_length
'
focal_length
'
:
driver
.
focal_length
}
}
...
@@ -155,13 +156,14 @@ def to_isd(driver):
...
@@ -155,13 +156,14 @@ def to_isd(driver):
'
line
'
:
driver
.
detector_center_line
,
'
line
'
:
driver
.
detector_center_line
,
'
sample
'
:
driver
.
detector_center_sample
'
sample
'
:
driver
.
detector_center_sample
}
}
meta_data
[
'
starting_detector_line
'
]
=
driver
.
detector_start_line
meta_data
[
'
starting_detector_sample
'
]
=
driver
.
detector_start_sample
meta_data
[
'
focal2pixel_lines
'
]
=
driver
.
focal2pixel_lines
meta_data
[
'
focal2pixel_lines
'
]
=
driver
.
focal2pixel_lines
meta_data
[
'
focal2pixel_samples
'
]
=
driver
.
focal2pixel_samples
meta_data
[
'
focal2pixel_samples
'
]
=
driver
.
focal2pixel_samples
meta_data
[
'
optical_distortion
'
]
=
driver
.
usgscsm_distortion_model
meta_data
[
'
optical_distortion
'
]
=
driver
.
usgscsm_distortion_model
meta_data
[
'
starting_detector_line
'
]
=
driver
.
detector_start_line
meta_data
[
'
starting_detector_sample
'
]
=
driver
.
detector_start_sample
j2000_rotation
=
frame_chain
.
compute_rotation
(
target_frame
,
1
)
j2000_rotation
=
frame_chain
.
compute_rotation
(
target_frame
,
1
)
instrument_position
=
{}
instrument_position
=
{}
...
...
This diff is collapsed.
Click to expand it.
tests/pytests/data/isds/lrominirf_isd.json
+
344
−
44
View file @
88c48c01
...
@@ -366,6 +366,306 @@
...
@@ -366,6 +366,306 @@
],
],
"reference_frame"
:
1
"reference_frame"
:
1
},
},
"instrument_pointing"
:
{
"time_dependent_frames"
:
[
31006
,
1
],
"ck_table_start_time"
:
325441417.4304223
,
"ck_table_end_time"
:
325441420.7234223
,
"ck_table_original_size"
:
14
,
"ephemeris_times"
:
[
325441417.4304223
,
325441417.68373
,
325441417.9370377
,
325441418.1903454
,
325441418.44365305
,
325441418.69696075
,
325441418.95026845
,
325441419.20357615
,
325441419.45688385
,
325441419.71019155
,
325441419.9634992
,
325441420.2168069
,
325441420.4701146
,
325441420.7234223
],
"quaternions"
:
[
[
-0.9759213987320261
,
0.19770025384845868
,
0.030876383685049705
,
-0.08682558410810928
],
[
-0.9759214279969775
,
0.19770026426283943
,
0.0308763171549909
,
-0.08682525511444422
],
[
-0.9759214572618375
,
0.1977002746772048
,
0.030876250624883594
,
-0.08682492612054747
],
[
-0.9759214865265868
,
0.1977002850915476
,
0.030876184094772753
,
-0.08682459712664094
],
[
-0.9759215157912055
,
0.19770029550586102
,
0.030876117564703306
,
-0.08682426813294661
],
[
-0.9759215450557329
,
0.19770030592015894
,
0.030876051034585378
,
-0.08682393913902053
],
[
-0.9759215743201495
,
0.1977003163344344
,
0.030875984504463907
,
-0.08682361014508465
],
[
-0.9759216035844552
,
0.19770032674868743
,
0.030875917974338897
,
-0.08682328115113902
],
[
-0.9759216328486501
,
0.197700337162918
,
0.030875851444210352
,
-0.0868229521571836
],
[
-0.975921662112714
,
0.19770034757711893
,
0.030875784914123194
,
-0.08682262316344026
],
[
-0.975921691376687
,
0.1977003579913045
,
0.030875718383987543
,
-0.08682229416946535
],
[
-0.9759217206405492
,
0.19770036840546765
,
0.030875651853848364
,
-0.0868219651754806
],
[
-0.9759217499043004
,
0.19770037881960828
,
0.03087558532370564
,
-0.08682163618148604
],
[
-0.9759217791679209
,
0.19770038923371935
,
0.030875518793604312
,
-0.08682130718770362
]
],
"angular_velocities"
:
[
[
6.916139484934965e-08
,
-1.0404590249347596e-06
,
2.448709649861581e-06
],
[
6.916139478040356e-08
,
-1.0404590253046157e-06
,
2.448709649728261e-06
],
[
6.916139471145752e-08
,
-1.0404590256744724e-06
,
2.4487096495949383e-06
],
[
6.916139464251199e-08
,
-1.0404590260443285e-06
,
2.4487096494616174e-06
],
[
6.916139457356657e-08
,
-1.0404590264141854e-06
,
2.4487096493282965e-06
],
[
6.916139450462146e-08
,
-1.0404590267840425e-06
,
2.4487096491949765e-06
],
[
6.916139443567654e-08
,
-1.0404590271539001e-06
,
2.448709649061655e-06
],
[
6.916139436673195e-08
,
-1.0404590275237573e-06
,
2.448709648928333e-06
],
[
6.916139429778765e-08
,
-1.0404590278936155e-06
,
2.4487096487950135e-06
],
[
6.916139422884356e-08
,
-1.0404590282634733e-06
,
2.448709648661692e-06
],
[
6.916139415989972e-08
,
-1.0404590286333308e-06
,
2.4487096485283713e-06
],
[
6.916139409095615e-08
,
-1.040459029003189e-06
,
2.4487096483950496e-06
],
[
6.916139402201287e-08
,
-1.0404590293730477e-06
,
2.4487096482617296e-06
],
[
6.916139395306979e-08
,
-1.0404590297429065e-06
,
2.4487096481284087e-06
]
],
"reference_frame"
:
1
,
"constant_frames"
:
[
31001
,
31007
,
31006
],
"constant_rotation"
:
[
0.9999998732547144
,
-0.00032928542237557133
,
0.00038086961867138755
,
0.00032928600021094723
,
0.9999999457843062
,
-1.4544409378362713e-06
,
-0.00038086911909607826
,
1.5798557868269087e-06
,
0.9999999274681067
]
},
"naif_keywords"
:
{
"BODY301_RADII"
:
[
1737.4
,
1737.4
,
1737.4
],
"BODY_FRAME_CODE"
:
31001
,
"BODY_CODE"
:
301
,
"TKFRAME_-85700_UNITS"
:
"DEGREES"
,
"TKFRAME_-85700_ANGLES"
:
[
-47.6
,
0.0
,
0.0
],
"FRAME_-85700_CENTER"
:
-85.0
,
"INS-85700_TRANSX"
:
[
0.0
,
0.0
,
1.0
],
"INS-85700_TRANSY"
:
[
0.0
,
1.0
,
0.0
],
"FRAME_-85700_NAME"
:
"LRO_MINIRF"
,
"INS-85700_ITRANSL"
:
[
0.0
,
1.0
,
0.0
],
"TKFRAME_-85700_AXES"
:
[
1.0
,
2.0
,
3.0
],
"TKFRAME_-85700_SPEC"
:
"ANGLES"
,
"INS-85700_ITRANSS"
:
[
0.0
,
0.0
,
1.0
],
"FRAME_-85700_CLASS_ID"
:
-85700.0
,
"FRAME_-85700_CLASS"
:
4.0
,
"INS-85700_CK_FRAME_ID"
:
-85700.0
,
"TKFRAME_-85700_RELATIVE"
:
"LRO_SC_BUS"
,
"INS-85700_CK_REFERENCE_ID"
:
1.0
,
"BODY301_POLE_RA"
:
[
269.9949
,
0.0031
,
0.0
],
"BODY301_NUT_PREC_PM"
:
[
3.561
,
0.1208
,
-0.0642
,
0.0158
,
0.0252
,
-0.0066
,
-0.0047
,
-0.0046
,
0.0028
,
0.0052
],
"BODY301_NUT_PREC_RA"
:
[
-3.8787000000000003
,
-0.1204
,
0.07
,
-0.0172
,
0.0
,
0.0072
,
0.0
,
0.0
,
0.0
,
-0.0052
],
"BODY301_LONG_AXIS"
:
0.0
,
"BODY301_NUT_PREC_DEC"
:
[
1.5419
,
0.0239
,
-0.0278
,
0.0068
,
0.0
,
-0.0029
,
0.0009
,
0.0
,
0.0
,
0.0008
],
"BODY301_POLE_DEC"
:
[
66.5392
,
0.013
,
0.0
],
"BODY301_PM"
:
[
38.3213
,
13.17635815
,
-1.3999999999999999e-12
]
},
"instrument_position"
:
{
"instrument_position"
:
{
"spk_table_start_time"
:
325441417.4304223
,
"spk_table_start_time"
:
325441417.4304223
,
"spk_table_end_time"
:
325441420.7234223
,
"spk_table_end_time"
:
325441420.7234223
,
...
@@ -389,11 +689,11 @@
...
@@ -389,11 +689,11 @@
"positions"
:
[
"positions"
:
[
[
[
-1602.0413180595058
,
-1602.0413180595058
,
-516.351935571764
3
,
-516.351935571764
2
,
626.5629214314301
626.5629214314301
],
],
[
[
-1602.22227534262
79
,
-1602.22227534262
8
,
-516.2237329096426
,
-516.2237329096426
,
626.209036267832
626.209036267832
],
],
...
@@ -404,7 +704,7 @@
...
@@ -404,7 +704,7 @@
],
],
[
[
-1602.5839288255436
,
-1602.5839288255436
,
-515.967243518146
1
,
-515.967243518146
,
625.5011637017926
625.5011637017926
],
],
[
[
...
@@ -413,9 +713,9 @@
...
@@ -413,9 +713,9 @@
625.1471764111179
625.1471764111179
],
],
[
[
-1602.945234987235
4
,
-1602.945234987235
2
,
-515.7106407008863
,
-515.7106407008863
,
624.793155691575
4
624.793155691575
5
],
],
[
[
-1603.1257570271464
,
-1603.1257570271464
,
...
@@ -423,24 +723,24 @@
...
@@ -423,24 +723,24 @@
624.4391002690046
624.4391002690046
],
],
[
[
-1603.306191934958
2
,
-1603.306191934958
,
-515.4539272293902
,
-515.4539272293902
,
624.0850108587218
624.0850108587218
],
],
[
[
-1603.48653981498
,
-1603.48653981498
05
,
-515.325528489822
2
,
-515.325528489822
3
,
623.730887453277
3
623.730887453277
4
],
],
[
[
-1603.666800547996
2
,
-1603.666800547996
4
,
-515.1971017775081
,
-515.1971017775081
,
623.376730112280
7
623.376730112280
8
],
],
[
[
-1603.846974134003
,
-1603.846974134003
,
-515.0686471073512
,
-515.0686471073512
,
623.022538910241
623.022538910241
1
],
],
[
[
-1604.0270606624097
,
-1604.0270606624097
,
...
@@ -448,30 +748,30 @@
...
@@ -448,30 +748,30 @@
622.6683137055942
622.6683137055942
],
],
[
[
-1604.207060028901
9
,
-1604.207060028901
7
,
-514.8116538041043
,
-514.8116538041043
,
622.31405461010
49
622.31405461010
5
],
],
[
[
-1604.386972278178
3
,
-1604.386972278178
5
,
-514.683115230621
1
,
-514.683115230621
2
,
621.959761623773
9
621.959761623773
8
]
]
],
],
"velocities"
:
[
"velocities"
:
[
[
[
-0.714549428977381
7
,
-0.714549428977381
9
,
0.5060593097613282
,
0.5060593097613282
,
-1.396988974527007
-1.396988974527007
2
],
],
[
[
-0.714205855091195
2
,
-0.714205855091195
4
,
0.506169991152465
,
0.506169991152465
3
,
-1.39712359501336
65
-1.39712359501336
71
],
],
[
[
-0.7138622425358848
,
-0.7138622425358848
,
0.506280644944820
1
,
0.506280644944820
2
,
-1.3972581395953048
-1.3972581395953048
],
],
[
[
...
@@ -480,17 +780,17 @@
...
@@ -480,17 +780,17 @@
-1.3973926082640118
-1.3973926082640118
],
],
[
[
-0.713174901561941
2
,
-0.713174901561941
3
,
0.506501869683232
1
,
0.506501869683232
2
,
-1.397527000979457
-1.397527000979457
1
],
],
[
[
-0.71283117317578
69
,
-0.71283117317578
71
,
0.506612440617562
8
,
0.506612440617562
9
,
-1.397661317765054
-1.397661317765054
5
],
],
[
[
-0.71248740610275
88
,
-0.71248740610275
9
,
0.5067229839556711
,
0.5067229839556711
,
-1.3977955586435142
-1.3977955586435142
],
],
...
@@ -501,13 +801,13 @@
...
@@ -501,13 +801,13 @@
],
],
[
[
-0.7117997562042009
,
-0.7117997562042009
,
0.506943987741516
2
,
0.506943987741516
3
,
-1.398063812550803
1
-1.398063812550803
4
],
],
[
[
-0.711455873410670
7
,
-0.711455873410670
8
,
0.507054448177585
4
,
0.507054448177585
3
,
-1.398197825562591
3
-1.398197825562591
5
],
],
[
[
-0.711111952156552
,
-0.711111952156552
,
...
@@ -516,17 +816,17 @@
...
@@ -516,17 +816,17 @@
],
],
[
[
-0.7107679922960224
,
-0.7107679922960224
,
0.507275286080764
6
,
0.507275286080764
7
,
-1.3984656236281483
-1.3984656236281483
],
],
[
[
-0.710423993926029
7
,
-0.710423993926029
6
,
0.507385663562168
9
,
0.507385663562168
7
,
-1.398599408696237
-1.398599408696237
],
],
[
[
-0.710079957062597
1
,
-0.710079957062597
,
0.507496013380294
,
0.507496013380294
3
,
-1.3987331177658686
-1.3987331177658686
]
]
],
],
...
@@ -541,16 +841,16 @@
...
@@ -541,16 +841,16 @@
],
],
"positions"
:
[
"positions"
:
[
[
[
124045259.445408
79
,
124045259.445408
8
,
78574027.41897403
,
78574027.41897403
,
34095053.073064
79
34095053.073064
8
]
]
],
],
"velocities"
:
[
"velocities"
:
[
[
[
-16.302884180886178
,
-16.302884180886178
,
23.506531323358008
,
23.506531323358008
,
10.2326984729172
55
10.2326984729172
69
]
]
],
],
"reference_frame"
:
1
"reference_frame"
:
1
...
...
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