fix: 修改自建台站能谱 算法中求面积的业务逻辑;解决修改能量刻度更新之后分析之后能量不对的问题
This commit is contained in:
parent
6d74757be3
commit
42f94fbe76
|
@ -272,7 +272,6 @@ public class Sample_C_Analysis {
|
||||||
finalReportPath.append(spectrumPathProperties.getRootPath());
|
finalReportPath.append(spectrumPathProperties.getRootPath());
|
||||||
// finalReportPath.append(File.separator);
|
// finalReportPath.append(File.separator);
|
||||||
finalReportPath.append(spectrumPathProperties.getSaveFilePath());
|
finalReportPath.append(spectrumPathProperties.getSaveFilePath());
|
||||||
finalReportPath.append(File.separator);
|
|
||||||
finalReportPath.append(spectrumPathProperties.getArrPath());
|
finalReportPath.append(spectrumPathProperties.getArrPath());
|
||||||
finalReportPath.append(File.separator);
|
finalReportPath.append(File.separator);
|
||||||
finalReportPath.append(this.spectrumFileRelativePath);
|
finalReportPath.append(this.spectrumFileRelativePath);
|
||||||
|
|
|
@ -863,37 +863,58 @@ public class SelfBaseUtil extends AbstractLogOrReport {
|
||||||
}
|
}
|
||||||
// 没有峰信息 核素=未识别 不计算活度浓度
|
// 没有峰信息 核素=未识别 不计算活度浓度
|
||||||
if (!nuclideParam.containsKey("area")) {
|
if (!nuclideParam.containsKey("area")) {
|
||||||
double left = 0, right = 0;
|
double left = 0, right = 0, energy = 0, fwhm = 0;
|
||||||
List<Long> counts = null;
|
List<Long> counts = null;
|
||||||
|
PHDFile phd = null;
|
||||||
// 固定能量范围,半高宽
|
// 固定能量范围,半高宽
|
||||||
switch (nuclideName) {
|
switch (nuclideName) {
|
||||||
case "Xe131M":
|
case "Xe131M":
|
||||||
left = 29.7 - (0.737 * 1.25);
|
phd = phdFiles[0];
|
||||||
right = 29.7 + (0.737 * 1.25);
|
// fwhm = getFwhm(phd.getMapResoPara().get(phd.getUsedReso()),
|
||||||
counts = phdFiles[0].getSpec().getCounts();
|
// nuclideMap.get(nuclideName).getEnergy()) * 1.25;
|
||||||
|
// left = 29.7 - fwhm;
|
||||||
|
// right = 29.7 + fwhm;
|
||||||
break;
|
break;
|
||||||
case "Xe133M":
|
case "Xe133M":
|
||||||
left = 29.7 - (0.737 * 1.25);
|
phd = phdFiles[1];
|
||||||
right = 29.7 + (0.737 * 1.25);
|
// fwhm = getFwhm(phd.getMapResoPara().get(phd.getUsedReso()), nuclideMap.get(nuclideName).getEnergy());
|
||||||
counts = phdFiles[1].getSpec().getCounts();
|
// left = 29.7 - fwhm;
|
||||||
|
// right = 29.7 + fwhm;
|
||||||
break;
|
break;
|
||||||
case "Xe133":
|
case "Xe133":
|
||||||
left = 81 - (0.781 * 1.25);
|
phd = phdFiles[2];
|
||||||
right = 81 + (0.781 * 1.25);
|
// fwhm = getFwhm(phd.getMapResoPara().get(phd.getUsedReso()), nuclideMap.get(nuclideName).getEnergy());
|
||||||
counts = phdFiles[2].getSpec().getCounts();
|
// left = 81 - fwhm;
|
||||||
|
// right = 81 + fwhm;
|
||||||
break;
|
break;
|
||||||
case "Xe135":
|
case "Xe135":
|
||||||
left = 249.8 - (0.916 * 1.25);
|
phd = phdFiles[3];
|
||||||
right = 249.8 + (0.916 * 1.25);
|
// left = 249.8 - fwhm;
|
||||||
counts = phdFiles[3].getSpec().getCounts();
|
// right = 249.8 + fwhm;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
energy = nuclideMap.get(nuclideName).getEnergy();
|
||||||
|
counts = phd.getSpec().getCounts();
|
||||||
|
fwhm = getFwhm(phd.getMapResoPara().get(phd.getUsedReso()), energy) * 1.25;
|
||||||
|
|
||||||
// 能量转化为道址
|
// 能量转化为道址
|
||||||
|
// 能量转化道址公式参数
|
||||||
|
List<Double> userEnerParaP = phd.getUsedEnerPara().getP();
|
||||||
|
// 使用gamma公式将能量转换为道址
|
||||||
|
List<Double> energyList = Lists.newLinkedList();
|
||||||
|
energyList.add(energy - fwhm);
|
||||||
|
CalValuesOut etc = CalValuesHandler.energyToChannel(energyList, userEnerParaP);
|
||||||
|
long lc = Math.round(etc.counts.get(0));
|
||||||
|
|
||||||
|
energyList = Lists.newLinkedList();
|
||||||
|
energyList.add(energy + fwhm);
|
||||||
|
etc = CalValuesHandler.energyToChannel(energyList, userEnerParaP);
|
||||||
|
long rc = Math.round(etc.counts.get(0));
|
||||||
// 通过道址将这个范围的计数求和
|
// 通过道址将这个范围的计数求和
|
||||||
List<Double> gFittingPara = EnergySpectrumHandler.GetFileFittingPara(phdFiles[0].getUsedEnerKD().getG_energy(),
|
/*List<Double> gFittingPara = EnergySpectrumHandler.GetFileFittingPara(phdFiles[0].getUsedEnerKD().getG_energy(),
|
||||||
phdFiles[0].getUsedEnerKD().getCentroid_channel());
|
phdFiles[0].getUsedEnerKD().getCentroid_channel());
|
||||||
double lc = gFittingPara.get(0) + gFittingPara.get(1) * left + gFittingPara.get(2) * Math.sqrt(left);
|
double lc = gFittingPara.get(0) + gFittingPara.get(1) * left + gFittingPara.get(2) * Math.sqrt(left);
|
||||||
double rc = gFittingPara.get(0) + gFittingPara.get(1) * right + gFittingPara.get(2) * Math.sqrt(right);
|
double rc = gFittingPara.get(0) + gFittingPara.get(1) * right + gFittingPara.get(2) * Math.sqrt(right);*/
|
||||||
// 面积=计数总和:通过能量卡一个范围,将范围内的计数加和
|
// 面积=计数总和:通过能量卡一个范围,将范围内的计数加和
|
||||||
int area = 0;
|
int area = 0;
|
||||||
for (int i = (int)lc; i <= (int) rc; i++) {
|
for (int i = (int)lc; i <= (int) rc; i++) {
|
||||||
|
@ -918,31 +939,23 @@ public class SelfBaseUtil extends AbstractLogOrReport {
|
||||||
public static double getBetaAnalyseBaseLineCount(PHDFile phd, String nuclideName, Double energy) {
|
public static double getBetaAnalyseBaseLineCount(PHDFile phd, String nuclideName, Double energy) {
|
||||||
double baseLineCount = 0;
|
double baseLineCount = 0;
|
||||||
// 得到baseline count范围
|
// 得到baseline count范围
|
||||||
double fwhm = 0;
|
|
||||||
List<Double> vBase = phd.getVBase();
|
List<Double> vBase = phd.getVBase();
|
||||||
// fwhm公式参数
|
|
||||||
ParameterInfo m_curParam = phd.getMapResoPara().get(phd.getUsedEner());
|
|
||||||
// 能量转化道址公式参数
|
// 能量转化道址公式参数
|
||||||
List<Double> userEnerParaP = phd.getUsedEnerPara().getP();
|
List<Double> userEnerParaP = phd.getUsedEnerPara().getP();
|
||||||
// 公式参数
|
// 计算半高宽
|
||||||
int p_size = m_curParam.getP().size()-1;
|
// fwhm公式参数
|
||||||
if(p_size >= 2 && m_curParam.getP().get(1) > 0 && m_curParam.getP().get(2) > 0) {
|
ParameterInfo m_curParam = phd.getMapResoPara().get(phd.getUsedReso());
|
||||||
fwhm = m_curParam.getP().get(1) + energy * m_curParam.getP().get(2);
|
double fwhm = getFwhm(m_curParam, energy);
|
||||||
for(int i=3; i<=p_size; i++) {
|
|
||||||
fwhm += (Math.pow(energy, (i-1)) * m_curParam.getP().get(i));
|
|
||||||
}
|
|
||||||
fwhm = Math.pow(fwhm, 0.5);
|
|
||||||
}
|
|
||||||
// 通过energy带入到FHWM公式中,将结果energy转化channel,加减1.25之后取这个范围之内的baseline进行加和
|
// 通过energy带入到FHWM公式中,将结果energy转化channel,加减1.25之后取这个范围之内的baseline进行加和
|
||||||
List<Double> energyList = Lists.newLinkedList();
|
List<Double> energyList = Lists.newLinkedList();
|
||||||
energyList.add(energy - (fwhm - Math.pow(fwhm, 1.25)));
|
energyList.add(energy - (fwhm * 1.25));
|
||||||
// 使用gamma公式将能量转换为道址
|
// 使用gamma公式将能量转换为道址
|
||||||
CalValuesOut energyToChannel = CalValuesHandler.energyToChannel(energyList, userEnerParaP);
|
CalValuesOut energyToChannel = CalValuesHandler.energyToChannel(energyList, userEnerParaP);
|
||||||
|
|
||||||
long begin = Math.round(energyToChannel.counts.get(0));
|
long begin = Math.round(energyToChannel.counts.get(0));
|
||||||
Console.log("nuclide:{},energy:{},fwhmL:{},beginChannel:{}",nuclideName, energy, (fwhm - Math.pow(fwhm, 1.25)), begin);
|
Console.log("nuclide:{},energy:{},fwhmL:{},beginChannel:{}",nuclideName, energy, (fwhm - Math.pow(fwhm, 1.25)), begin);
|
||||||
energyList = Lists.newLinkedList();
|
energyList = Lists.newLinkedList();
|
||||||
energyList.add(energy + (fwhm + Math.pow(fwhm, 1.25)));
|
energyList.add(energy + (fwhm * 1.25));
|
||||||
energyToChannel = CalValuesHandler.energyToChannel(energyList, userEnerParaP);
|
energyToChannel = CalValuesHandler.energyToChannel(energyList, userEnerParaP);
|
||||||
long end = Math.round(energyToChannel.counts.get(0));
|
long end = Math.round(energyToChannel.counts.get(0));
|
||||||
Console.log("nuclide:{},energy:{},fwhmR:{},endChannel:{}",nuclideName, energy, (fwhm + Math.pow(fwhm, 1.25)), end);
|
Console.log("nuclide:{},energy:{},fwhmR:{},endChannel:{}",nuclideName, energy, (fwhm + Math.pow(fwhm, 1.25)), end);
|
||||||
|
@ -954,6 +967,20 @@ public class SelfBaseUtil extends AbstractLogOrReport {
|
||||||
return baseLineCount;
|
return baseLineCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Double getFwhm(ParameterInfo m_curParam, Double energy) {
|
||||||
|
Double fwhm = 0.0;
|
||||||
|
// 公式参数
|
||||||
|
int p_size = m_curParam.getP().size()-1;
|
||||||
|
if(p_size >= 2 && m_curParam.getP().get(1) > 0 && m_curParam.getP().get(2) > 0) {
|
||||||
|
fwhm = m_curParam.getP().get(1) + energy * m_curParam.getP().get(2);
|
||||||
|
for(int i=3; i<=p_size; i++) {
|
||||||
|
fwhm += (Math.pow(energy, (i-1)) * m_curParam.getP().get(i));
|
||||||
|
}
|
||||||
|
fwhm = Math.pow(fwhm, 0.5);
|
||||||
|
}
|
||||||
|
return fwhm;
|
||||||
|
}
|
||||||
|
|
||||||
static StringBuilder reportContent = null;
|
static StringBuilder reportContent = null;
|
||||||
protected static EnergySpectrumStruct sampleStruct = null;
|
protected static EnergySpectrumStruct sampleStruct = null;
|
||||||
protected static EnergySpectrumStruct qcStruct = null;
|
protected static EnergySpectrumStruct qcStruct = null;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<config>
|
<config>
|
||||||
<nuclide>
|
<nuclide>
|
||||||
<item nuclide_name="Xe131M" energy="29.7" yield="44.362" half_life="11.934" />
|
<item nuclide_name="Xe131M" energy="29.7" yield="44.362" half_life="11.934" />
|
||||||
<item nuclide_name="Xe133" energy="29.7" yield="38.0" half_life="5.243" />
|
<item nuclide_name="Xe133M" energy="29.7" yield="46.049" half_life="2.19" />
|
||||||
<item nuclide_name="Xe133M" energy="81.0" yield="46.049" half_life="2.19" />
|
<item nuclide_name="Xe133" energy="81.0" yield="38.0" half_life="5.243" />
|
||||||
<item nuclide_name="Xe135" energy="249.8" yield="90.0" half_life="0.380832" />
|
<item nuclide_name="Xe135" energy="249.8" yield="90.0" half_life="0.380832" />
|
||||||
</nuclide>
|
</nuclide>
|
||||||
</config>
|
</config>
|
Loading…
Reference in New Issue
Block a user