def classical(srcs, gsims, params, slc, monitor=None): """ Read the SourceFilter, get the current slice of it (if tiling is enabled) and then call the classical calculator in hazardlib """ if monitor is None: # fix mispassed parameters (for disagg_by_src) monitor = slc slc = slice(None) srcfilter = monitor.read('srcfilter')[slc] return hazclassical(srcs, srcfilter, gsims, params, monitor)
def classical(srcs, sids, cmaker, monitor): """ Read the sitecol and call the classical calculator in hazardlib """ cmaker.init_monitoring(monitor) sitecol = monitor.read('sitecol') if sids is not None: sitecol = sitecol.filter(numpy.isin(sitecol.sids, sids)) result = hazclassical(srcs, sitecol, cmaker) # print(srcs, sum(src.weight for src in srcs)) return result
def classical_tile(srcs, cmaker, monitor): """ Read the sitecol, split it on tiles and call the classical calculator in hazardlib yielding the results for each tile """ cmaker.init_monitoring(monitor) sitecol = monitor.read('sitecol') for tile in sitecol.split_in_tiles(cmaker.ntiles): res = hazclassical(srcs, tile, cmaker) if res['pmap']: res['slc'] = slice(tile.sids.min(), tile.sids.max() + 1) yield res
def classical(srcs, rlzs_by_gsim, params, monitor): """ Read the SourceFilter and call the classical calculator in hazardlib """ srcfilter = monitor.read('srcfilter') return hazclassical(srcs, srcfilter, rlzs_by_gsim, params, monitor)
def classical(srcs, cmaker, monitor): """ Read the sitecol and call the classical calculator in hazardlib """ cmaker.init_monitoring(monitor) return hazclassical(srcs, monitor.read('sitecol'), cmaker)