Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Knoten
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Knoten
Commits
3081449c
Commit
3081449c
authored
5 years ago
by
Austin Sanders
Browse files
Options
Downloads
Patches
Plain Diff
Added additional parameters to external/reprojection diff functions
parent
a2823b27
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
knoten/vis.py
+7
-12
7 additions, 12 deletions
knoten/vis.py
with
7 additions
and
12 deletions
knoten/vis.py
+
7
−
12
View file @
3081449c
...
...
@@ -294,21 +294,17 @@ def plot_diff_3d_cone(data, title='3D diff plot', colx='x', coly='y', colz='z',
return
fig
def
reprojection_diff
(
isd
,
cube
,
nx
=
10
,
ny
=
50
,
width
=
500
,
height
=
500
,
edge_pad
=
0.0
):
def
reprojection_diff
(
isd
,
cube
,
nlines
,
nsamples
,
start_line
=
0
,
start_sample
=
0
,
nx
=
10
,
ny
=
50
,
width
=
500
,
height
=
500
,
edge_pad
=
0.0
):
"""
"""
isdjson
=
json
.
load
(
open
(
isd
))
nlines
=
isdjson
[
'
image_lines
'
]
nsamples
=
isdjson
[
'
image_samples
'
]
csmcam
=
csm
.
create_csm
(
isd
)
# generate meshgrid
xs
,
ys
=
np
.
mgrid
[
edge_pad
:
nsamples
-
edge_pad
:
nsamples
/
nx
,
edge_pad
:
nlines
-
edge_pad
:
nlines
/
ny
]
xs
,
ys
=
np
.
mgrid
[
start_sample
+
edge_pad
:
nsamples
-
edge_pad
:
nsamples
/
nx
,
start_line
+
edge_pad
:
nlines
-
edge_pad
:
nlines
/
ny
]
xs
,
ys
=
xs
.
flatten
(),
ys
.
flatten
()
csmcam
=
csm
.
create_csm
(
isd
)
# get data for isis image to ground, csm ground to image
isis_pts
=
point_info
(
cube
,
xs
,
ys
,
'
image
'
)
isisgnds
=
np
.
asarray
([
np
.
asarray
(
g
[
1
][
'
BodyFixedCoordinate
'
].
value
)
*
1000
for
g
in
isis_pts
])
...
...
@@ -325,7 +321,6 @@ def reprojection_diff(isd, cube, nx=10, ny=50, width=500, height=500, edge_pad=0
coldx
=
'
diff sample
'
,
coldy
=
'
diff line
'
,
title
=
"
ISIS2Ground->CSM2Image
"
,
width
=
width
,
height
=
height
)
# get data for csm image to ground, isis ground to image
csmgnds
=
np
.
asarray
([[
p
.
x
,
p
.
y
,
p
.
z
]
for
p
in
[
csmcam
.
imageToGround
(
csmapi
.
ImageCoord
(
y
,
x
),
0
)
for
x
,
y
in
zip
(
xs
,
ys
)]])
csmlon
,
csmlat
,
_
=
reproject
(
csmgnds
.
T
,
isdjson
[
'
radii
'
][
'
semimajor
'
],
isdjson
[
'
radii
'
][
'
semimajor
'
],
'
geocent
'
,
'
latlong
'
)
...
...
@@ -370,12 +365,11 @@ def reprojection_diff(isd, cube, nx=10, ny=50, width=500, height=500, edge_pad=0
return
isis2csm_plot
,
csm2isis_plot
,
isiscsm_latlonplot
,
isiscsm_bfplot
,
isis2csm_data
,
csm2isis_data
,
isiscsm_latlondata
,
isiscsm_bfdata
def
external_orientation_diff
(
isd
,
cube
,
nx
=
4
,
ny
=
4
,
width
=
500
,
height
=
500
):
def
external_orientation_diff
(
isd
,
cube
,
nlines
,
nsamples
,
start_line
=
0
,
start_sample
=
0
,
nx
=
4
,
ny
=
4
,
width
=
500
,
height
=
500
):
csmcam
=
csm
.
create_csm
(
isd
)
isdjson
=
json
.
load
(
open
(
isd
))
nlines
,
nsamples
=
isdjson
[
'
image_lines
'
],
isdjson
[
'
image_samples
'
]
xs
,
ys
=
np
.
mgrid
[
0
:
nsamples
:
nsamples
/
nx
,
0
:
nlines
:
nlines
/
ny
]
xs
,
ys
=
np
.
mgrid
[
start_sample
:
nsamples
:
nsamples
/
nx
,
start_line
:
nlines
:
nlines
/
ny
]
xs
,
ys
=
xs
.
flatten
(),
ys
.
flatten
()
isis_pts
=
point_info
(
cube
,
xs
,
ys
,
"
image
"
)
...
...
@@ -388,6 +382,7 @@ def external_orientation_diff(isd, cube, nx=4, ny=4, width=500, height=500):
csm_pos_bf
=
np
.
asarray
([[
lv
.
point
.
x
,
lv
.
point
.
y
,
lv
.
point
.
z
]
for
lv
in
csm_locus
])
csm_ephem_times
=
np
.
asarray
([
csmcam
.
getImageTime
(
csmapi
.
ImageCoord
(
y
,
x
))
for
x
,
y
in
zip
(
xs
,
ys
)])
csm_ephem_times
+=
isdjson
[
'
center_ephemeris_time
'
]
csm_ephem_times
=
np
.
around
(
csm_ephem_times
,
5
)
csmisis_diff_pos
=
csm_pos_bf
-
isis_pos_bf
csmisis_diff_lv
=
csm_lv_bf
-
isis_lv_bf
...
...
@@ -424,6 +419,6 @@ def external_orientation_diff(isd, cube, nx=4, ny=4, width=500, height=500):
colu
=
'
isis lv x
'
,
colv
=
'
isis lv y
'
,
colw
=
'
isis lv z
'
,
title
=
'
ISIS CSM Position and Look Vector Difference
'
,
width
=
width
,
height
=
height
)
csmisis_diff_ephem_plot
=
go
.
Figure
(
go
.
Scatter
(
x
=
np
.
linspace
(
0
,
nlines
,
ny
),
y
=
csmisis_diff_ephem
,
line_shape
=
'
spline
'
)).
update_layout
(
title
=
'
ISIS CSM Ephem Time Difference
'
,
width
=
width
,
height
=
height
/
2
).
update_xaxes
(
title_text
=
'
Line
'
).
update_yaxes
(
title_text
=
'
Time Delta Seconds
'
)
csmisis_diff_ephem_plot
=
go
.
Figure
(
go
.
Scatter
(
x
=
np
.
linspace
(
start_line
,
nlines
,
ny
),
y
=
csmisis_diff_ephem
,
line_shape
=
'
spline
'
)).
update_layout
(
title
=
'
ISIS CSM Ephem Time Difference
'
,
width
=
width
,
height
=
height
/
2
).
update_xaxes
(
title_text
=
'
Line
'
).
update_yaxes
(
title_text
=
'
Time Delta Seconds
'
)
return
csmisis_diff_lv_plot
,
csmisis_diff_ephem_plot
,
csmisis_diff_lv_data
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