sandialabs / specutils Goto Github PK
View Code? Open in Web Editor NEWA library for opening, manipulating, and exporting gamma spectral files
License: GNU Lesser General Public License v2.1
A library for opening, manipulating, and exporting gamma spectral files
License: GNU Lesser General Public License v2.1
swig-fortran will allow us to call this from existing fortran code.
Line 175 in fb85855
This line refers to a file not present in the repository.
Hello,
issue-input.txt
issue-output.txt
(files added as .txt
extension due to issue restriction)
I run the following valid 2012 n42 xml file through SpecUtils, and it creates a 2012 n42 xml that fails schema validation.
$ xmlstarlet val --err --xsd SpecUtils/unit_tests/test_data/schema/n42.xsd issue-input.xml
issue-input.xml - valid
It creates two errors. xmlstarlet val --err --xsd SpecUtils/unit_tests/test_data/schema/n42.xsd issue-output.xml
22.27: Namespace prefix InterSpec on DetectorType is not defined
<InterSpec:DetectorType>RS-701</InterSpec:DetectorType>
41.22: Element '{http://physics.nist.gov/N42/2011/N42}RadInstrumentState': The attribute 'radInstrumentInformationReference' is required but missing.
Using this:
SpecFile specFile;
if(!specFile.load_N42_from_data(inputContent)) {
return;
}
specFile.write_to_file(outputFilename, SaveSpectrumAsType::N42_2012);
Thanks,
arichnad
Hi,
Sorry for just reporting without providing the resolusion...
I want to use the library to read .N42 data and process the data using python using python binding of the library.
My main systems are Linux boxes (Fedora, x86_64), and have boost-python3-1.78.0-9.fc37.x86_64 rpm installed.
I did CMaking as
$ cmake -DSpecUtils_PYTHON_BINDINGS=ON -DBoost_PYTHON_LIBRARY=/usr/lib64/libboost_python311.so.1.78.0 -DPYTHON_LIBRARY=/usr/lib64/libpython3.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.11 ../SpecUtils.git/
The make failed like the following:
[ 2%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile.cpp.o
[ 5%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_pcf.cpp.o
[ 8%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_cnf.cpp.o
[ 11%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_n42.cpp.o
[ 14%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_spc.cpp.o
[ 17%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_chn.cpp.o
[ 20%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_spe.cpp.o
[ 23%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_csv.cpp.o
[ 26%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_gr135.cpp.o
[ 29%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_aram.cpp.o
[ 32%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_lis.cpp.o
[ 35%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_lzs.cpp.o
[ 38%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_phd.cpp.o
[ 41%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_tka.cpp.o
[ 44%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_lsrm.cpp.o
[ 47%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_mca.cpp.o
[ 50%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_spmdf.cpp.o
[ 52%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_mps.cpp.o
[ 55%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_multiact.cpp.o
[ 58%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_uraider.cpp.o
[ 61%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_xml_other.cpp.o
[ 64%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_json.cpp.o
[ 67%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecUtilsAsync.cpp.o
[ 70%] Building CXX object CMakeFiles/SpecUtils.dir/src/SerialToDetectorModel.cpp.o
[ 73%] Building CXX object CMakeFiles/SpecUtils.dir/src/EnergyCalibration.cpp.o
[ 76%] Building CXX object CMakeFiles/SpecUtils.dir/src/CubicSpline.cpp.o
[ 79%] Building CXX object CMakeFiles/SpecUtils.dir/src/StringAlgo.cpp.o
[ 82%] Building CXX object CMakeFiles/SpecUtils.dir/src/Filesystem.cpp.o
[ 85%] Building CXX object CMakeFiles/SpecUtils.dir/src/DateTime.cpp.o
[ 88%] Building CXX object CMakeFiles/SpecUtils.dir/src/ParseUtils.cpp.o
[ 91%] Building CXX object CMakeFiles/SpecUtils.dir/src/SpecFile_location.cpp.o
[ 94%] Building CXX object CMakeFiles/SpecUtils.dir/src/D3SpectrumExport.cpp.o
[ 97%] Building CXX object CMakeFiles/SpecUtils.dir/bindings/python/SpecFile_py.cpp.o
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp: In function ‘void init_module_SpecUtils()’:
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:1109:7: error: no matching function for call to ‘boost::python::class_SpecUtils::EnergyCalibration::def(const char [14], , boost::python::detail::keywords<3>, const char [77])’
1087 | class_SpecUtils::EnergyCalibration("EnergyCalibration")
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088 | .def( "type", &SpecUtils::EnergyCalibration::type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089 | "Returns the energy calibration type" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090 | .def( "valid", &SpecUtils::EnergyCalibration::valid,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1091 | "Returns if the energy calibration is valid." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1092 | .def( "coefficients", &SpecUtils::EnergyCalibration::coefficients, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | "Returns the list of energy calibration coeficients.\n"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1094 | "Will only be empty for SpecUtils.EnergyCalType.InvalidEquationType." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1095 | // TODO: I think we should put a wrapper around channel_energies, and return a proper python list
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1096 | .def( "channelEnergies", &SpecUtils::EnergyCalibration::channel_energies, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1097 | "Returns lower channel energies; will have one more entry than the number of channels." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098 | .def( "deviationPairs", &SpecUtils::EnergyCalibration::deviation_pairs, return_internal_reference<>() )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099 | .def( "numChannels", &SpecUtils::EnergyCalibration::num_channels,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1100 | "Returns the number of channels this energy calibration is for." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101 | .def( "channelForEnergy", &SpecUtils::EnergyCalibration::channel_for_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102 | "Returns channel number (as a double) for the specified energy." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1103 | .def( "energyForChannel", &SpecUtils::EnergyCalibration::energy_for_channel,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1104 | "Returns energy for the specified (as double) channel number." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105 | .def( "lowerEnergy", &SpecUtils::EnergyCalibration::lower_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106 | "Returns lowest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | .def( "upperEnergy", &SpecUtils::EnergyCalibration::upper_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108 | "Returns highest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1109 | .def( "setPolynomial", &SpecUtils::EnergyCalibration::set_polynomial,
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110 | args( "NumChannels", "Coeffiecients", "DeviationPairs" ),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | "Sets the energy calibration information from Polynomial defined coefficents." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/python.hpp:18,
from /home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:51:
/usr/include/boost/python/class.hpp:219:11: note: candidate: ‘template boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const boost::python::def_visitor&) [with W = SpecUtils::EnergyCalibration; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
219 | self& def(def_visitor const& visitor)
| ^~~
/usr/include/boost/python/class.hpp:219:11: note: template argument deduction/substitution failed:
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:1109:7: note: mismatched types ‘const boost::python::def_visitor’ and ‘const char [14]’
1087 | class_SpecUtils::EnergyCalibration("EnergyCalibration")
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088 | .def( "type", &SpecUtils::EnergyCalibration::type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089 | "Returns the energy calibration type" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090 | .def( "valid", &SpecUtils::EnergyCalibration::valid,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1091 | "Returns if the energy calibration is valid." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1092 | .def( "coefficients", &SpecUtils::EnergyCalibration::coefficients, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | "Returns the list of energy calibration coeficients.\n"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1094 | "Will only be empty for SpecUtils.EnergyCalType.InvalidEquationType." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1095 | // TODO: I think we should put a wrapper around channel_energies, and return a proper python list
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1096 | .def( "channelEnergies", &SpecUtils::EnergyCalibration::channel_energies, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1097 | "Returns lower channel energies; will have one more entry than the number of channels." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098 | .def( "deviationPairs", &SpecUtils::EnergyCalibration::deviation_pairs, return_internal_reference<>() )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099 | .def( "numChannels", &SpecUtils::EnergyCalibration::num_channels,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1100 | "Returns the number of channels this energy calibration is for." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101 | .def( "channelForEnergy", &SpecUtils::EnergyCalibration::channel_for_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102 | "Returns channel number (as a double) for the specified energy." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1103 | .def( "energyForChannel", &SpecUtils::EnergyCalibration::energy_for_channel,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1104 | "Returns energy for the specified (as double) channel number." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105 | .def( "lowerEnergy", &SpecUtils::EnergyCalibration::lower_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106 | "Returns lowest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | .def( "upperEnergy", &SpecUtils::EnergyCalibration::upper_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108 | "Returns highest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1109 | .def( "setPolynomial", &SpecUtils::EnergyCalibration::set_polynomial,
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110 | args( "NumChannels", "Coeffiecients", "DeviationPairs" ),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | "Sets the energy calibration information from Polynomial defined coefficents." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/python/class.hpp:229:11: note: candidate: ‘template boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const char*, F) [with W = SpecUtils::EnergyCalibration; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
229 | self& def(char const* name, F f)
| ^~~
/usr/include/boost/python/class.hpp:229:11: note: template argument deduction/substitution failed:
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:1109:7: note: candidate expects 2 arguments, 4 provided
1087 | class_SpecUtils::EnergyCalibration("EnergyCalibration")
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088 | .def( "type", &SpecUtils::EnergyCalibration::type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089 | "Returns the energy calibration type" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090 | .def( "valid", &SpecUtils::EnergyCalibration::valid,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1091 | "Returns if the energy calibration is valid." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1092 | .def( "coefficients", &SpecUtils::EnergyCalibration::coefficients, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | "Returns the list of energy calibration coeficients.\n"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1094 | "Will only be empty for SpecUtils.EnergyCalType.InvalidEquationType." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1095 | // TODO: I think we should put a wrapper around channel_energies, and return a proper python list
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1096 | .def( "channelEnergies", &SpecUtils::EnergyCalibration::channel_energies, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1097 | "Returns lower channel energies; will have one more entry than the number of channels." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098 | .def( "deviationPairs", &SpecUtils::EnergyCalibration::deviation_pairs, return_internal_reference<>() )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099 | .def( "numChannels", &SpecUtils::EnergyCalibration::num_channels,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1100 | "Returns the number of channels this energy calibration is for." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101 | .def( "channelForEnergy", &SpecUtils::EnergyCalibration::channel_for_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102 | "Returns channel number (as a double) for the specified energy." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1103 | .def( "energyForChannel", &SpecUtils::EnergyCalibration::energy_for_channel,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1104 | "Returns energy for the specified (as double) channel number." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105 | .def( "lowerEnergy", &SpecUtils::EnergyCalibration::lower_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106 | "Returns lowest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | .def( "upperEnergy", &SpecUtils::EnergyCalibration::upper_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108 | "Returns highest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1109 | .def( "setPolynomial", &SpecUtils::EnergyCalibration::set_polynomial,
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110 | args( "NumChannels", "Coeffiecients", "DeviationPairs" ),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | "Sets the energy calibration information from Polynomial defined coefficents." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/python/class.hpp:238:11: note: candidate: ‘template<class A1, class A2> boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const char*, A1, const A2&) [with A2 = A1; W = SpecUtils::EnergyCalibration; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
238 | self& def(char const* name, A1 a1, A2 const& a2)
| ^~~
/usr/include/boost/python/class.hpp:238:11: note: template argument deduction/substitution failed:
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:1109:7: note: candidate expects 3 arguments, 4 provided
1087 | class_SpecUtils::EnergyCalibration("EnergyCalibration")
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088 | .def( "type", &SpecUtils::EnergyCalibration::type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089 | "Returns the energy calibration type" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090 | .def( "valid", &SpecUtils::EnergyCalibration::valid,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1091 | "Returns if the energy calibration is valid." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1092 | .def( "coefficients", &SpecUtils::EnergyCalibration::coefficients, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | "Returns the list of energy calibration coeficients.\n"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1094 | "Will only be empty for SpecUtils.EnergyCalType.InvalidEquationType." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1095 | // TODO: I think we should put a wrapper around channel_energies, and return a proper python list
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1096 | .def( "channelEnergies", &SpecUtils::EnergyCalibration::channel_energies, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1097 | "Returns lower channel energies; will have one more entry than the number of channels." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098 | .def( "deviationPairs", &SpecUtils::EnergyCalibration::deviation_pairs, return_internal_reference<>() )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099 | .def( "numChannels", &SpecUtils::EnergyCalibration::num_channels,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1100 | "Returns the number of channels this energy calibration is for." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101 | .def( "channelForEnergy", &SpecUtils::EnergyCalibration::channel_for_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102 | "Returns channel number (as a double) for the specified energy." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1103 | .def( "energyForChannel", &SpecUtils::EnergyCalibration::energy_for_channel,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1104 | "Returns energy for the specified (as double) channel number." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105 | .def( "lowerEnergy", &SpecUtils::EnergyCalibration::lower_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106 | "Returns lowest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | .def( "upperEnergy", &SpecUtils::EnergyCalibration::upper_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108 | "Returns highest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1109 | .def( "setPolynomial", &SpecUtils::EnergyCalibration::set_polynomial,
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110 | args( "NumChannels", "Coeffiecients", "DeviationPairs" ),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | "Sets the energy calibration information from Polynomial defined coefficents." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/python/class.hpp:245:11: note: candidate: ‘template<class Fn, class A1, class A2> boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const char*, Fn, const A1&, const A2&) [with A1 = Fn; A2 = A1; W = SpecUtils::EnergyCalibration; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
245 | self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2)
| ^~~
/usr/include/boost/python/class.hpp:245:11: note: template argument deduction/substitution failed:
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:1109:7: note: couldn’t deduce template parameter ‘Fn’
1087 | class_SpecUtils::EnergyCalibration("EnergyCalibration")
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088 | .def( "type", &SpecUtils::EnergyCalibration::type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089 | "Returns the energy calibration type" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090 | .def( "valid", &SpecUtils::EnergyCalibration::valid,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1091 | "Returns if the energy calibration is valid." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1092 | .def( "coefficients", &SpecUtils::EnergyCalibration::coefficients, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | "Returns the list of energy calibration coeficients.\n"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1094 | "Will only be empty for SpecUtils.EnergyCalType.InvalidEquationType." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1095 | // TODO: I think we should put a wrapper around channel_energies, and return a proper python list
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1096 | .def( "channelEnergies", &SpecUtils::EnergyCalibration::channel_energies, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1097 | "Returns lower channel energies; will have one more entry than the number of channels." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098 | .def( "deviationPairs", &SpecUtils::EnergyCalibration::deviation_pairs, return_internal_reference<>() )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099 | .def( "numChannels", &SpecUtils::EnergyCalibration::num_channels,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1100 | "Returns the number of channels this energy calibration is for." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101 | .def( "channelForEnergy", &SpecUtils::EnergyCalibration::channel_for_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102 | "Returns channel number (as a double) for the specified energy." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1103 | .def( "energyForChannel", &SpecUtils::EnergyCalibration::energy_for_channel,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1104 | "Returns energy for the specified (as double) channel number." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105 | .def( "lowerEnergy", &SpecUtils::EnergyCalibration::lower_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106 | "Returns lowest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | .def( "upperEnergy", &SpecUtils::EnergyCalibration::upper_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108 | "Returns highest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1109 | .def( "setPolynomial", &SpecUtils::EnergyCalibration::set_polynomial,
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110 | args( "NumChannels", "Coeffiecients", "DeviationPairs" ),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | "Sets the energy calibration information from Polynomial defined coefficents." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/python/class.hpp:261:11: note: candidate: ‘template<class Fn, class A1, class A2, class A3> boost::python::class_<T, X1, X2, X3>::self& boost::python::class_<T, X1, X2, X3>::def(const char*, Fn, const A1&, const A2&, const A3&) [with A1 = Fn; A2 = A1; A3 = A2; W = SpecUtils::EnergyCalibration; X1 = boost::python::detail::not_specified; X2 = boost::python::detail::not_specified; X3 = boost::python::detail::not_specified]’
261 | self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2, A3 const& a3)
| ^~~
/usr/include/boost/python/class.hpp:261:11: note: template argument deduction/substitution failed:
/home/furutaka/res/SpecUtils/SpecUtils.git/bindings/python/SpecFile_py.cpp:1109:7: note: candidate expects 5 arguments, 4 provided
1087 | class_SpecUtils::EnergyCalibration("EnergyCalibration")
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1088 | .def( "type", &SpecUtils::EnergyCalibration::type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1089 | "Returns the energy calibration type" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090 | .def( "valid", &SpecUtils::EnergyCalibration::valid,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1091 | "Returns if the energy calibration is valid." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1092 | .def( "coefficients", &SpecUtils::EnergyCalibration::coefficients, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | "Returns the list of energy calibration coeficients.\n"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1094 | "Will only be empty for SpecUtils.EnergyCalType.InvalidEquationType." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1095 | // TODO: I think we should put a wrapper around channel_energies, and return a proper python list
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1096 | .def( "channelEnergies", &SpecUtils::EnergyCalibration::channel_energies, return_internal_reference<>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1097 | "Returns lower channel energies; will have one more entry than the number of channels." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098 | .def( "deviationPairs", &SpecUtils::EnergyCalibration::deviation_pairs, return_internal_reference<>() )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099 | .def( "numChannels", &SpecUtils::EnergyCalibration::num_channels,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1100 | "Returns the number of channels this energy calibration is for." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101 | .def( "channelForEnergy", &SpecUtils::EnergyCalibration::channel_for_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102 | "Returns channel number (as a double) for the specified energy." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1103 | .def( "energyForChannel", &SpecUtils::EnergyCalibration::energy_for_channel,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1104 | "Returns energy for the specified (as double) channel number." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105 | .def( "lowerEnergy", &SpecUtils::EnergyCalibration::lower_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1106 | "Returns lowest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1107 | .def( "upperEnergy", &SpecUtils::EnergyCalibration::upper_energy,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1108 | "Returns highest energy of this energy calibration." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1109 | .def( "setPolynomial", &SpecUtils::EnergyCalibration::set_polynomial,
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110 | args( "NumChannels", "Coeffiecients", "DeviationPairs" ),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111 | "Sets the energy calibration information from Polynomial defined coefficents." )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/SpecUtils.dir/build.make:524: CMakeFiles/SpecUtils.dir/bindings/python/SpecFile_py.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/SpecUtils.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
It seems to me that there are no args() method in the present version of Boost.python or the one I use; indeed, it was alread deprecated in the oldest version that we can read its documentation....
How can we fix this? (I'm sorry at present I don't find the resolution)
Kazuyoshi
Hi there, I am trying to compile from source on a Mac. I got the following error after the following two commands:
$ cmake -DBUILD_CAMBIO_COMMAND_LINE=ON -DBUILD_CAMBIO_GUI=OFF -DBOOST_ROOT=/path/to/boost ..
$ make -j8
Error:
/Users//repos/cambio/src/CommandLineUtil.cpp:2176:16: error: no member named 'keep_energy_cal_variant' in 'SpecUtils::SpecFile'
info.keep_energy_cal_variant( prefered_variant );
In SpecUtils, it seems to be keep_energy_cal_variants not keep_energy_cal_variant, but can you please advise?
Thanks!
See gadras issue #406.
@Am6er reported in commitcomment-131492754 that there are some files that don't load correctly in InterSpec.
When I use my n42validate tool, the files all fail to validate against the N42 schema. It appears that calibration polynomials can only go up to quadratic. I made the same assumption when loading radiacode generated files. I can probably do a quick patch to not reject files with higher order calibration polynomials, but maybe emit a warning.
n42validate Calibration\ 13.01.2023.N42
[ERROR] Calibration 13.01.2023.N42
failed validating [-5.90955288142523, 0.375881542623178, 8.4487324360803e-06, -5.64086320297731e-10, 1.22453656607698e-14] with XsdLengthFacet(value=3, fixed=True):
Reason: length has to be 3
Schema:
<xsd:length xmlns:xsd="http://www.w3.org/2001/XMLSchema" value="3" fixed="true">
<xsd:annotation>
<xsd:documentation>Three and only three coefficient values are allowed.</xsd:documentation>
</xsd:annotation>
</xsd:length>
Instance:
<n42:CoefficientValues xmlns:n42="http://physics.nist.gov/N42/2011/N42">-5.90955288142523 0.375881542623178 8.4487324360803E-06 -5.64086320297731E-10 1.22453656607698E-14 </n42:CoefficientValues>
Path: /{http://physics.nist.gov/N42/2011/N42}RadInstrumentData/{http://physics.nist.gov/N42/2011/N42}EnergyCalibration[1]/{http://physics.nist.gov/N42/2011/N42}CoefficientValues
---------------------------------------------------------------------------
Over in SpecUtils/bindings/python/SpecFile_py.cpp
, setNeutronCounts_wrapper
is:
void setNeutronCounts_wrapper( SpecUtils::Measurement *meas,
boost::python::list py_counts )
{
vector<float> counts;
boost::python::ssize_t n = boost::python::len( py_counts );
for( boost::python::ssize_t i = 0; i < n; ++i )
counts.push_back( boost::python::extract<float>( py_counts[i] ) );
meas->set_neutron_counts( counts );
}
On building I get an error
[ 97%] Building CXX object CMakeFiles/SpecUtils.dir/bindings/python/SpecFile_py.cpp.o
<redacted>/SpecUtils/bindings/python/SpecFile_py.cpp:427:38: error: too few arguments to function call, expected 2, have 1
meas->set_neutron_counts( counts );
~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/4uh/Research/source_localization/preprocessing/SpecUtils/SpecUtils/SpecFile.h:812:8: note: 'set_neutron_counts' declared here
void set_neutron_counts( const std::vector<float> &counts, const float neutron_live_time );
^
1 error generated.
make[2]: *** [CMakeFiles/SpecUtils.dir/bindings/python/SpecFile_py.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/SpecUtils.dir/all] Error 2
make: *** [all] Error 2
It looks like at some point set_neutron_counts
in the parent class was refactored to also take a float live time but this bit wasn't updated. As quick hack, simply changing it to meas->set_neutron_counts( counts, 0.0 );
seems to work and the code compiles.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.