Compare commits

..

1 Commits

Author SHA1 Message Date
f377e1aae2 fill value in hdf5 according to actual datatype of dataset 2024-08-08 17:38:50 +02:00
20 changed files with 113 additions and 107 deletions

View File

@ -22,8 +22,6 @@ Common
* Check transeiver and fibers are compatible (all MMF 850nm or all SMF 1030nm)
* Check fiber
* Check fiber polarity (if short range, unplug the link anywhere, and look at the light/dark pattern: dark has to mate with light)
* For Jungfrau, check if the blue sfp light is blinking rapidly (even when it is not sending data). If so, most likely the link is down and something is wrong with the board. If it connected to a switch, then you do not see it with the ethtool command if link is down. One option is to connect it directly to a pc to see if link is down.
* With nc, try "nc -u -p 50001 -l" in receiving pc, and from another pc try "echo hallo | nc -u 10.1.2.172 50001" to send something to the recieving pc interface to see if the link is up and see if the other nc console receives the hallo.
#. Detector is not acquiring (Not Eiger)
* Take an acquisition with many images and using the following steps instead of acquire:
@ -49,20 +47,11 @@ Common
* Ensure that the interfaces (on NIC and the switch) used in receiver pc have MTU 9000 (jumbo frames) enabled.
#. Check if 'rx packets' counter in 'ifconfig' do not increment for interface.
#. Check if 'rx_frames' counter in 'ifconfig' do not increment for interface.
* If no, check switch configuration if present. Port counters of switch can also help to identify problem.
* If yes, but receiver software does not see it:
* Check no firewall (eg. firewalld) is present or add rules
.. code-block:: bash
# Stop and disable firewall
service firewalld stop
systemctl disable firewalld
# Check status
service firewalld status
* Check that selinux is disabled ( or add rules)
#. Source UDP IP in config file (Not Eiger)

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv8.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv8.0.2

View File

@ -181,7 +181,7 @@ int main(int argc, char *argv[]) {
#endif
#ifndef MOENCH04
moench03v2Data *decoder = new moench03v2Data(nrows/2);
moench03v2Data *decoder = new moench03v2Data(100);
cout << "MOENCH03!" << endl;
#endif
@ -383,7 +383,7 @@ int main(int argc, char *argv[]) {
runmax--;
flist.close();
cout << "Found " << runmax << " files " << endl;
flist.open (args["flist"].c_str(), std::ifstream::in);
flist.open (fformat, std::ifstream::in);
}
for (int irun = runmin; irun <= runmax; irun++) {

View File

@ -183,8 +183,8 @@ int main(int argc, char *argv[]) {
gainfname = args["gainfile"];
etafname = args["etafilefile"];
if (atoi(args["numinterfaces"].c_str())>1){
cprintf(RED, "Sorry, at the moment only a single interface is supported instead of %d\n",atoi(args["numinterfaces"].c_str()));
if (atoi(args["nuninterfaces"].c_str())>1){
cprintf(RED, "Sorry, at the moment only a single interface is supported instead of %d\n",atoi(args["nuninterfaces"].c_str()));
return EXIT_FAILURE;
}
@ -272,35 +272,54 @@ int main(int argc, char *argv[]) {
sls::ZmqSocket *zmqsocket = NULL;
#ifdef NEWZMQ
// receive socket
try {
#endif
zmqsocket = new sls::ZmqSocket(socketip.c_str(), portnum);
#ifdef NEWZMQ
} catch (...) {
cprintf(RED,
"Error: Could not create Zmq receiving socket on port %d with ip %s\n",
"Error: Could not create Zmq socket on port %d with ip %s\n",
portnum, socketip.c_str());
delete zmqsocket;
return EXIT_FAILURE;
}
#endif
#ifndef NEWZMQ
if (zmqsocket->IsError()) {
cprintf(RED,
"Error: Could not create Zmq socket on port %d with ip %s\n",
portnum, socketip.c_str());
delete zmqsocket;
return EXIT_FAILURE;
}
#endif
if (zmqsocket->Connect()) {
cprintf(RED, "Error: Could not connect to zmq receiving socket %s\n",
cprintf(RED, "Error: Could not connect to socket %s\n",
(zmqsocket->GetZmqServerAddress()).c_str());
delete zmqsocket;
return EXIT_FAILURE;
} else
printf("Zmq receiving at %s\n", zmqsocket->GetZmqServerAddress().c_str());
printf("Zmq Client at %s\n", zmqsocket->GetZmqServerAddress().c_str());
// send socket
sls::ZmqSocket *zmqsocket2 = 0;
// cout << "zmq2 " << endl;
if (send) {
#ifdef NEWZMQ
// receive socket
try {
zmqsocket2 = new sls::ZmqSocket(portnum2, socketip2.c_str());
#endif
zmqsocket2 = new sls::ZmqSocket(portnum2, socketip2.c_str());
#ifdef NEWZMQ
} catch (...) {
cprintf(RED,
"Error: Could not create Zmq sending socket on port %d and "
"Error: Could not create Zmq socket server on port %d and "
"ip %s\n",
portnum2, socketip2.c_str());
// delete zmqsocket2;
@ -309,7 +328,28 @@ int main(int argc, char *argv[]) {
// return EXIT_FAILURE;
send = false;
}
printf("Zmq sending socket at %s\n",
#endif
#ifndef NEWZMQ
if (zmqsocket2->IsError()) {
cprintf(RED,
"AAA Error: Could not create Zmq socket server on port %d "
"and ip %s\n",
portnum2, socketip2.c_str());
// delete zmqsocket2;
// delete zmqsocket;
// return EXIT_FAILURE;
send = false;
}
#endif
if (zmqsocket2->Connect()) {
cprintf(RED, "BBB Error: Could not connect to socket %s\n",
zmqsocket2->GetZmqServerAddress().c_str());
// delete zmqsocket2;
send = false;
// return EXIT_FAILURE;
} else
printf("Zmq Client at %s\n",
zmqsocket2->GetZmqServerAddress().c_str());
}

View File

@ -839,8 +839,8 @@ void qTabMeasurement::UpdateProgress() {
int qTabMeasurement::VerifyOutputDirectoryError() {
try {
auto retval = det->getFilePath();
for (size_t i = 0; i < retval.size(); i++) {
det->setFilePath(retval[i], {i});
for (auto &it : retval) {
det->setFilePath(it);
}
return slsDetectorDefs::OK;
}

View File

@ -488,7 +488,6 @@ void setupDetector() {
AD9257_SetDefines(ADC_SPI_REG, ADC_SPI_SRL_CS_OTPT_MSK,
ADC_SPI_SRL_CLK_OTPT_MSK, ADC_SPI_SRL_DT_OTPT_MSK,
ADC_SPI_SRL_DT_OTPT_OFST);
AD9257_Set_Jungfrau_Hardware_Version_1_0(isHardwareVersion_1_0());
AD9257_Disable();
AD9257_Configure();

View File

@ -4,10 +4,6 @@
#include <inttypes.h>
#ifdef JUNGFRAUD
void AD9257_Set_Jungfrau_Hardware_Version_1_0(int val);
#endif
/**
* Set Defines
* @param reg spi register

View File

@ -172,14 +172,6 @@ uint32_t AD9257_DigMask = 0x0;
int AD9257_DigOffset = 0x0;
int AD9257_VrefVoltage = 0;
#ifdef JUNGFRAUD
int AD9257_is_Jungfrau_Hardware_Version_1_0 = 0;
void AD9257_Set_Jungfrau_Hardware_Version_1_0(int val) {
AD9257_is_Jungfrau_Hardware_Version_1_0 = val;
}
#endif
void AD9257_SetDefines(uint32_t reg, uint32_t cmsk, uint32_t clkmsk,
uint32_t dmsk, int dofst) {
AD9257_Reg = reg;
@ -294,18 +286,8 @@ void AD9257_Configure() {
AD9257_OUT_BINARY_OFST_VAL | AD9257_OUT_LVDS_IEEE_VAL);
// output clock phase
#ifdef JUNGFRAUD
if (AD9257_is_Jungfrau_Hardware_Version_1_0) {
LOG(logINFO, ("\tOutput clock phase: 120\n"));
AD9257_Set(AD9257_OUT_PHASE_REG, AD9257_OUT_CLK_120_VAL);
} else {
LOG(logINFO, ("\tOutput clock phase: 180\n"));
AD9257_Set(AD9257_OUT_PHASE_REG, AD9257_OUT_CLK_180_VAL);
}
#else
LOG(logINFO, ("\tOutput clock phase: 180\n"));
AD9257_Set(AD9257_OUT_PHASE_REG, AD9257_OUT_CLK_180_VAL);
#endif
// all devices on chip to receive next command
LOG(logINFO, ("\tAll devices on chip to receive next command\n"));

View File

@ -79,10 +79,9 @@ if(SLS_USE_TEXTCLIENT)
# Loop over list to generate command line binaries
set(bin_names "sls_detector_put"
"sls_detector_get"
"sls_detector_acquire"
"sls_detector_acquire_zmq"
"sls_detector_acquire"
"sls_detector_help")
set(cmd_name "PUT" "GET" "READOUT" "READOUTZMQ" "HELP")
set(cmd_name "PUT" "GET" "READOUT" "HELP")
list(LENGTH bin_names len1)
math(EXPR len2 "${len1} - 1")

View File

@ -30,10 +30,6 @@ int main(int argc, char *argv[]) {
int action = slsDetectorDefs::READOUT_ACTION;
#endif
#ifdef READOUTZMQ
int action = slsDetectorDefs::READOUT_ZMQ_ACTION;
#endif
#ifdef HELP
int action = slsDetectorDefs::HELP_ACTION;
#endif
@ -50,8 +46,7 @@ int main(int argc, char *argv[]) {
parser.Parse(argc, argv);
// If we called sls_detector_acquire, add the acquire command
if (action == slsDetectorDefs::READOUT_ACTION ||
action == slsDetectorDefs::READOUT_ZMQ_ACTION)
if (action == slsDetectorDefs::READOUT_ACTION)
parser.setCommand("acquire");
if (parser.isHelp())

View File

@ -205,11 +205,6 @@ std::string CmdProxy::VirtualServer(int action) {
return os.str();
}
void CmdProxy::EmptyDataCallBack(detectorData *data, uint64_t frameIndex,
uint32_t subFrameIndex, void *this_pointer) {
LOG(logDEBUG) << "EmptyDataCallBack to start up zmq sockets";
}
std::string CmdProxy::Acquire(int action) {
std::ostringstream os;
if (action == defs::HELP_ACTION) {
@ -231,9 +226,6 @@ std::string CmdProxy::Acquire(int action) {
throw RuntimeError("Individual detectors not allowed for readout.");
}
if (action == defs::READOUT_ZMQ_ACTION) {
det->registerDataCallback(&(EmptyDataCallBack), this);
}
det->acquire();
if (det->getUseReceiverFlag().squash(false)) {

View File

@ -1350,8 +1350,6 @@ class CmdProxy {
std::string GapPixels(int action);
std::string BadChannels(int action);
/* acquisition parameters */
static void EmptyDataCallBack(detectorData *data, uint64_t frameIndex,
uint32_t subFrameIndex, void *this_pointer);
std::string Acquire(int action);
std::string Exptime(int action);
std::string ReadoutSpeed(int action);

View File

@ -742,9 +742,8 @@ void DetectorImpl::readFrameFromReceiver() {
}
}
LOG(logDEBUG) << "Call Back Info:"
<< "\n\t nDetPixelsX: " << nDetPixelsX
<< "\n\t nDetPixelsY: " << nDetPixelsY
LOG(logDEBUG) << "Call Back Info:" << "\n\t nDetPixelsX: "
<< nDetPixelsX << "\n\t nDetPixelsY: " << nDetPixelsY
<< "\n\t databytes: " << multisize
<< "\n\t dynamicRange: " << dynamicRange;
@ -762,8 +761,8 @@ void DetectorImpl::readFrameFromReceiver() {
callbackImage = multigappixels;
imagesize = n;
}
LOG(logDEBUG) << "Image Info:"
<< "\n\tnDetActualPixelsX: " << nDetActualPixelsX
LOG(logDEBUG) << "Image Info:" << "\n\tnDetActualPixelsX: "
<< nDetActualPixelsX
<< "\n\tnDetActualPixelsY: " << nDetActualPixelsY
<< "\n\timagesize: " << imagesize
<< "\n\tdynamicRange: " << dynamicRange;
@ -798,8 +797,7 @@ void DetectorImpl::readFrameFromReceiver() {
int DetectorImpl::insertGapPixels(char *image, char *&gpImage, bool quadEnable,
int dr, int &nPixelsx, int &nPixelsy) {
LOG(logDEBUG) << "Insert Gap pixels:"
<< "\n\t nPixelsx: " << nPixelsx
LOG(logDEBUG) << "Insert Gap pixels:" << "\n\t nPixelsx: " << nPixelsx
<< "\n\t nPixelsy: " << nPixelsy
<< "\n\t quadEnable: " << quadEnable << "\n\t dr: " << dr;
@ -884,12 +882,10 @@ int DetectorImpl::insertGapPixels(char *image, char *&gpImage, bool quadEnable,
<< "nMod1Pixelsy: " << nMod1Pixelsy << "\n\t"
<< "nMod1GapPixelsx: " << nMod1GapPixelsx << "\n\t"
<< "nMod1GapPixelsy: " << nMod1GapPixelsy << "\n\t"
<< "nChipy: " << nChipy << "\n\t"
<< "nChipx: " << nChipx << "\n\t"
<< "nModx: " << nModx << "\n\t"
<< "nMody: " << nMody << "\n\t"
<< "nTotx: " << nTotx << "\n\t"
<< "nToty: " << nToty << "\n\t"
<< "nChipy: " << nChipy << "\n\t" << "nChipx: " << nChipx
<< "\n\t" << "nModx: " << nModx << "\n\t"
<< "nMody: " << nMody << "\n\t" << "nTotx: " << nTotx
<< "\n\t" << "nToty: " << nToty << "\n\t"
<< "bytesPerPixel: " << bytesPerPixel << "\n\t"
<< "imagesize: " << imagesize << "\n\t"
<< "nChipBytesx: " << nChipBytesx << "\n\t"
@ -1221,14 +1217,10 @@ int DetectorImpl::acquire() {
if (acquisition_finished != nullptr) {
// status
runStatus status = IDLE;
auto statusList = Parallel(&Module::getRunStatus, {});
// if any slave still waiting, wait up to 1s (gotthard)
for (int i = 0; i != 20 && statusList.any(WAITING); ++i) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
statusList = Parallel(&Module::getRunStatus, {});
}
runStatus status = statusList.squash(ERROR);
// inconsistent status (squash error), but none of them in error
status = statusList.squash(ERROR);
// difference, but none error
if (status == ERROR && (!statusList.any(ERROR))) {
// handle jf sync issue (master idle, slaves stopped)
if (statusList.contains_only(IDLE, STOPPED)) {
@ -1324,13 +1316,13 @@ void DetectorImpl::startAcquisition(const bool blocking, Positions pos) {
Parallel(&Module::startAndReadAll, masters);
// ensure all status normal (slaves not blocking)
// to catch those slaves that are still 'waiting'
auto statusList = Parallel(&Module::getRunStatus, pos);
// if any slave still waiting, wait up to 1s (gotthard)
for (int i = 0; i != 20 && statusList.any(WAITING); ++i) {
auto status = Parallel(&Module::getRunStatus, pos);
// if any slave still waiting, wait up to 1s
for (int i = 0; i != 20 && status.any(WAITING); ++i) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
statusList = Parallel(&Module::getRunStatus, pos);
status = Parallel(&Module::getRunStatus, pos);
}
if (!statusList.contains_only(IDLE, STOPPED, RUN_FINISHED)) {
if (!status.contains_only(IDLE, STOPPED, RUN_FINISHED)) {
throw RuntimeError("Acquisition not successful. "
"Unexpected detector status");
}

View File

@ -186,7 +186,7 @@ void HDF5DataFile::CreateFile() {
// property list
H5::DSetCreatPropList plist;
H5::DSetCreatPropList plistPara;
uint64_t fill_value = -1;
int fill_value = -1;
plist.setFillValue(dataType, &fill_value);
// plistPara.setFillValue(dataType, &fill_value);
plist.setChunk(DATA_RANK, dimsChunk);

View File

@ -215,12 +215,42 @@ std::string CreateVirtualHDF5File(
// property list
H5::DSetCreatPropList plist;
uint64_t fill_value = -1;
plist.setFillValue(dataType, &fill_value);
uint8_t u8 = -1;
uint16_t u16 = -1;
uint32_t u32 = -1;
uint64_t u64 = -1;
void* fill_value;
if (dataType == H5::PredType::STD_U8LE) {
fill_value = &u8;
} else if (dataType == H5::PredType::STD_U16LE) {
fill_value = &u16;
} else if (dataType == H5::PredType::STD_U32LE) {
fill_value = &u32;
} else if (dataType == H5::PredType::STD_U64LE) {
fill_value = &u64;
} else {
throw RuntimeError("Unsupported data type for virtual HDF5 file");
}
plist.setFillValue(dataType, fill_value);
//uint64_t fill_value = -1;
//plist.setFillValue(dataType, &fill_value);
std::vector<H5::DSetCreatPropList> plistPara(paraSize);
// ignoring last fill (string)
for (unsigned int i = 0; i != plistPara.size() - 1; ++i) {
plistPara[i].setFillValue(parameterDataTypes[i], &fill_value);
if (parameterDataTypes[i] == H5::PredType::STD_U8LE) {
fill_value = &u8;
} else if (parameterDataTypes[i] == H5::PredType::STD_U16LE) {
fill_value = &u16;
} else if (parameterDataTypes[i] == H5::PredType::STD_U32LE) {
fill_value = &u32;
} else if (parameterDataTypes[i] == H5::PredType::STD_U64LE) {
fill_value = &u64;
} else {
throw RuntimeError("Unsupported data type for virtual HDF5 file");
}
plistPara[i].setFillValue(parameterDataTypes[i], fill_value);
}
// hyperslab (files)

View File

@ -215,13 +215,7 @@ typedef struct {
/**
type of action performed (for text client)
*/
enum {
GET_ACTION,
PUT_ACTION,
READOUT_ACTION,
HELP_ACTION,
READOUT_ZMQ_ACTION
};
enum { GET_ACTION, PUT_ACTION, READOUT_ACTION, HELP_ACTION };
/**
dimension indexes

View File

@ -6,8 +6,8 @@
#define APICTB "8.0.0 0x231109"
#define APIGOTTHARD "8.0.0 0x231109"
#define APIGOTTHARD2 "8.0.0 0x231109"
#define APIJUNGFRAU "8.0.0 0x231109"
#define APIEIGER "8.0.0 0x231109"
#define APILIB "8.0.1 0x240112"
#define APIMOENCH "8.0.2 0x240703"
#define APIMYTHEN3 "8.0.2 0x240715"
#define APIJUNGFRAU "8.0.2 0x240822"
#define APIMOENCH "8.0.2 0x240703"
#define APIMYTHEN3 "8.0.2 0x240715"