Adding n_bad_modules to bernina

This commit is contained in:
2018-07-16 16:54:38 +02:00
parent 56f8f06e19
commit 55d7f3c712
+8 -6
View File
@@ -11,10 +11,10 @@
int main (int argc, char *argv[])
{
if (argc != 9) {
if (argc != 10) {
cout << endl;
cout << "Usage: bernina_h5_writer [connection_address] [output_file] [n_frames]";
cout << " [rest_port] [user_id] [bsread_address] [n_modules] [dataset_name]" << endl;
cout << " [rest_port] [user_id] [bsread_address] [n_modules] [detector_name]" << endl;
cout << "\tconnection_address: Address to connect to the stream (PULL). Example: tcp://127.0.0.1:40000" << endl;
cout << "\toutput_file: Name of the output file." << endl;
cout << "\tn_frames: Number of images to acquire. 0 for infinity (until /stop is called)." << endl;
@@ -22,7 +22,8 @@ int main (int argc, char *argv[])
cout << "\tuser_id: uid under which to run the writer. -1 to leave it as it is." << endl;
cout << "\tbsread_address: HTTP address of the bsread REST api." << endl;
cout << "\tn_modules: Number of detector modules to be written." << endl;
cout << "\tdataset_name: Name of the detector data dataset in the file format." << endl;
cout << "\tn_bad_modules: Number of detector modules which has more then half bad pixels" << endl;
cout << "\tdetector_name: Name of the detector, data will be written as data/detector_name/ " << endl;
cout << endl;
exit(-1);
@@ -35,7 +36,8 @@ int main (int argc, char *argv[])
int user_id = atoi(argv[5]);
string bsread_rest_address = string(argv[6]);
int n_modules = atoi(argv[7]);
string dataset_name = string(argv[8]);
int n_bad_modules = atoi(argv[8]);
string detector_name = string(argv[9]);
if (user_id != -1) {
writer_utils::set_process_id(user_id);
@@ -43,7 +45,7 @@ int main (int argc, char *argv[])
writer_utils::create_destination_folder(output_file);
BerninaFormat format(dataset_name);
BerninaFormat format(detector_name,n_bad_modules);
WriterManager manager(format.get_input_value_type(), output_file, n_frames);
auto header_values = shared_ptr<unordered_map<string, HeaderDataType>>(new unordered_map<string, HeaderDataType> {
@@ -70,4 +72,4 @@ int main (int argc, char *argv[])
ProcessManager::run_writer(manager, format, receiver, rest_port, bsread_rest_address);
return 0;
}
}