Skip to content
Snippets Groups Projects
Commit 0276094f authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

ditto for msa

parent 21bed78a
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ Release 2.3.6a of :
- Command crp to restrict plot range
- New integral operations firstwith, lastwith
- Improved functionality:
- In binning (mpa, msa), computation of sampling error is now optional
- Commands gp, gf, gp!, gf!, gfa to create, overwrite, or append to graphic file
- Integral operations now return integers when appropriate
- Cleaner implementation of refined curve plotting
......
......@@ -466,6 +466,7 @@ bool frida_command(string cmd)
" msd delete\n"
" msr retain\n"
" msa average\n"
" msas average, error estimate includes sampling error\n"
" msb break into files\n"
" msj join\n"
" ms* spawn spectra\n"
......@@ -518,7 +519,9 @@ bool frida_command(string cmd)
} else if (cmd == "msr") {
NManip::slices_select(false);
} else if (cmd == "msa") {
NManip::slices_rebin();
NManip::slices_rebin(false);
} else if (cmd == "msas") {
NManip::slices_rebin(true);
} else if (cmd == "msb") {
NManip::slices_break();
} else if (cmd == "msj") {
......
......@@ -116,7 +116,7 @@ void NManip::points_select(const bool sel_del)
//! Bin points.
void NManip::points_rebin(const bool sampling_error)
void NManip::points_rebin(const bool sampling_err)
{
FileIterator fiter(SFSel::instance()->selD());
......@@ -142,7 +142,7 @@ void NManip::points_rebin(const bool sampling_error)
throw S("First bin must start at 0");
breaks.push_back(sin->size());
PSpec sout = sin->binned(breaks, sampling_error);
PSpec sout = sin->binned(breaks, sampling_err);
fout->V.push_back(move(sout));
}
......@@ -153,7 +153,7 @@ void NManip::points_rebin(const bool sampling_error)
//! Bin points.
void NManip::points_rebin_by_factor(const bool sampling_error)
void NManip::points_rebin_by_factor(const bool sampling_err)
{
FileIterator fiter(SFSel::instance()->selD());
static int ng = 2;
......@@ -175,7 +175,7 @@ void NManip::points_rebin_by_factor(const bool sampling_error)
for (int iout = 0; iout < nout + 1; ++iout)
breaks[iout] = iout * ng;
PSpec sout = sin->binned(breaks, sampling_error);
PSpec sout = sin->binned(breaks, sampling_err);
fout->V.push_back(move(sout));
}
......@@ -597,7 +597,7 @@ void NManip::slices_select(const bool sel_del)
//! Bin spectra.
void NManip::slices_rebin()
void NManip::slices_rebin(const bool sampling_err)
{
FileIterator fiter(SFSel::instance()->sel());
vector<int> JSel;
......@@ -639,7 +639,7 @@ void NManip::slices_rebin()
if (fd) {
PSpec sout(new CSpec());
bool in_with_dy = fd->VS(ji)->has_dy();
bool out_with_dy = in_with_dy || mj > 1;
bool out_with_dy = in_with_dy || (sampling_err && mj > 1);
int n = fd->nPts(ji);
sout->resize(n, out_with_dy);
// x grids must be equal:
......@@ -677,10 +677,11 @@ void NManip::slices_rebin()
for (int jj = ji; jj < jf; jj++) {
if (fd->VS(jj)->has_dy())
vm_src += SQR(fd->VS(jj)->dy[i]);
vm_grp += SQR(fd->VS(jj)->y[i] - ym);
if (sampling_err)
vm_grp += SQR(fd->VS(jj)->y[i] - ym);
}
double vm = vm_src / mj / mj;
if (mj > 1)
if (sampling_err && mj > 1)
vm += vm_grp / (mj - 1);
sout->dy[i] = sqrt(vm);
}
......
......@@ -28,7 +28,7 @@ void points_remove_err();
void points_interpolate();
void points_redistribute();
void slices_select(const bool sel_del);
void slices_rebin();
void slices_rebin(const bool sampling_err);
void slices_merge();
void slices_break();
void slices_spawn();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment