Commit cd6e9df8 authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Removed `field_offset` parameter, and updated README

parent 27c649d8
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -73,10 +73,9 @@ with $`x_{1,2} = x \pm \frac{w_x}{2} \qquad y_{1,2} = y \pm \frac{w_y}{2}`$. The
  pixel cell but the corner between pixels. Only used if the *model* parameter has the value **mesh**.
- `field_scale`:  Scaling factor of the weighting potential in x- and y-direction. By default, the scaling factors are set to
  `{1, 1}` and the field is used with its physical extent stated in the field data file.
- `field_offset`: Offset of the field in x- and y-direction. With this parameter and the mapping mode `SENSOR`, the field can
  be shifted e.g. by half a pixel pitch to accommodate for fields which have been simulated starting from the pixel center.
  The shift is applied in positive direction of the respective coordinate. Only used if the *model* parameter has the value
  **mesh**.
- `potential_depth` : Thickness of the weighting potential region. The weighting potential is set to zero in the region below the
  `potential_depth`. Defaults to the full sensor thickness. Only used if the *model* parameter has the value **mesh**.
  If the parameter is smaller than the field from an imported mesh, the field will be compressed in the z-direction.
- `ignore_field_dimensions`: If set to true, a wrong dimensionality of the input field is ignored, otherwise an exception is
  thrown. Defaults to false.
- `output_plots`:  Determines if output plots should be generated. Disabled by default.
+3 −12
Original line number Diff line number Diff line
@@ -74,17 +74,8 @@ void WeightingPotentialReaderModule::initialize() {
            field_scale = {{scales.x(), scales.y()}};
        }

        // Get the field offset in fractions of the field size, default is 0.0x0.0, i.e. no offset
        auto offset = config_.get<ROOT::Math::XYVector>("field_offset", {0.0, 0.0});
        if(offset.x() > 1.0 || offset.y() > 1.0) {
            throw InvalidValueError(config_,
                                    "field_offset",
                                    "shifting weighting potential by more than one pixel (offset > 1.0) is not allowed");
        }
        if(offset.x() < 0.0 || offset.y() < 0.0) {
            throw InvalidValueError(config_, "field_offset", "offsets for the weighting potential have to be positive");
        }
        LOG(DEBUG) << "Weighting potential has offset of " << offset << " fractions of the field size";
        // Set the field offset to zero; weighting potential needs to be centered around electrode
        std::array<double, 2> field_offset{{0.0, 0.0}};

        // Set the field grid, provide scale factors as fraction of the pixel pitch for correct scaling:
        detector_->setWeightingPotentialGrid(field_data.getData(),
@@ -92,7 +83,7 @@ void WeightingPotentialReaderModule::initialize() {
                                             field_data.getSize(),
                                             field_mapping,
                                             field_scale,
                                             {{offset.x(), offset.y()}},
                                             field_offset,
                                             thickness_domain);
    } else if(field_model == WeightingPotential::PAD) {
        LOG(TRACE) << "Adding weighting potential from pad in plane condenser";