diff --git a/plio/io/io_controlnetwork.py b/plio/io/io_controlnetwork.py index 5e03f93c48476c9f0710808cc01081feb8376942..54697b5b2d3d8967eb573972b4a100b36942784e 100644 --- a/plio/io/io_controlnetwork.py +++ b/plio/io/io_controlnetwork.py @@ -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 diff --git a/plio/io/tests/test_io_controlnetwork.py b/plio/io/tests/test_io_controlnetwork.py index c93663e05acdf642a20ed98297f94f94d555ba8a..9d13793e05518a251bdb6e1c82bb106bc2e7905b 100644 --- a/plio/io/tests/test_io_controlnetwork.py +++ b/plio/io/tests/test_io_controlnetwork.py @@ -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): diff --git a/setup.py b/setup.py index de3006ec14d79159963fa34446190ded04d09859..85ed9c859db3a40c0123e804fc28723bbaaee81a 100644 --- a/setup.py +++ b/setup.py @@ -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."),