Commit 250dc4ec authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Merge pull request #307 from jessemapel/json_warn

Added warning when json file cannot be written out
parents 96309fcb f49aaef3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -617,8 +617,11 @@ class NetworkNode(Node):
        if model_name is None:
            return
        isdpath = os.path.splitext(self['image_path'])[0] + '.json'
        try:
            with open(isdpath, 'w') as f:
                json.dump(response, f)
        except Exception as e:
            warnings.warn('Failed to write JSON ISD for image {}.\n{}'.format(self['image_path'], e))
        isd = csmapi.Isd(self['image_path'])
        plugin = csmapi.Plugin.findPlugin('UsgsAstroPluginCSM')
        self._camera = plugin.constructModelFromISD(isd, model_name)