changed MuSR_td_PSI_bin in order to read old data. Not yet tested.

This commit is contained in:
suter_a 2021-04-19 11:58:24 +02:00
parent 32c892cad4
commit 86459e586d

View File

@ -116,6 +116,13 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin()
file_name.close(); file_name.close();
delete [] buffer_file; delete [] buffer_file;
if (format_id[0] == '1') {
if (format_id[1] != 'N') {
std::cout << "**WARNING** found '" << format_id << "'. Will change it to '1N'" << std::endl;
format_id[1] = 'N';
}
}
// file may either be PSI binary format // file may either be PSI binary format
if (strncmp(format_id,"1N",2) == 0) if (strncmp(format_id,"1N",2) == 0)
{ {
@ -306,6 +313,9 @@ int MuSR_td_PSI_bin::readbin(const char * fileName)
strncpy(format_id,buffer_file,2); strncpy(format_id,buffer_file,2);
format_id[2] = '\0'; format_id[2] = '\0';
if (format_id[1] != 'N') // the warning is already issued in read()
format_id[1] = 'N';
if (strcmp(format_id,"1N") != 0) if (strcmp(format_id,"1N") != 0)
{ {
file_name.close(); file_name.close();