fix(fit-custom): display correct counts in fit output
This commit is contained in:
@@ -229,15 +229,6 @@ suspend fun processCustom(
|
||||
mode = ScatterMode.lines
|
||||
x.buffer = data.x
|
||||
y.numbers = x.doubles.map { spectrum(it, fitParams + fit.result) }
|
||||
File(dataPath.parent.toString(), dataPath.nameWithoutExtension + postfix + ".fit")
|
||||
.printWriter().use {
|
||||
out -> out.println("U_sp\tcounts\tresidials")
|
||||
data.indices.map{
|
||||
val value = spectrum(data.x[it], fitParams + fit.result)
|
||||
val dif = data.y[it] - value
|
||||
out.println("${data.x[it]}\t${data.y[it]}\t${dif/data.yErr[it]}")
|
||||
}
|
||||
}
|
||||
}
|
||||
scatter {
|
||||
name = "Fit"
|
||||
@@ -259,6 +250,17 @@ suspend fun processCustom(
|
||||
val dif = testData.y[it] - value
|
||||
dif/testData.yErr[it]
|
||||
}
|
||||
|
||||
File(dataPath.parent.toString(), dataPath.nameWithoutExtension + postfix + ".fit.tsv")
|
||||
.printWriter().use {
|
||||
out -> out.println("U_sp\tcounts\tresidials")
|
||||
testData.indices.forEach{
|
||||
val value = spectrum(testData.x[it], fitParams + fit.result)
|
||||
val dif = testData.y[it] - value
|
||||
val residial = dif/testData.yErr[it]
|
||||
out.println("${testData.x[it]}\t${value}\t$residial")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
plot {
|
||||
@@ -296,11 +298,16 @@ suspend fun processCustom(
|
||||
table {
|
||||
tr {
|
||||
th { +"U_sp" }
|
||||
th { +"Counts" }
|
||||
th { +"residials" }
|
||||
}
|
||||
testData.indices.forEach {
|
||||
tr {
|
||||
td { +testData.x[it].toString() }
|
||||
td {
|
||||
val value = spectrum(testData.x[it], fitParams + fit.result)
|
||||
+value.toString()
|
||||
}
|
||||
td {
|
||||
val value = spectrum(testData.x[it], fitParams + fit.result)
|
||||
val dif = testData.y[it] - value
|
||||
|
||||
Reference in New Issue
Block a user