diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 495529a2..6cfb7aa7 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -952,6 +952,7 @@ IndexingSettings Convert(const org::openapitools::server::model::Indexing_settin ret.RotationIndexing(input.isRotationIndexing()); ret.RotationIndexingAngularStride_deg(input.getRotationIndexingAngularStrideDeg()); ret.RotationIndexingMinAngularRange_deg(input.getRotationIndexingMinAngularRangeDeg()); + ret.BlockingBehavior(input.isBlocking()); return ret; } @@ -969,6 +970,7 @@ org::openapitools::server::model::Indexing_settings Convert(const IndexingSettin ret.setRotationIndexing(input.GetRotationIndexing()); ret.setRotationIndexingAngularStrideDeg(input.GetRotationIndexingAngularStride_deg()); ret.setRotationIndexingMinAngularRangeDeg(input.GetRotationIndexingMinAngularRange_deg()); + ret.setBlocking(input.GetBlockingBehavior()); org::openapitools::server::model::Geom_refinement_algorithm refinement; switch (input.GetGeomRefinementAlgorithm()) { diff --git a/broker/gen/model/Indexing_settings.cpp b/broker/gen/model/Indexing_settings.cpp index 8de04fb1..a797c2aa 100644 --- a/broker/gen/model/Indexing_settings.cpp +++ b/broker/gen/model/Indexing_settings.cpp @@ -33,6 +33,8 @@ Indexing_settings::Indexing_settings() m_Rotation_indexing = false; m_Rotation_indexing_min_angular_range_deg = 20.0f; m_Rotation_indexing_angular_stride_deg = 0.5f; + m_Blocking = false; + m_BlockingIsSet = false; } @@ -225,7 +227,7 @@ bool Indexing_settings::validate(std::stringstream& msg, const std::string& path } } - + return success; } @@ -274,8 +276,11 @@ bool Indexing_settings::operator==(const Indexing_settings& rhs) const && (getRotationIndexingAngularStrideDeg() == rhs.getRotationIndexingAngularStrideDeg()) + && + ((!blockingIsSet() && !rhs.blockingIsSet()) || (blockingIsSet() && rhs.blockingIsSet() && isBlocking() == rhs.isBlocking())) + ; } @@ -301,6 +306,8 @@ void to_json(nlohmann::json& j, const Indexing_settings& o) j["rotation_indexing"] = o.m_Rotation_indexing; j["rotation_indexing_min_angular_range_deg"] = o.m_Rotation_indexing_min_angular_range_deg; j["rotation_indexing_angular_stride_deg"] = o.m_Rotation_indexing_angular_stride_deg; + if(o.blockingIsSet()) + j["blocking"] = o.m_Blocking; } @@ -320,6 +327,11 @@ void from_json(const nlohmann::json& j, Indexing_settings& o) j.at("rotation_indexing").get_to(o.m_Rotation_indexing); j.at("rotation_indexing_min_angular_range_deg").get_to(o.m_Rotation_indexing_min_angular_range_deg); j.at("rotation_indexing_angular_stride_deg").get_to(o.m_Rotation_indexing_angular_stride_deg); + if(j.find("blocking") != j.end()) + { + j.at("blocking").get_to(o.m_Blocking); + o.m_BlockingIsSet = true; + } } @@ -435,6 +447,23 @@ void Indexing_settings::setRotationIndexingAngularStrideDeg(float const value) { m_Rotation_indexing_angular_stride_deg = value; } +bool Indexing_settings::isBlocking() const +{ + return m_Blocking; +} +void Indexing_settings::setBlocking(bool const value) +{ + m_Blocking = value; + m_BlockingIsSet = true; +} +bool Indexing_settings::blockingIsSet() const +{ + return m_BlockingIsSet; +} +void Indexing_settings::unsetBlocking() +{ + m_BlockingIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Indexing_settings.h b/broker/gen/model/Indexing_settings.h index 41673aaa..68ca3bb8 100644 --- a/broker/gen/model/Indexing_settings.h +++ b/broker/gen/model/Indexing_settings.h @@ -129,6 +129,13 @@ public: /// float getRotationIndexingAngularStrideDeg() const; void setRotationIndexingAngularStrideDeg(float const value); + /// + /// Indexing in Jungfraujoch goes with a dedicated thread pool. If set to false, the thread pool is non-blocking, i.e. if there are no threads available, image indexing will be skipped. If set to true, the thread pool will block until a thread is available. + /// + bool isBlocking() const; + void setBlocking(bool const value); + bool blockingIsSet() const; + void unsetBlocking(); friend void to_json(nlohmann::json& j, const Indexing_settings& o); friend void from_json(const nlohmann::json& j, Indexing_settings& o); @@ -161,6 +168,8 @@ protected: float m_Rotation_indexing_angular_stride_deg; + bool m_Blocking; + bool m_BlockingIsSet; }; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 50c2d28c..883c0410 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -1917,6 +1917,13 @@ components: format: float default: 0.5 minimum: 0 + blocking: + type: boolean + default: false + description: | + Indexing in Jungfraujoch goes with a dedicated thread pool. + If set to false, the thread pool is non-blocking, i.e. if there are no threads available, image indexing will be skipped. + If set to true, the thread pool will block until a thread is available. instrument_metadata: type: object description: "Metadata for a measurement instrument" diff --git a/broker/redoc-static.html b/broker/redoc-static.html index 9dfe8c63..79a96aa0 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -582,14 +582,17 @@ This option is using non-linear least squares optimization to find unit cell and viable_cell_min_spots
required
integer <int64> >= 5
Default: 10

Minimum number of indexed spots required for a cell to be considered viable

index_ice_rings
required
boolean
Default: false

Include spots marked as ice rings in the indexing run. If dataset_settings doesn't have detect_ice_rings on, this option will have no effect on processing.

-
rotation_indexing
required
boolean
Default: false
rotation_indexing_min_angular_range_deg
required
number <float> >= 1
Default: 20
rotation_indexing_angular_stride_deg
required
number <float> >= 0
Default: 0.5

Responses

rotation_indexing
required
boolean
Default: false
rotation_indexing_min_angular_range_deg
required
number <float> >= 1
Default: 20
rotation_indexing_angular_stride_deg
required
number <float> >= 0
Default: 0.5
blocking
boolean
Default: false

Indexing in Jungfraujoch goes with a dedicated thread pool. +If set to false, the thread pool is non-blocking, i.e. if there are no threads available, image indexing will be skipped. +If set to true, the thread pool will block until a thread is available.

+

Responses

Request samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get indexing configuration

Can be done anytime

+
http://localhost:5232/config/indexing

Request samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5,
  • "blocking": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get indexing configuration

Can be done anytime

Responses

Response samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5
}

Change file writer settings

This can only be done when detector is Idle, Error or Inactive states.

+
http://localhost:5232/config/indexing

Response samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5,
  • "thread_count": 1,
  • "geom_refinement_algorithm": "BeamCenter",
  • "unit_cell_dist_tolerance": 0.05,
  • "viable_cell_min_spots": 10,
  • "index_ice_rings": false,
  • "rotation_indexing": false,
  • "rotation_indexing_min_angular_range_deg": 20,
  • "rotation_indexing_angular_stride_deg": 0.5,
  • "blocking": false
}

Change file writer settings

This can only be done when detector is Idle, Error or Inactive states.

Request Body schema: application/json
overwrite
boolean
Default: false

Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.

format
string (file_writer_format)
Default: "NXmxLegacy"
Enum: "NXmxOnlyData" "NXmxLegacy" "NXmxVDS" "NXmxIntegrated" "CBF" "TIFF" "NoFileWritten"

NoFileWritten - no files are written at all NXmxOnlyData - only data files are written, no master file @@ -796,7 +799,7 @@ This can only be done when detector is Idle, Error or

Request samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get general statistics

Responses

Response samples

Content type
application/json
{
  • "detector": {
    },
  • "detector_list": {
    },
  • "detector_settings": {
    },
  • "image_format_settings": {
    },
  • "instrument_metadata": {
    },
  • "file_writer_settings": {
    },
  • "data_processing_settings": {
    },
  • "measurement": {
    },
  • "broker": {
    },
  • "fpga": [
    ],
  • "calibration": [
    ],
  • "zeromq_preview": {
    },
  • "zeromq_metadata": {
    },
  • "dark_mask": {
    },
  • "pixel_mask": {
    },
  • "roi": {
    },
  • "az_int": {
    },
  • "buffer": {
    },
  • "indexing": {
    },
  • "image_pusher": {
    }
}

Get data collection statistics

Results of the last data collection

+
http://localhost:5232/statistics

Response samples

Content type
application/json
{
  • "detector": {
    },
  • "detector_list": {
    },
  • "detector_settings": {
    },
  • "image_format_settings": {
    },
  • "instrument_metadata": {
    },
  • "file_writer_settings": {
    },
  • "data_processing_settings": {
    },
  • "measurement": {
    },
  • "broker": {
    },
  • "fpga": [
    ],
  • "calibration": [
    ],
  • "zeromq_preview": {
    },
  • "zeromq_metadata": {
    },
  • "dark_mask": {
    },
  • "pixel_mask": {
    },
  • "roi": {
    },
  • "az_int": {
    },
  • "buffer": {
    },
  • "indexing": {
    },
  • "image_pusher": {
    }
}

Get data collection statistics

Results of the last data collection

Responses