Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plio
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
Plio
Commits
85945b3c
Commit
85945b3c
authored
5 years ago
by
Tyler Thatcher
Committed by
acpaquette
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Makes controlnetwork consistent (#131)
* Fixing to_isis / from_isis process * Removed merge conflict * Fixed tests
parent
2af6ec5b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plio/io/io_controlnetwork.py
+7
-6
7 additions, 6 deletions
plio/io/io_controlnetwork.py
plio/io/tests/test_io_controlnetwork.py
+2
-2
2 additions, 2 deletions
plio/io/tests/test_io_controlnetwork.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
10 additions
and
9 deletions
plio/io/io_controlnetwork.py
+
7
−
6
View file @
85945b3c
...
@@ -248,7 +248,7 @@ class IsisStore(object):
...
@@ -248,7 +248,7 @@ class IsisStore(object):
# TODO: Rewrite using apply syntax for performance
# TODO: Rewrite using apply syntax for performance
point_sizes
=
[]
point_sizes
=
[]
point_messages
=
[]
point_messages
=
[]
for
i
,
g
in
df
.
groupby
(
'
point_
id
'
):
for
i
,
g
in
df
.
groupby
(
'
id
'
):
# Get the point specification from the protobuf
# Get the point specification from the protobuf
point_spec
=
cnf
.
ControlPointFileEntryV0002
()
point_spec
=
cnf
.
ControlPointFileEntryV0002
()
...
@@ -258,11 +258,12 @@ class IsisStore(object):
...
@@ -258,11 +258,12 @@ class IsisStore(object):
# set with the correct type
# set with the correct type
#point_spec.id = _set_pid(i)
#point_spec.id = _set_pid(i)
point_spec
.
id
=
_set_pid
(
i
)
point_spec
.
id
=
_set_pid
(
i
)
point_spec
.
type
=
g
.
iloc
[
0
].
pointType
for
attr
,
attrtype
in
self
.
point_attrs
:
for
attr
,
attrtype
in
self
.
point_attrs
:
if
attr
in
g
.
columns
:
if
attr
in
g
.
columns
:
# As per protobuf docs for assigning to a repeated field.
# As per protobuf docs for assigning to a repeated field.
if
attr
==
'
aprioriCovar
'
:
if
attr
==
'
aprioriCovar
'
or
attr
==
'
adjustedCovar
'
:
arr
=
g
.
iloc
[
0
][
'
aprioriCovar
'
]
arr
=
g
.
iloc
[
0
][
attr
]
if
isinstance
(
arr
,
np
.
ndarray
):
if
isinstance
(
arr
,
np
.
ndarray
):
arr
=
arr
.
ravel
().
tolist
()
arr
=
arr
.
ravel
().
tolist
()
...
@@ -282,9 +283,9 @@ class IsisStore(object):
...
@@ -282,9 +283,9 @@ class IsisStore(object):
setattr
(
measure_spec
,
attr
,
attrtype
(
m
[
attr
]))
setattr
(
measure_spec
,
attr
,
attrtype
(
m
[
attr
]))
measure_spec
.
serialnumber
=
m
.
serialnumber
measure_spec
.
serialnumber
=
m
.
serialnumber
# ISIS pixels are centered on (0.5, 0.5). NDArrays are (0,0) based.
# ISIS pixels are centered on (0.5, 0.5). NDArrays are (0,0) based.
measure_spec
.
sample
=
m
.
x
+
0.5
measure_spec
.
sample
=
m
[
'
sample
'
]
+
0.5
measure_spec
.
line
=
m
.
y
+
0.5
measure_spec
.
line
=
m
[
'
line
'
]
+
0.5
measure_spec
.
type
=
m
.
measure
_t
ype
measure_spec
.
type
=
m
.
measure
T
ype
measure_iterable
.
append
(
measure_spec
)
measure_iterable
.
append
(
measure_spec
)
self
.
nmeasures
+=
1
self
.
nmeasures
+=
1
...
...
This diff is collapsed.
Click to expand it.
plio/io/tests/test_io_controlnetwork.py
+
2
−
2
View file @
85945b3c
...
@@ -39,7 +39,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
...
@@ -39,7 +39,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
serial_times
=
{
295
:
'
1971-07-31T01:24:11.754
'
,
serial_times
=
{
295
:
'
1971-07-31T01:24:11.754
'
,
296
:
'
1971-07-31T01:24:36.970
'
}
296
:
'
1971-07-31T01:24:36.970
'
}
cls
.
serials
=
{
i
:
'
APOLLO15/METRIC/{}
'
.
format
(
j
)
for
i
,
j
in
enumerate
(
serial_times
.
values
())}
cls
.
serials
=
{
i
:
'
APOLLO15/METRIC/{}
'
.
format
(
j
)
for
i
,
j
in
enumerate
(
serial_times
.
values
())}
columns
=
[
'
point_id
'
,
'
t
ype
'
,
'
serialnumber
'
,
'
measure
t
ype
'
,
'
x
'
,
'
y
'
,
'
image_index
'
]
columns
=
[
'
id
'
,
'
pointT
ype
'
,
'
serialnumber
'
,
'
measure
T
ype
'
,
'
sample
'
,
'
line
'
,
'
image_index
'
]
data
=
[]
data
=
[]
for
i
in
range
(
cls
.
npts
):
for
i
in
range
(
cls
.
npts
):
...
@@ -60,7 +60,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
...
@@ -60,7 +60,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
serial_times
=
{
295
:
'
1971-07-31T01:24:11.754
'
,
serial_times
=
{
295
:
'
1971-07-31T01:24:11.754
'
,
296
:
'
1971-07-31T01:24:36.970
'
}
296
:
'
1971-07-31T01:24:36.970
'
}
serials
=
{
i
:
'
APOLLO15/METRIC/{}
'
.
format
(
j
)
for
i
,
j
in
enumerate
(
serial_times
.
values
())}
serials
=
{
i
:
'
APOLLO15/METRIC/{}
'
.
format
(
j
)
for
i
,
j
in
enumerate
(
serial_times
.
values
())}
columns
=
[
'
point_id
'
,
'
t
ype
'
,
'
serialnumber
'
,
'
measure
t
ype
'
,
'
x
'
,
'
y
'
,
'
image_index
'
]
columns
=
[
'
id
'
,
'
pointT
ype
'
,
'
serialnumber
'
,
'
measure
T
ype
'
,
'
sample
'
,
'
line
'
,
'
image_index
'
]
data
=
[]
data
=
[]
for
i
in
range
(
self
.
npts
):
for
i
in
range
(
self
.
npts
):
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
85945b3c
...
@@ -8,7 +8,7 @@ with open('README.md', 'r') as f:
...
@@ -8,7 +8,7 @@ with open('README.md', 'r') as f:
def
setup_package
():
def
setup_package
():
setup
(
setup
(
name
=
"
plio
"
,
name
=
"
plio
"
,
version
=
'
1.2.
1
'
,
version
=
'
1.2.
2
'
,
author
=
"
Jay Laura
"
,
author
=
"
Jay Laura
"
,
author_email
=
"
jlaura@usgs.gov
"
,
author_email
=
"
jlaura@usgs.gov
"
,
description
=
(
"
I/O API to support planetary data formats.
"
),
description
=
(
"
I/O API to support planetary data formats.
"
),
...
...
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