@@ -1354,6 +1354,9 @@ NB_MODULE(SpecUtils, m) {
13541354 .value (" ScanDataXml" , SpecUtils::ParserType::ScanDataXml)
13551355 .value (" Json" , SpecUtils::ParserType::Json)
13561356 .value (" CaenHexagonGXml" , SpecUtils::ParserType::CaenHexagonGXml)
1357+ #if ( SpecUtils_ENABLE_URI_SPECTRA )
1358+ .value (" Uri" , SpecUtils::ParserType::Uri)
1359+ #endif
13571360 .value (" Auto" , SpecUtils::ParserType::Auto);
13581361
13591362
@@ -2051,8 +2054,33 @@ m.def("polynomialCoefToFullRangeFraction",
20512054 " Changes the name of a given detector.\n "
20522055 " Throws exception if 'OriginalName' did not exist." )
20532056
2054- // size_t combine_gamma_channels( const size_t ncombine, const size_t nchannels );
2055- // size_t truncate_gamma_channels( ...)
2057+ .def ( " truncateGammaChannels" ,
2058+ static_cast <size_t (SpecUtils::SpecFile::*)(const size_t , const size_t , const size_t , const bool )>(&SpecUtils::SpecFile::truncate_gamma_channels),
2059+ " KeepFirstChannel" _a, " KeepLastChannel" _a, " NChannels" _a, " KeepUnderOverFlow" _a,
2060+ " Removes all channels below 'KeepFirstChannel' and above 'KeepLastChannel', "
2061+ " for every measurement that has 'NChannels' channels.\n "
2062+ " If 'KeepUnderOverFlow' is true, then removed channel counts will be added to the first/last channel.\n "
2063+ " Returns the number of modified measurements.\n "
2064+ " Throws exception if KeepLastChannel>=NChannels, or if KeepFirstChannel>=KeepLastChannel." )
2065+ .def ( " truncateGammaChannels" ,
2066+ static_cast <void (SpecUtils::SpecFile::*)(const size_t , const size_t , const bool , const std::shared_ptr<const SpecUtils::Measurement> &)>(&SpecUtils::SpecFile::truncate_gamma_channels),
2067+ " KeepFirstChannel" _a, " KeepLastChannel" _a, " KeepUnderOverFlow" _a, " Measurement" _a,
2068+ " Removes all channels below 'KeepFirstChannel' and above 'KeepLastChannel' for the specified measurement.\n "
2069+ " If 'KeepUnderOverFlow' is true, then removed channel counts will be added to the first/last channel.\n "
2070+ " Throws exception if invalid Measurement, or if KeepLastChannel>=measurement.num_gamma_channels(), "
2071+ " or if KeepFirstChannel>=KeepLastChannel." )
2072+ .def ( " combineGammaChannels" ,
2073+ static_cast <size_t (SpecUtils::SpecFile::*)(const size_t , const size_t )>(&SpecUtils::SpecFile::combine_gamma_channels),
2074+ " NCombine" _a, " NChannels" _a,
2075+ " Combines every 'NCombine' adjacent channels into a single channel for every measurement "
2076+ " that has 'NChannels' channels.\n "
2077+ " Returns the number of modified measurements.\n "
2078+ " Throws exception if (NChannels % NCombine) != 0." )
2079+ .def ( " combineGammaChannels" ,
2080+ static_cast <void (SpecUtils::SpecFile::*)(const size_t , const std::shared_ptr<const SpecUtils::Measurement> &)>(&SpecUtils::SpecFile::combine_gamma_channels),
2081+ " NCombine" _a, " Measurement" _a,
2082+ " Combines every 'NCombine' adjacent channels into a single channel for the specified measurement.\n "
2083+ " Throws exception if measurement is not owned by this SpecFile." )
20562084
20572085 // Begin functions that set Measurement quantities, through thier SpecFile owner
20582086 .def ( " setLiveTime" , &SpecUtils::SpecFile::set_live_time,
0 commit comments