Skip to content
Snippets Groups Projects
Commit 85945b3c authored by Tyler Thatcher's avatar Tyler Thatcher Committed by acpaquette
Browse files

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
......@@ -248,7 +248,7 @@ class IsisStore(object):
# TODO: Rewrite using apply syntax for performance
point_sizes = []
point_messages = []
for i, g in df.groupby('point_id'):
for i, g in df.groupby('id'):
# Get the point specification from the protobuf
point_spec = cnf.ControlPointFileEntryV0002()
......@@ -258,11 +258,12 @@ class IsisStore(object):
# set with the correct type
#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:
if attr in g.columns:
# As per protobuf docs for assigning to a repeated field.
if attr == 'aprioriCovar':
arr = g.iloc[0]['aprioriCovar']
if attr == 'aprioriCovar' or attr == 'adjustedCovar':
arr = g.iloc[0][attr]
if isinstance(arr, np.ndarray):
arr = arr.ravel().tolist()
......@@ -282,9 +283,9 @@ class IsisStore(object):
setattr(measure_spec, attr, attrtype(m[attr]))
measure_spec.serialnumber = m.serialnumber
# ISIS pixels are centered on (0.5, 0.5). NDArrays are (0,0) based.
measure_spec.sample = m.x + 0.5
measure_spec.line = m.y + 0.5
measure_spec.type = m.measure_type
measure_spec.sample = m['sample'] + 0.5
measure_spec.line = m['line'] + 0.5
measure_spec.type = m.measureType
measure_iterable.append(measure_spec)
self.nmeasures += 1
......
......@@ -39,7 +39,7 @@ 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 = ['point_id', 'type', 'serialnumber', 'measuretype', 'x', 'y', 'image_index']
columns = ['id', 'pointType', 'serialnumber', 'measureType', 'sample', 'line', 'image_index']
data = []
for i in range(cls.npts):
......@@ -60,7 +60,7 @@ class TestWriteIsisControlNetwork(unittest.TestCase):
serial_times = {295: '1971-07-31T01:24:11.754',
296: '1971-07-31T01:24:36.970'}
serials = {i:'APOLLO15/METRIC/{}'.format(j) for i, j in enumerate(serial_times.values())}
columns = ['point_id', 'type', 'serialnumber', 'measuretype', 'x', 'y', 'image_index']
columns = ['id', 'pointType', 'serialnumber', 'measureType', 'sample', 'line', 'image_index']
data = []
for i in range(self.npts):
......
......@@ -8,7 +8,7 @@ with open('README.md', 'r') as f:
def setup_package():
setup(
name = "plio",
version = '1.2.1',
version = '1.2.2',
author = "Jay Laura",
author_email = "jlaura@usgs.gov",
description = ("I/O API to support planetary data formats."),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment