def pre_execute(self): oq = self.oqparam if oq.iml_disagg and not oq.disagg_by_src: # no need to run a PSHACalculator base.HazardCalculator.pre_execute(self) else: # we need to run a PSHACalculator cl = classical.PSHACalculator(oq, self.datastore.calc_id) cl.run() self.csm = cl.csm self.rlzs_assoc = cl.rlzs_assoc # often reduced logic tree self.sitecol = cl.sitecol
def execute(self): """Performs the disaggregation""" oq = self.oqparam if oq.iml_disagg: # no hazard curves are needed curves = [None] * len(self.sitecol) else: # only the poes_disagg are known, the IMLs are interpolated from # the hazard curves, hence the need to run a PSHACalculator here cl = classical.PSHACalculator(oq, self.monitor('classical'), calc_id=self.datastore.calc_id) cl.run() self.rlzs_assoc = cl.rlzs_assoc # often reduced logic tree curves = [self.get_curves(sid) for sid in self.sitecol.sids] self.check_poes_disagg(curves) return self.full_disaggregation(curves)