arjeneh / jpowder

Automatically exported from code.google.com/p/jpowder
1 stars 0 forks source link

Add tool which allow smoothing of 3D plots #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Basically ones say 300 datasets are plotted as e.g. a function of pressure the 
user may just want the plot to highlight the most striking changes as a 
function of pressure and smooth out all other features

Original issue reported on code.google.com by anders.m...@stfc.ac.uk on 21 Dec 2010 at 4:05

GoogleCodeExporter commented 9 years ago
Before completing this sent Balsamiq mock-up around

Original comment by anders.m...@stfc.ac.uk on 16 Jan 2011 at 2:42

GoogleCodeExporter commented 9 years ago
Probably just apply some blurring to each dataset. Balsamiq not necessary.

Original comment by anders.m...@stfc.ac.uk on 16 Jan 2011 at 2:47

GoogleCodeExporter commented 9 years ago
For smoothing implement a slightly modified version of the moving average 
described on http://en.wikipedia.org/wiki/Moving_average .

On the smoothing panel display:

Moving average. Number of points to average over:  COMBO INPUT BOX  1
                                                                    3
                                                                    5
                                                                    .
                                                                    .
                                                                    101 

Call the number input by the user in the COMBO INPUT 'n'.
Say we have 'm' data points with values (y_1, e_1), (y_2,e_2), ....,
(y_m, e_m), where d_i is the i'th y-value and e_i the associated error.
Then in psudo code the moving average algorithm to implement is:

numberOfPointsEitherSize = (n - 1) / 2  // number of points to include either 
size 
                                        // of the point in question when calculate 
                                        // the new average value at that point 
yNew = initialize to zero array of size m 
eNew = initialize to zero array of size m
for (int i = 1; i <= m; i++)
  for (int j = max(0, i-numberOfPointsEitherSize); 
       j <= min(m,i+numberOfPointsEitherSize); j++)
  { 
    yNew[i] += y[j];
    eNew[i] += e[j]*e[j];
  }
  eNew[i] = sqrt(eNew[i]);
}

// finally replace original data values with newly calculated
// averaged values
for (int i = 1; i <= m; i++)
{
  y[i] = yNew[i];
  e[i] = eNew[i];
}

Original comment by anders.m...@stfc.ac.uk on 28 Jul 2012 at 7:38