def plot_hmaps(imt, calc_id, webapi=False): """ Mean hazard maps plotter. """ extractor = WebExtractor(calc_id) if webapi else Extractor(calc_id) with extractor: oq = extractor.oqparam sitecol = extractor.get('sitecol').array hmaps = extractor.get('hmaps/%s' % str(imt)).array lons, lats = sitecol['lon'], sitecol['lat'] plt = make_figure(lons, lats, imt, oq.imtls[str(imt)], oq.poes, hmaps) plt.show()
def ex(self, calc_id, what): """Extract data from a local engine server""" ex = WebExtractor(calc_id, 'http://localhost:8800', '', '') try: return ex.get(what) finally: ex.close()
def webex(self, calc_id, what): """Extract data from a remote calculation""" ex = WebExtractor(calc_id) try: return ex.get(what) finally: ex.close()