gamma功能nan,inf字段问题修改

This commit is contained in:
qiaoqinzheng 2023-11-13 15:14:47 +08:00
parent 1329ec62a2
commit d694561df8
2 changed files with 28 additions and 18 deletions

View File

@ -3363,8 +3363,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
dvctUPPERTAIL.add(fileAnlyse.getVPeak().get(m).upperTail);
dvctUPPERTAILALPHA.add(fileAnlyse.getVPeak().get(m).upperTailAlpha);
dvctBWWIDTHCHAN.add(fileAnlyse.getVPeak().get(m).BWWidthChan);
dvctRECOILBETACHAN.add(Double.valueOf(fileAnlyse.getVPeak().get(m).recoilBetaChan));
dvctRECOILDELTACHAN.add(Double.valueOf(fileAnlyse.getVPeak().get(m).recoilDeltaChan));
dvctRECOILBETACHAN.add(fileAnlyse.getVPeak().get(m).recoilBetaChan.equalsIgnoreCase("nan")?Double.NaN:Double.valueOf(fileAnlyse.getVPeak().get(m).recoilBetaChan));
dvctRECOILDELTACHAN.add(fileAnlyse.getVPeak().get(m).recoilDeltaChan.equalsIgnoreCase("nan")?Double.NaN:Double.valueOf(fileAnlyse.getVPeak().get(m).recoilDeltaChan));
dvctSTEPRAIO.add(fileAnlyse.getVPeak().get(m).stepRatio);
dvctBACKGROUNDAREA.add(fileAnlyse.getVPeak().get(m).backgroundArea);
dvctMEANBACKCOUNT.add(fileAnlyse.getVPeak().get(m).meanBackCount);
@ -3508,8 +3508,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
dvctACTIV_KEY.add(itor_v.getValue().getActivity());
dvctACTIV_KEY_ERR.add(itor_v.getValue().getAct_err());
dvctMDA.add(String.format("%e", itor_v.getValue().getMda()));
dvctMDC.add(itor_v.getValue().getMdc()>0?String.format("%e", itor_v.getValue().getMdc()):"0.0");
dvctCONCENTRATION.add(String.format("%e", itor_v.getValue().getConcentration()));
dvctMDC.add(itor_v.getValue().getMdc().isInfinite()?"inf":(itor_v.getValue().getMdc()>0?String.format("%e", itor_v.getValue().getMdc()):"0.0"));
dvctCONCENTRATION.add(itor_v.getValue().getConcentration().isInfinite()?"inf":String.format("%e", itor_v.getValue().getConcentration()));
dvctCSC_RATIO.add(1.0);
dvctCSC_RATIO_ERR.add(0.0);
if(itor_v.getValue().getCalculateIdx() >= 0 && itor_v.getValue().getCalculateIdx()<itor_v.getValue().getVEnergy().size()) {
@ -3866,9 +3866,13 @@ public class GammaFileUtil extends AbstractLogOrReport {
public List<PeakInfo> InitPeakTable(List<PeakInfo> vPeak) {
//遍历vPeak
for (PeakInfo info:vPeak) {
if (Objects.isNull(info.recoilBetaChan)) {
info.recoilBetaChan = "nan";
}
if (Objects.isNull(info.recoilDeltaChan)) {
info.recoilDeltaChan = "nan";
}
}
List<PeakInfo> result = new LinkedList<>();
for(int i=0; i<vPeak.size(); i++) {
PeakInfo peakInfo = new PeakInfo();

View File

@ -410,10 +410,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting());
for (PeakInfo info:phd.getVPeak()) {
if (StringUtils.isBlank(info.recoilBetaChan)) {
if (Objects.isNull(info.recoilBetaChan)) {
info.recoilBetaChan = "nan";
}
if (StringUtils.isBlank(info.recoilDeltaChan)) {
if (Objects.isNull(info.recoilDeltaChan)) {
info.recoilDeltaChan = "nan";
}
}
@ -596,16 +596,16 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
peakInfo.ld = peaksSpectrum.getLd() == null ? 0 : peaksSpectrum.getLd();
peakInfo.meanBackCount = peaksSpectrum.getMeanbackcount() == null ? 0 : peaksSpectrum.getMeanbackcount();
peakInfo.backgroundArea = peaksSpectrum.getBackgroundarea() == null ? 0 : peaksSpectrum.getBackgroundarea();
peakInfo.significance = peaksSpectrum.getSignificance() == null ? 0 : peaksSpectrum.getSignificance();
peakInfo.sensitivity = peaksSpectrum.getSensitivity() == null ? 0 : peaksSpectrum.getSensitivity();
peakInfo.significance = peaksSpectrum.getSignificance() == null ? Double.NaN : peaksSpectrum.getSignificance();
peakInfo.sensitivity = peaksSpectrum.getSensitivity() == null ? Double.NaN : peaksSpectrum.getSensitivity();
peakInfo.stepRatio = peaksSpectrum.getStepraio() == null ? 0 : peaksSpectrum.getStepraio();
peakInfo.tail = peaksSpectrum.getTail() == null ? 0 : peaksSpectrum.getTail();
peakInfo.tailAlpha = peaksSpectrum.getTailAlpha() == null ? 0 : peaksSpectrum.getTailAlpha();
peakInfo.upperTail = peaksSpectrum.getUpperTail() == null ? 0 : peaksSpectrum.getUpperTail();
peakInfo.upperTailAlpha = peaksSpectrum.getUpperTailAlpha() == null ? 0 : peaksSpectrum.getUpperTailAlpha();
peakInfo.BWWidthChan = peaksSpectrum.getBwwidthchan() == null ? 0 : peaksSpectrum.getBwwidthchan();
peakInfo.recoilBetaChan = "1";
peakInfo.recoilDeltaChan = peaksSpectrum.getRecoildeltachan() == null ? "1" : peaksSpectrum.getRecoildeltachan().toString();
peakInfo.BWWidthChan = peaksSpectrum.getBwwidthchan() == null ? Double.NaN : peaksSpectrum.getBwwidthchan();
peakInfo.recoilBetaChan = "nan";
peakInfo.recoilDeltaChan = peaksSpectrum.getRecoildeltachan() == null ? "nan" : String.valueOf(peaksSpectrum.getRecoildeltachan());
peakInfo.comments = StringUtils.isNotBlank(peaksSpectrum.getPeakcomments()) ? peaksSpectrum.getPeakcomments() : "";
phd.getVPeak().add(peakInfo);
}
@ -1308,7 +1308,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
peak.peakCentroid = structInsertOutput.peakCentroid.get(j);
peak.energy = structInsertOutput.energy.get(j);
peak.area = structInsertOutput.area.get(j);
Double sensitivity = String.valueOf(structInsertOutput.sensitivity.get(j)).equalsIgnoreCase("nan") ? 0.0 : structInsertOutput.sensitivity.get(j);
Double sensitivity = String.valueOf(structInsertOutput.sensitivity.get(j)).equalsIgnoreCase("nan") ? Double.NaN : structInsertOutput.sensitivity.get(j);
peak.sensitivity = sensitivity;
peak.fwhm = structInsertOutput.fwhm.get(j);
peak.fwhmc = structInsertOutput.fwhmc.get(j);
@ -1434,9 +1434,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
for (int j = 0; j < tablePeaksList.size(); j++) {
TablePeaks nPeak = tablePeaksList.get(j);
PeakInfo peak = phd.getVPeak().get(Integer.valueOf(nPeak.getLab()) - 1);
if (!NumberFormatUtil.numberFormat(String.valueOf(peak.energy)).equals(nPeak.getEnergy()) ) {
peak.energy = Double.parseDouble(nPeak.getEnergy());
}
if (!NumberFormatUtil.numberFormat(String.valueOf(peak.area)).equals(nPeak.getNetArea())) {
peak.area = Double.parseDouble(nPeak.getNetArea());
}
if (!NumberFormatUtil.numberFormat(String.valueOf(peak.fwhm)).equals(nPeak.getFwhm())) {
peak.fwhm = Double.parseDouble(nPeak.getFwhm());
}
double dE = CalValuesHandler.calDerivaOut(peak.peakCentroid, phd.getUsedEnerPara().getP());
if (peak.energy < vE_Rg.get(0) || peak.energy > vE_Rg.get(1)) {
@ -1573,7 +1579,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
gammaFileUtil.PeaksChanged(phd);
for (int i = 0; i < phd.getVPeak().size(); i++) {
PeakInfo peakInfo = phd.getVPeak().get(i);
peakInfo.index = i + 1;
peakInfo.index = i;
}
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
map.put("table", vPeak);