Example #1
0
    def _export_spec_factory(self):
        # dc = self.collector
        # fb = dc.get_fit_block(-1, self.fits)

        # rs_name, rs_text = self._assemble_script_blob()
        rid = self.per_spec.run_spec.runid

        # blanks = self.get_previous_blanks()

        # dkeys = [d.name for d in self._active_detectors]
        # sf = dict(zip(dkeys, fb))
        # p = self._current_data_frame

        ic = self.per_spec.isotope_group.get_ic_factor('CDD')

        exp = MassSpecExportSpec(
            runid=rid,
            runscript_name=self.per_spec.runscript_name,
            runscript_text=self.per_spec.runscript_blob,
            # signal_fits=sf,
            mass_spectrometer=self.per_spec.run_spec.mass_spectrometer.
            capitalize(),
            # blanks=blanks,
            # data_path=p,
            isotopes=self.per_spec.isotope_group.isotopes,
            # signal_intercepts=si,
            # signal_intercepts=self._processed_signals_dict,
            is_peak_hop=self.per_spec.save_as_peak_hop,
            ic_factor_v=float(nominal_value(ic)),
            ic_factor_e=float(std_dev(ic)))
        exp.load_record(self.per_spec.run_spec)

        return exp
    def _make_spec(self, ai):
        rs_name, rs_text = '', ''
        rid = ai.record_id
        exp = MassSpecExportSpec(
            runid=rid,
            runscript_name=rs_name,
            runscript_text=rs_text,
            mass_spectrometer=ai.mass_spectrometer.capitalize(),
            isotopes=ai.isotopes)

        exp.load_record(ai)
        return exp
Example #3
0
 def setUp(self):
     data_path = '/Users/ross/Sandbox/aaaa_isotope.h5'
     self.spec = MassSpecExportSpec(data_path=data_path)