예제 #1
0
void InstrumentWindowPickTab::updatePlot(int detid)
{
  if (m_instrWindow->blocked())
  {
    m_plot->clearCurve();
    return;
  }
  if (m_plotPanel->isCollapsed()) return;
  InstrumentActor* instrActor = m_instrWindow->getInstrumentActor();
  Mantid::API::MatrixWorkspace_const_sptr ws = instrActor->getWorkspace();
  if (detid >= 0)
  {
    if (m_one->isChecked() || m_peak->isChecked())
    {// plot spectrum of a single detector
      plotSingle(detid);
    }
    else if (m_tube->isChecked())
    {// plot integrals
      plotTube(detid);
    }
  }
  else
  {
    m_plot->clearCurve();
  }
  m_plot->recalcAxisDivs();
  m_plot->replot();
}
예제 #2
0
/**
 * Update the miniplot for a selected detector.
 * @param detid :: ID of detector to use to update the plot.
 */
void InstrumentWindowPickTab::updatePlot(int detid)
{
    if (m_instrWindow->blocked())
    {
        m_plot->clearCurve();
        return;
    }
    if (m_plotPanel->isCollapsed()) return;

    if (detid >= 0)
    {
        if (m_one->isChecked() || m_peak->isChecked())
        {   // plot spectrum of a single detector
            plotSingle(detid);
        }
        else if (m_tube->isChecked())
        {   // plot integrals
            plotTube(detid);
        }
    }
    else
    {
        m_plot->clearCurve();
    }
    m_plot->recalcAxisDivs();
    m_plot->replot();
}
// processSingle - finish up including a single spectrum
void SpectraSTReplicates::processSingle(SpectraSTLibEntry* single, bool isRaw) {

  if (m_numUsed == 1) {
    single->setOneComment("Spec", "Single");
  }
  single->setStatus("Normal"); // reset

  string dummy("");
  if (!isRaw && !(single->getOneComment("Probcorr", dummy))) {
    // enforce the peak quorum  -- for this only entry (note that this is necessary 
    // in the case where the entry is previously created with a lower quorum)
    // hack - don't do this for NIST spectra, which have this Probcorr field, since the
    // quorum specification has different format
    int minNumRepWithPeak = (int)((double)m_numUsed * m_params.peakQuorum - 0.00001) + 1;
    if (minNumRepWithPeak < 1) minNumRepWithPeak = 1;
    single->getPeakList()->removeInquoratePeaks(minNumRepWithPeak);
  }
  
  if (isRaw && m_denoiser && m_denoiser->isFilterReady()) {
    m_denoiser->filter(single->getPeakList(), m_params.maximumNumPeaksKept, m_params.denoiserMinimumSignalProb);
  }
  
  if (m_params.maximumNumPeaksKept > 0) {
    double retained = 1.0;
    retained = single->getPeakList()->simplify(m_params.maximumNumPeaksKept, 99999.0);
  }

  single->annotatePeaks();

 //   single->getPeakList()->flattenAllPeaks();
 //  single->getPeakList()->removeNoncanonicalPeaks();

  string specType("");
  if (m_params.plotSpectra == "ALL" || m_params.plotSpectra == single->getStatus() || 
      (single->getOneComment("Spec", specType) && !m_params.plotSpectra.empty() && m_params.plotSpectra == specType)) {
    plotSingle(single);
  }
  
}