Skip to content

Commit

Permalink
Y vs TOF is now displayed. This refs #5801
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Oct 9, 2012
1 parent 7ed5438 commit 9b57909
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,44 @@ RefMatrixWSImageView::RefMatrixWSImageView( QString wps_name)

double total_ymin = 0;
double total_ymax = 255;
size_t total_rows = 256;

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

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

float *data = new float[size_t(total_ymax * sz)];

for (int px=0; px<=total_xmax; px++)
std::cout << "Starting the for loop " << std::endl;
std::cout << "total_xmax: " << total_xmax << std::endl;
std::cout << "sz is : " << sz << std::endl;

std::vector<double> yaxis;
for (int px=0; px<total_ymax; px++)
{
//retrieve data now
std::vector<double> yaxis = ws->readY(px);
for (int tof=0; tof<=sz; tof++)
yaxis = ws->readY(px);
for (int tof=0; tof<sz-1; tof++)
{
data[px*sz + tof] = yaxis[tof];
}
}



std::cout << "about to create RefArrayDataSource" << std::endl;
RefArrayDataSource* source = new RefArrayDataSource(total_xmin, total_xmax,
total_ymin, total_ymax,
total_rows, total_cols,
data);
std::cout << "done with RefArrayDataSource" << 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 );
// RefArrayDataSource* source = new RefArrayDataSource(wps_name);
image_view = new RefImageView( source );
}

RefMatrixWSImageView::~RefMatrixWSImageView()
Expand Down

0 comments on commit 9b57909

Please sign in to comment.