Loading knoten/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,6 @@ from csmapi import csmapi # Register the usgscam plugin with the csmapi lib = ctypes.CDLL(find_library('usgscsm.so')) lib = ctypes.CDLL(find_library('usgscsm')) if not lib: warnings.warn('Unable to load usgscsm shared library') knoten/csm.py +30 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,30 @@ def create_camera(label, url='http://pfeffer.wr.usgs.gov/api/1.0/pds/'): model = plugin.constructModelFromISD(isd, model_name) return model def create_csm(image): """ Given an image file create a Community Sensor Model. Parameters ---------- image : str The image filename to create a CSM for Returns ------- model : object A CSM sensor model (or None if no associated model is available.) """ isd = csmapi.Isd(image) plugins = csmapi.Plugin.getList() for plugin in plugins: num_models = plugin.getNumModels() for model_index in range(num_models): model_name = plugin.getModelName(model_index) if plugin.canModelBeConstructedFromISD(isd, model_name): return plugin.constructModelFromISD(isd, model_name) def generate_boundary(isize, npoints=10): ''' Generates a bounding box given a camera model Loading Loading @@ -340,5 +364,3 @@ def generate_vrt(raster_size, gcps, fpath, 'no_data_value':no_data_value} template = jinja2.Template(vrt) return template.render(context) Loading
knoten/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,6 @@ from csmapi import csmapi # Register the usgscam plugin with the csmapi lib = ctypes.CDLL(find_library('usgscsm.so')) lib = ctypes.CDLL(find_library('usgscsm')) if not lib: warnings.warn('Unable to load usgscsm shared library')
knoten/csm.py +30 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,30 @@ def create_camera(label, url='http://pfeffer.wr.usgs.gov/api/1.0/pds/'): model = plugin.constructModelFromISD(isd, model_name) return model def create_csm(image): """ Given an image file create a Community Sensor Model. Parameters ---------- image : str The image filename to create a CSM for Returns ------- model : object A CSM sensor model (or None if no associated model is available.) """ isd = csmapi.Isd(image) plugins = csmapi.Plugin.getList() for plugin in plugins: num_models = plugin.getNumModels() for model_index in range(num_models): model_name = plugin.getModelName(model_index) if plugin.canModelBeConstructedFromISD(isd, model_name): return plugin.constructModelFromISD(isd, model_name) def generate_boundary(isize, npoints=10): ''' Generates a bounding box given a camera model Loading Loading @@ -340,5 +364,3 @@ def generate_vrt(raster_size, gcps, fpath, 'no_data_value':no_data_value} template = jinja2.Template(vrt) return template.render(context)