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
3aba5dba
Commit
3aba5dba
authored
5 years ago
by
Jesse Mapel
Browse files
Options
Downloads
Patches
Plain Diff
Added check for repeated fields in protobuf
parent
162bc90f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plio/io/io_controlnetwork.py
+8
-1
8 additions, 1 deletion
plio/io/io_controlnetwork.py
plio/io/tests/test_io_controlnetwork.py
+3
-3
3 additions, 3 deletions
plio/io/tests/test_io_controlnetwork.py
with
11 additions
and
4 deletions
plio/io/io_controlnetwork.py
+
8
−
1
View file @
3aba5dba
...
...
@@ -270,6 +270,9 @@ class IsisStore(object):
arr
=
arr
.
ravel
().
tolist
()
point_spec
.
aprioriCovar
.
extend
(
arr
)
# If field is repeated you must extend instead of assign
elif
cnf
.
_CONTROLPOINTFILEENTRYV0002
.
fields_by_name
[
attr
].
label
==
3
:
getattr
(
point_spec
,
attr
).
extend
(
g
.
iloc
[
0
][
df_attr
])
else
:
setattr
(
point_spec
,
attr
,
attrtype
(
g
.
iloc
[
0
][
df_attr
]))
...
...
@@ -284,7 +287,11 @@ class IsisStore(object):
# Un-mangle common attribute names between points and measures
df_attr
=
self
.
measure_field_map
.
get
(
attr
,
attr
)
if
df_attr
in
g
.
columns
:
setattr
(
measure_spec
,
attr
,
attrtype
(
m
[
df_attr
]))
# If field is repeated you must extend instead of assign
if
cnf
.
_CONTROLPOINTFILEENTRYV0002_MEASURE
.
fields_by_name
[
attr
].
label
==
3
:
getattr
(
measure_spec
,
attr
).
extend
(
m
[
df_attr
])
else
:
setattr
(
measure_spec
,
attr
,
attrtype
(
m
[
df_attr
]))
# ISIS pixels are centered on (0.5, 0.5). NDArrays are (0,0) based.
measure_spec
.
sample
=
m
[
'
sample
'
]
+
0.5
measure_spec
.
line
=
m
[
'
line
'
]
+
0.5
...
...
This diff is collapsed.
Click to expand it.
plio/io/tests/test_io_controlnetwork.py
+
3
−
3
View file @
3aba5dba
...
...
@@ -39,12 +39,12 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
serial_times
=
{
295
:
'
1971-07-31T01:24:11.754
'
,
296
:
'
1971-07-31T01:24:36.970
'
}
cls
.
serials
=
{
i
:
'
APOLLO15/METRIC/{}
'
.
format
(
j
)
for
i
,
j
in
enumerate
(
serial_times
.
values
())}
columns
=
[
'
id
'
,
'
pointType
'
,
'
serialnumber
'
,
'
measureType
'
,
'
sample
'
,
'
line
'
,
'
image_index
'
]
columns
=
[
'
id
'
,
'
pointType
'
,
'
serialnumber
'
,
'
measureType
'
,
'
sample
'
,
'
line
'
,
'
image_index
'
,
'
pointLog
'
,
'
measureLog
'
]
data
=
[]
for
i
in
range
(
cls
.
npts
):
data
.
append
((
i
,
2
,
cls
.
serials
[
0
],
2
,
0
,
0
,
0
))
data
.
append
((
i
,
2
,
cls
.
serials
[
1
],
2
,
0
,
0
,
1
))
data
.
append
((
i
,
2
,
cls
.
serials
[
0
],
2
,
0
,
0
,
0
,
[],
[]
))
data
.
append
((
i
,
2
,
cls
.
serials
[
1
],
2
,
0
,
0
,
1
,
[],
[]
))
df
=
pd
.
DataFrame
(
data
,
columns
=
columns
)
...
...
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