Commit 15ac3d6c authored by Jan Oliver Oelerich's avatar Jan Oliver Oelerich

More bug fixes.

parent 70f20e57
......@@ -305,7 +305,7 @@ void IO::writeParams(const shared_ptr<GridManager> &gridman, const string &conf_
{
auto g = pg.defineGroup("grating");
g.att("nominal_density", p.samplingDensity());
g.att("density", p.samplingDensity());
g.att("nx", gridman->samplingX());
g.att("ny", gridman->samplingY());
g.att("slice_thickness", p.sliceThickness());
......@@ -485,8 +485,6 @@ IO::writeCOM(unsigned int idefocus, unsigned int iconf, const shared_ptr<GridMan
float w = 1.0;
float * intensities_to_write = ibuf->ptr(point.com);
if(p.adfAverageDefoci())
w *= gridman->defocusWeights()[idefocus];
......@@ -502,13 +500,16 @@ IO::writeCOM(unsigned int idefocus, unsigned int iconf, const shared_ptr<GridMan
for(size_t j = 0; j < _com_buffer.size(); ++j)
_com_buffer[j] += w * ibuf->value(point.com, j);
intensities_to_write = _com_buffer.data();
} else {
for(size_t j = 0; j < _com_buffer.size(); ++j)
_com_buffer[j] = w * ibuf->value(point.com, j);
}
v.put(vs({idefocus_store, point.adf_row, point.adf_col, iconf_store, 0, 0}),
vs({1, 1, 1, 1, n_slices_total, 2}),
intensities_to_write);
_com_buffer);
} catch(NcException &e) {
output::error("STEM %s\n", e.what());
......@@ -552,8 +553,6 @@ void IO::writeAdfIntensities(unsigned int idefocus, unsigned int iconf, const sh
float w = 1.0;
float * intensities_to_write = ibuf->ptr(point.adf_intensities);
if(p.adfAverageDefoci())
w *= gridman->defocusWeights()[idefocus];
......@@ -569,12 +568,14 @@ void IO::writeAdfIntensities(unsigned int idefocus, unsigned int iconf, const sh
for(size_t j = 0; j < _adf_intensities_buffer.size(); ++j)
_adf_intensities_buffer[j] += w * ibuf->value(point.adf_intensities, j);
intensities_to_write = _adf_intensities_buffer.data();
} else {
for(size_t j = 0; j < _adf_intensities_buffer.size(); ++j)
_adf_intensities_buffer[j] = w * ibuf->value(point.adf_intensities, j);
}
v.put(vs({idefocus_store, point.adf_row, point.adf_col, iconf_store, 0, 0}),
vs({1, 1, 1, 1, n_slices_total, nangles}),
intensities_to_write);
_adf_intensities_buffer);
} catch(NcException &e) {
......@@ -619,8 +620,6 @@ void IO::writeCBEDIntensities(unsigned int idefocus, unsigned int iconf, const s
float w = 1.0;
float * intensities_to_write = cbuf->ptr(point.cbed_intensities);
if(p.cbedAverageDefoci())
w *= gridman->defocusWeights()[idefocus];
......@@ -639,13 +638,16 @@ void IO::writeCBEDIntensities(unsigned int idefocus, unsigned int iconf, const s
for(size_t j = 0; j < _cbed_intensities_buffer.size(); ++j)
_cbed_intensities_buffer[j] += w * cbuf->value(point.cbed_intensities, j);
intensities_to_write = _cbed_intensities_buffer.data();
} else {
for(size_t j = 0; j < _cbed_intensities_buffer.size(); ++j)
_cbed_intensities_buffer[j] = w * cbuf->value(point.cbed_intensities, j);
}
v.put(vs({idefocus_store, point.cbed_row, point.cbed_col, iconf_store, 0, 0, 0}),
vs({1, 1, 1, 1, n_slices_total, nx, ny}),
intensities_to_write);
_cbed_intensities_buffer);
} catch(NcException &e) {
output::error("CBED %s\n", e.what());
......
......@@ -306,7 +306,7 @@ void Params::readParamsFromNCFile(const std::string & path) {
{
auto gg = g.group("grating");
_sample_density = gg.att<double>("nominal_density");
_sample_density = gg.att<double>("density");
_slice_thickness = gg.att<double>("slice_thickness");
_nkx = gg.att<unsigned int>("nx");
_nky = gg.att<unsigned int>("ny");
......@@ -325,7 +325,7 @@ void Params::readParamsFromNCFile(const std::string & path) {
get<0>(_adf_detector_angles) = gg.att<double>("detector_min_angle");
get<1>(_adf_detector_angles) = gg.att<double>("detector_max_angle");
get<2>(_adf_detector_angles) = gg.att<unsigned int>("detector_num_angles");
_adf_detector_interval_exponent = gg.att<double>("detector_interval_exponent");
_adf_detector_interval_exponent = gg.att<float>("detector_interval_exponent");
_adf_average_configurations = gg.is("average_configurations");
_adf_average_defoci = gg.is("average_defoci");
......
......@@ -398,7 +398,7 @@ namespace stemsalabim {
* 1 - linear interval (default)
* > 1 - adaptive interval (smaller angles -> finer sampling)
*/
double adfDetectorIntervalExponent() const {
float adfDetectorIntervalExponent() const {
return _adf_detector_interval_exponent;
}
......@@ -577,7 +577,7 @@ namespace stemsalabim {
std::tuple<double, double> _adf_scan_y{std::make_tuple(0.0, 1.0)};
unsigned int _adf_save_every_n_slices{1};
std::tuple<double, double, unsigned int> _adf_detector_angles{std::make_tuple(1.0, 300.0, 300)};
double _adf_detector_interval_exponent{1.0};
float _adf_detector_interval_exponent{1.0};
bool _adf_average_configurations{true};
bool _adf_average_defoci{true};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment