예제 #1
0
파일: emission.py 프로젝트: bmattern/minixs
  def process_binned(self, E1, E2, Estep, killzone_mask=None):
    """
    Process spectrum binning

    Parameters:
      E1 - low edge of lowest bin
      E2 - high edge of highest bin
      Estep = bin width
      killzone_mask - optional mask of regions to ignore entirely

    See Calibration.process for prerequisites and results
    """
    calib = calibrate.load(self.calibration_file)

    # zero out killzones of calibration matrix
    # (this causes those pixels to be ignored)
    if killzone_mask is not None:
      calib.calibration_matrix[killzone_mask] = 0

    exposure = Exposure()
    exposure.load_multi(self.exposure_files)
    exposure.apply_filters(self.incident_energy, self.filters)
    spectrum = binned_emission_spectrum(calib.calibration_matrix,
                                        exposure,
                                        E1,
                                        E2,
                                        Estep,
                                        self.I0)
    self._set_spectrum(spectrum)
예제 #2
0
    def process_binned(self, E1, E2, Estep, killzone_mask=None):
        """
    Process spectrum binning

    Parameters:
      E1 - low edge of lowest bin
      E2 - high edge of highest bin
      Estep = bin width
      killzone_mask - optional mask of regions to ignore entirely

    See Calibration.process for prerequisites and results
    """
        calib = calibrate.load(self.calibration_file)

        # zero out killzones of calibration matrix
        # (this causes those pixels to be ignored)
        if killzone_mask is not None:
            calib.calibration_matrix[killzone_mask] = 0

        exposure = Exposure()
        exposure.load_multi(self.exposure_files)
        exposure.apply_filters(self.incident_energy, self.filters)
        spectrum = binned_emission_spectrum(calib.calibration_matrix, exposure,
                                            E1, E2, Estep, self.I0)
        self._set_spectrum(spectrum)
예제 #3
0
    def process(self,
                emission_energies=None,
                skip_columns=[],
                killzone_mask=None):
        """
    Process Emission Spectrum

    Parameters:
      emission_energies - list of points in emission energy grid
                          if None, a uniform 0.1 eV grid covering range of calibration energies is used
      skip_columns      - columns (for vertical disp. dir.) or rows (for horizontal) to skip entirely
      killzone_mask     - mask of regions to skip in processing

    Prerequisites:
      self.calibration_file must be set to calibration filename
      self.exposure_files must be a list of exposure filenames
      self.filters must be a list of mx.filter.Filter descendents to apply to integrated exposures
                   (may be empty list)
      self.solid_angle_map may be a map of solid angles subtended by each pixel

    Results:
      self.spectrum is set to processed spectrum
      self.emission, self.intensity, self.uncertainty, self.raw_counts and self.num_pixels are set to
        corresponding columns of spectrum
    """
        calibration = calibrate.Calibration()
        calibration.load(self.calibration_file)

        exposure = Exposure()
        exposure.load_multi(self.exposure_files)

        for f in self.filters:
            f.filter(exposure.pixels, self.incident_energy)

        # generate emission energies from range of calibration matrix
        if emission_energies is None:
            Emin, Emax = calibration.energy_range()
            emission_energies = np.arange(Emin, Emax, .1)

        spectrum = process_spectrum(calibration.calibration_matrix,
                                    exposure,
                                    emission_energies,
                                    self.I0,
                                    calibration.dispersive_direction,
                                    calibration.xtals,
                                    self.solid_angle_map,
                                    skip_columns=skip_columns,
                                    killzone_mask=killzone_mask)

        self._set_spectrum(spectrum)
예제 #4
0
파일: emission.py 프로젝트: bmattern/minixs
  def process(self, emission_energies=None, skip_columns=[], killzone_mask=None):
    """
    Process Emission Spectrum

    Parameters:
      emission_energies - list of points in emission energy grid
                          if None, a uniform 0.1 eV grid covering range of calibration energies is used
      skip_columns      - columns (for vertical disp. dir.) or rows (for horizontal) to skip entirely
      killzone_mask     - mask of regions to skip in processing

    Prerequisites:
      self.calibration_file must be set to calibration filename
      self.exposure_files must be a list of exposure filenames
      self.filters must be a list of mx.filter.Filter descendents to apply to integrated exposures
                   (may be empty list)
      self.solid_angle_map may be a map of solid angles subtended by each pixel

    Results:
      self.spectrum is set to processed spectrum
      self.emission, self.intensity, self.uncertainty, self.raw_counts and self.num_pixels are set to
        corresponding columns of spectrum
    """
    calibration = calibrate.Calibration()
    calibration.load(self.calibration_file)

    exposure = Exposure()
    exposure.load_multi(self.exposure_files)

    for f in self.filters:
      f.filter(exposure.pixels, self.incident_energy)

    # generate emission energies from range of calibration matrix
    if emission_energies is None:
      Emin, Emax = calibration.energy_range()
      emission_energies = np.arange(Emin,Emax,.1)

    spectrum = process_spectrum(calibration.calibration_matrix,
                                exposure,
                                emission_energies,
                                self.I0,
                                calibration.dispersive_direction,
                                calibration.xtals,
                                self.solid_angle_map,
                                skip_columns=skip_columns,
                                killzone_mask=killzone_mask)

    self._set_spectrum(spectrum)