def test_intersect_proximity(): ec = environment.EnvironmentalCorrelation() ec.intersect_proximity(mining_filename, vector_filename, proximity, test_filename) expected = spectral.open_image(correlated_filename) actual = spectral.open_image(test_filename) assert numpy.array_equal(expected.asarray(), actual.asarray()) assert actual.metadata.get( 'description') == 'COAL ' + pycoal.version + ' environmental ' \ 'correlation image.' assert expected.metadata.get('class names') == actual.metadata.get( 'class names') assert expected.metadata.get('map info') == actual.metadata.get('map info')
def run_environment(mining_filename, vector_filenames, correlation_filename): """Run environment correlation. :param mining_filename: Input mining classified file to be processed :param vector_filenames: Path(s) to hydrography data :param correlation_filename: Output environmental correlation image """ # create a new environmental correlation instance environmental_correlation = environment.EnvironmentalCorrelation() # generate an environmental correlation image of mining # pixels within 10 meters of a stream/dam/reservoir environmental_correlation.intersect_proximity(mining_filename, vector_filenames, 10.0, correlation_filename)