Skip to content

Commit

Permalink
Changed the default value for rebin. Continued work on RefDetectorVie…
Browse files Browse the repository at this point in the history
…wer. This refs #5801
  • Loading branch information
JeanBilheux committed Oct 8, 2012
1 parent 851fe15 commit 01f8d67
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def PyInit(self):
Description="TOF range to use")
self.declareProperty("TofRangeFlag", True,
Description="If true, the TOF will be cropped according to the TOFRange property")
self.declareProperty("QMin", 0.001,
self.declareProperty("QMin", 0.005,
Description="Minimum Q-value")
self.declareProperty("QStep", 0.001,
self.declareProperty("QStep", 0.01,
Description="Step-size in Q. Enter a negative value to get a log scale.")
self.declareProperty("AngleOffset", 0.0,
Description="Angle offset (degrees)")
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/MantidQt/RefDetectorViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set ( SRC_FILES
src/RefMatrixWSDataSource.cpp
src/RefMatrixWSImageView.cpp
src/ArrayDataSource.cpp
src/RefArrayDataSource.cpp
src/ErrorHandler.cpp
)

Expand All @@ -36,6 +37,7 @@ set ( INC_FILES
inc/MantidQtRefDetectorViewer/RefMatrixWSDataSource.h
inc/MantidQtRefDetectorViewer/RefMatrixWSImageView.h
inc/MantidQtRefDetectorViewer/ArrayDataSource.h
inc/MantidQtRefDetectorViewer/RefArrayDataSource.h
inc/MantidQtRefDetectorViewer/ErrorHandler.h
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "MantidQtRefDetectorViewer/DllOptionIV.h"
#include "MantidAPI/MatrixWorkspace.h"

#include "MantidAPI/Algorithm.h"
#include "MantidQtRefDetectorViewer/RefImageView.h"

/**
Expand Down Expand Up @@ -41,19 +41,21 @@ namespace MantidQt
namespace RefDetectorViewer
{

class EXPORT_OPT_MANTIDQT_IMAGEVIEWER RefMatrixWSImageView
class EXPORT_OPT_MANTIDQT_IMAGEVIEWER RefMatrixWSImageView
{
public:

/// Construct an image viewer for the specifed MatrixWorkspace
RefMatrixWSImageView( Mantid::API::MatrixWorkspace_sptr mat_ws );
RefMatrixWSImageView ( Mantid::API::MatrixWorkspace_sptr mat_ws );

RefMatrixWSImageView( QString wps_name);

~RefMatrixWSImageView();
~RefMatrixWSImageView();

private:
private:

RefImageView *image_view;

};

} // namespace MantidQt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#include <iostream>
#include "MantidQtRefDetectorViewer/RefMatrixWSImageView.h"
#include "MantidQtRefDetectorViewer/RefMatrixWSDataSource.h"
#include "MantidQtRefDetectorViewer/RefArrayDataSource.h"
#include "MantidAPI/WorkspaceProperty.h"
#include "MantidAPI/Algorithm.h"
#include "MantidKernel/System.h"
#include "MantidAPI/IEventWorkspace.h"

using Mantid::API::MatrixWorkspace_sptr;
using namespace MantidQt;
using namespace RefDetectorViewer;
using Mantid::API::WorkspaceProperty;
using Mantid::API::Algorithm;
using namespace Mantid::Kernel;
using namespace Mantid::API;

/**
* Construct an ImageView for the specified matrix workspace
Expand All @@ -18,9 +27,35 @@ RefMatrixWSImageView::RefMatrixWSImageView( MatrixWorkspace_sptr mat_ws )
// is closed
}

RefMatrixWSImageView::RefMatrixWSImageView( QString )
RefMatrixWSImageView::RefMatrixWSImageView( QString wps_name)
{
// RefMatrixWSDataSource* source = new RefMatrixWSDataSource(wps_name);

IEventWorkspace_sptr ws;
ws = AnalysisDataService::Instance().retrieveWS<IEventWorkspace>(wps_name.toStdString());

double total_ymin = 0;
double total_ymax = 256;

std::vector<double> xaxis = ws->readX(0);
int sz = xaxis.size();

double total_xmin = xaxis[0];
double total_xmax = xaxis[sz-1];

//retrieve data now
std::vector<double> yaxis = ws->readY(256);

std::cout << yaxis.size() << std::endl;





//std::cout << "ws->readX(0).size(): " << ws->readX(0).size() << std::endl;

// declareProperty(new WorkspaceProperty<>("InputWorkspace","",Direction::Input));

RefArrayDataSource* source = new RefArrayDataSource(wps_name);
// image_view = new RefImageView( source );
}

Expand Down

0 comments on commit 01f8d67

Please sign in to comment.