Esempio n. 1
0
File: pfr.py Progetto: ralesi/rex
    def get_coverage(self):
        loading = self._params.get('loading')
        if loading != 0:
            cov = []
            covcor = []

            stages = [ADSORPTION, DESORPTION_P + DESORPTION_T]

            summing = [1 ,-1]

            # TODO make iteration more streamlined

            for i, stage in enumerate(stages):

                flux = self._curves.get('flux',stage)[0]
                flux_corr = self._curves.get('flux:corr',stage)[0]

                cov.append(analysis.running_sum(flux, summing[i]) / loading)
                covcor.append(analysis.running_sum(flux_corr, summing[i]) / loading)

            # Save Curves
            self._curves.compose('cov', cov, stages, 'Amine Efficiency')
            self._curves.compose('cov:corr', covcor , stages, 'Amine Efficiency')

            # and save parameter information
            self._params.set('effc:ads', covcor[0].max())
            self._params.set('effc:des', covcor[1].max())
            self._params.set('eff:ads', cov[0].max())
            self._params.set('eff:des', cov[1].max())
Esempio n. 2
0
    def get_coverage(self):
        loading = self.p.get('loading')
        if loading != 0:
            cov = []
            covcor = []

            stages = [ADSORPTION, DESORPTION_P + DESORPTION_T]
            summing = [1,-1]

            for i, stage in enumerate(stages):
                co2 = self.c.get('conc:co2',stage)[0]/100
                if len(co2) == 0:
                    cov.append(np.array([0,0],float))
                    covcor.append(np.array([0,0],float))
                    continue

                flux = self.c.get('flux:dt:co2',stage)[0]
                #flux_corr = self.c.get('flux:c:co2',stage)[0]


                cov.append(analysis.running_sum(flux, summing[i]) / loading)
                #covcor.append(analysis.running_sum(flux_corr, summing[i]) / loading)



            # Save Curves
            self.c.compose('cov', cov, stages, 'Amine Efficiency %')
            #self.c.compose('cov:corr', covcor , stages, 'Amine Efficiency')

            # and save parameter information
            #self.p.set('effc:ads', covcor[0].max())
            #self.p.set('effc:des', covcor[1].max())
            self.p.set('eff:ads', cov[0].max())
            self.p.set('eff:des', cov[1].max())