diff --git a/common/DiffractionExperiment.cpp b/common/DiffractionExperiment.cpp index 0e6b26aa..b184f805 100644 --- a/common/DiffractionExperiment.cpp +++ b/common/DiffractionExperiment.cpp @@ -816,7 +816,7 @@ int64_t DiffractionExperiment::GetStorageCellNumber() const { } int64_t DiffractionExperiment::GetStorageCellStart() const { - return internal.storage_cell_start(); + return internal.storage_cell_start() - internal.storage_cells() + 1; } float DiffractionExperiment::GetLowQForRadialInt_recipA() const { diff --git a/tests/DiffractionExperimentTest.cpp b/tests/DiffractionExperimentTest.cpp index 4c9cb2d8..abb64c8e 100644 --- a/tests/DiffractionExperimentTest.cpp +++ b/tests/DiffractionExperimentTest.cpp @@ -632,6 +632,7 @@ TEST_CASE("DiffractionExperiment_StorageCells","[DiffractionExperiment]") { REQUIRE(x.GetSummation() == 1); REQUIRE(x.GetImageNumPerTrigger() == 5); REQUIRE(x.GetNumTriggers() == num_triggers); + REQUIRE(x.GetStorageCellStart() == 15); REQUIRE_THROWS(x.StorageCells(5)); REQUIRE_THROWS(x.StorageCells(0)); @@ -642,12 +643,15 @@ TEST_CASE("DiffractionExperiment_StorageCells","[DiffractionExperiment]") { REQUIRE_NOTHROW(x.StorageCells(4)); REQUIRE(x.GetStorageCellNumber() == 4); + REQUIRE(x.GetStorageCellStart() == 12); REQUIRE_NOTHROW(x.StorageCells(8)); REQUIRE(x.GetStorageCellNumber() == 8); + REQUIRE(x.GetStorageCellStart() == 8); x.StorageCells(16); REQUIRE(x.GetStorageCellNumber() == 16); + REQUIRE(x.GetStorageCellStart() == 0); REQUIRE(x.GetSummation() == 1); REQUIRE(x.GetImageNumPerTrigger() == x.GetStorageCellNumber()); REQUIRE(x.GetFrameNumPerTrigger() == x.GetStorageCellNumber());