Commit deb97580 authored by Laura, Jason R's avatar Laura, Jason R
Browse files

More abstracted sensor updates

parent 5d7eac17
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ release.
### Added
- Ability to choose whether to compute overlaps for a network candidate graph
- Integration tests for end-to-end of an equatorial CTX pair and a mid-latitude CTX trio.
- AGeoDataset class that abstracts the plio GeoDataset class. The AGeoDataset includes sensor models on the GeoDataset object. The object automatically instantiates an autocnet surface model using either an EllipsoidDem or a GdalDem. ISIS sensor models use the DEM defined on the cube. CSM sensor models must have a DEM explicitly passed.

### Changed
- CI on the library now uses a mocked sqlalchemy connection. All tests can now run locally without the need for a supplemental postgres container. This changed removed some non-optimal tests that were testing datbase triggers and database instantiation handled by SQLAlchemy.
+2 −2
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ from autocnet.io.db.model import Images, Keypoints, Matches,\
                                 Cameras, Base, Overlay, Edges,\
                                 Costs, Measures, Points, Measures
from autocnet.io.db.wrappers import DbDataFrame
from autocnet.io.geodataset import AGeoDataset

from plio.io.io_gdal import GeoDataset
from csmapi import csmapi

# set up the logging file
@@ -727,7 +727,7 @@ class Edge(dict, MutableMapping):
        Estimate a source and destination minimum bounding rectangle, in
        pixel space.
        """
        if not isinstance(self.source.geodata, GeoDataset):
        if not isinstance(self.source.geodata, AGeoDataset):
            smbr = None
            dmbr = None
        else:
+4 −5
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import shapely.ops
from plio.io.io_controlnetwork import to_isis, from_isis
from plio.io import io_hdf, io_json
from plio.utils import utils as io_utils
from plio.io.io_gdal import GeoDataset
from plio.io.isis_serial_number import generate_serial_number
from plio.io import io_controlnetwork as cnet

@@ -40,7 +39,6 @@ from .. import sql

from plurmy import Slurm

import autocnet
from autocnet.config_parser import parse_config
from autocnet.cg import cg
from autocnet.graph.asynchronous_funcs import watch_insert_queue, watch_update_queue
@@ -52,7 +50,8 @@ from autocnet.io.db import controlnetwork as io_controlnetwork
from autocnet.io.db.model import (Images, Keypoints, Matches, Cameras, Points,
                                  Base, Overlay, Edges, Costs, Measures, CandidateGroundPoints,
                                  JsonEncoder, try_db_creation)
from autocnet.io.db.connection import new_connection, Parent
from autocnet.io.db.connection import new_connection
from autocnet.io.geodataset import AGeoDataset
from autocnet.matcher import subpixel
from autocnet.matcher import cross_instrument_matcher as cim
from autocnet.vis.graph_view import plot_graph, cluster_plot
@@ -229,10 +228,10 @@ class CandidateGraph(nx.Graph):
            filelist = io_utils.file_to_list(filelist)
        # TODO: Reject unsupported file formats + work with more file formats
        if basepath:
            datasets = [GeoDataset(os.path.join(basepath, f))
            datasets = [AGeoDataset(os.path.join(basepath, f))
                        for f in filelist]
        else:
            datasets = [GeoDataset(f) for f in filelist]
            datasets = [AGeoDataset(f) for f in filelist]

        # This is brute force for now, could swap to an RTree at some point.
        adjacency_dict = {}
+5 −7
Original line number Diff line number Diff line
@@ -5,14 +5,12 @@ import pytest
from osgeo import ogr
import numpy as np
import pandas as pd
from plio.io import io_gdal
from shapely.geometry import Polygon as Poly

from autocnet.matcher import cpu_outlier_detector as od
from autocnet.examples import get_path
from autocnet.graph.network import CandidateGraph
from autocnet.utils.utils import array_to_poly

from autocnet.io.geodataset import AGeoDataset
from .. import edge
from .. import node

@@ -35,8 +33,8 @@ class TestEdge(unittest.TestCase):
        destination = Mock(spec = node.Node)
        e.destination = destination
        e.source = source
        geodata_s = Mock(spec = io_gdal.GeoDataset)
        geodata_d = Mock(spec = io_gdal.GeoDataset)
        geodata_s = Mock(spec = AGeoDataset)
        geodata_d = Mock(spec = AGeoDataset)
        source.geodata = geodata_s
        destination.geodata = geodata_d

@@ -85,8 +83,8 @@ class TestEdge(unittest.TestCase):
        e.source = source_node
        e.destination = destination_node

        source_geodata = PropertyMock(spec=io_gdal.GeoDataset)
        destination_geodata = PropertyMock(spec=io_gdal.GeoDataset)
        source_geodata = PropertyMock(spec=AGeoDataset)
        destination_geodata = PropertyMock(spec=AGeoDataset)

        e.source.geodata = source_geodata
        e.destination.geodata = destination_geodata
+1 −3
Original line number Diff line number Diff line
@@ -12,14 +12,12 @@ from unittest.mock import patch, PropertyMock, MagicMock
import geopandas as gpd
import numpy as np
from osgeo import ogr
from plio.io import io_gdal

from autocnet.examples import get_path

from .. import network
from .. import edge
from .. import node
import warnings

sys.path.insert(0, os.path.abspath('..'))

@@ -300,7 +298,7 @@ def test_fromlist():
    good_poly = ogr.CreateGeometryFromWkt('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))')
    bad_poly = ogr.CreateGeometryFromWkt('POLYGON ((9999 10, 40 40, 20 40, 10 20, 30 10))')

    with patch('plio.io.io_gdal.GeoDataset.footprint', new_callable=PropertyMock) as patch_fp:
    with patch('autocnet.io.geodataset.AGeoDataset.footprint', new_callable=PropertyMock) as patch_fp:
        patch_fp.return_value = good_poly
        n = network.CandidateGraph.from_filelist(mock_list, get_path('Apollo15'))
        assert n.number_of_nodes() == 6
Loading