Example #1
0
 def append_a_waterfall_ptn(self, filename, wavelength,
                            bg_roi, bg_params, temp_dir=None):
     pattern = PatternPeakPo()
     pattern.read_file(filename)
     pattern.wavelength = wavelength
     pattern.display = False
     if temp_dir is None:
         pattern.get_chbg(bg_roi, params=bg_params, yshift=0)
     else:
         success = pattern.read_bg_from_tempfile(temp_dir=temp_dir)
         if not success:
             pattern.get_chbg(bg_roi, params=bg_params, yshift=0)
     self.waterfall_ptn.append(pattern)
Example #2
0
 def set_waterfall_ptn(
         self, filenames, wavelength, display, bg_roi, bg_params,
         temp_dir=None):
     new_waterfall_ptn = []
     for f, wl, dp in zip(filenames, wavelength, display):
         pattern = PatternPeakPo()
         pattern.read_file(f)
         pattern.wavelength = wl
         pattern.display = dp
         if temp_dir is None:
             pattern.get_chbg(bg_roi, params=bg_params, yshift=0)
         else:
             success = pattern.read_bg_from_tempfile(temp_dir=temp_dir)
             if not success:
                 pattern.get_chbg(bg_roi, params=bg_params, yshift=0)
         new_waterfall_ptn.append(pattern)
     self.waterfall_ptn = new_waterfall_ptn