fix: add missing trap files
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package ru.inr.mass.scripts
|
||||
|
||||
import org.apache.commons.math3.analysis.interpolation.BicubicInterpolator
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
class TrapInterpolator_24_07_12: ITrap {
|
||||
private val x = arrayOf(12000.0, 14000.0, 16000.0, 18000.0).toDoubleArray()
|
||||
private val yFine = arrayOf(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0).toDoubleArray()
|
||||
private val gridFine = arrayOf(
|
||||
arrayOf(0.00351226, 0.000888095, 0.000300611, 0.00015058, 8.29841e-5, 6.81459e-5, 4.01181e-5, 3.24242e-5, 2.36312e-5, 2.08834e-5, 1.70365e-5, 0.000825444, 0.00367658, 0.0028308, 0.00231256, 0.00155746, 0.00145085, 0.0012629, 0.0010755, 0.000886446, 0.000812804, 0.000658927, 0.000592979, 0.000492958, 0.000444597, 0.000485814, 0.000462183, 0.000398983, 0.000421515, 0.000401181, 0.000386893, 0.000362162, 0.000318197, 0.000296215, 0.000254448, 0.00023961, 0.000244556, 0.000207185, 0.000245655, 0.000236312, 0.000229168, 0.000235213, 0.000233564, 0.000231916, 0.000219276, 0.000230817, 0.000212132, 0.000198942, 0.000203888, 0.000200591).toDoubleArray(),
|
||||
arrayOf(0.00365292, 0.00111857, 0.000366711, 0.000185838, 9.22097e-5, 7.37678e-5, 4.39769e-5, 3.40467e-5, 3.54653e-5, 2.62443e-5, 1.91512e-5, 0.000933446, 0.00433386, 0.00319613, 0.0026677, 0.00167254, 0.0016924, 0.0013796, 0.00120795, 0.00107531, 0.000956144, 0.000797259, 0.000651142, 0.000541909, 0.000524177, 0.000536235, 0.000505735, 0.000485874, 0.000458921, 0.000461758, 0.000422037, 0.000380188, 0.000362455, 0.000309257, 0.000277338, 0.00027592, 0.000248257, 0.000247548, 0.000273083, 0.000236199, 0.000276629, 0.000251803, 0.000226978, 0.000209954, 0.000200024, 0.000244001, 0.000232652, 0.000227687, 0.00019435, 0.000199315).toDoubleArray(),
|
||||
arrayOf(0.00366718, 0.00122065, 0.000483719, 0.000219158, 0.000121366, 8.90602e-5, 6.37391e-5, 4.97689e-5, 3.84181e-5, 2.61942e-5, 2.35748e-5, 0.00108618, 0.00460319, 0.00354669, 0.00287001, 0.0019244, 0.00182923, 0.00156728, 0.00138305, 0.00116826, 0.00102681, 0.000849564, 0.00073431, 0.00061469, 0.000610324, 0.000564921, 0.000543092, 0.00050904, 0.000462764, 0.000449667, 0.000448793, 0.000427838, 0.000338778, 0.000357114, 0.000320442, 0.000307345, 0.000261942, 0.000266307, 0.00030036, 0.000276785, 0.000278531, 0.000275039, 0.000252337, 0.000264561, 0.000245352, 0.00022527, 0.000247098, 0.000246225, 0.000247971, 0.000246225).toDoubleArray(),
|
||||
arrayOf(0.00363484, 0.00142831, 0.000556026, 0.000249075, 0.000158126, 9.81831e-5, 8.1647e-5, 4.54743e-5, 4.34073e-5, 3.51392e-5, 3.92732e-5, 0.00112445, 0.00500424, 0.00382397, 0.00311292, 0.00202154, 0.00203497, 0.00166808, 0.00145724, 0.00121334, 0.00105728, 0.00087538, 0.000766862, 0.000664545, 0.000610802, 0.000589099, 0.000535356, 0.000482647, 0.000504351, 0.000485748, 0.000435106, 0.000422704, 0.000375163, 0.000385498, 0.000332789, 0.000304884, 0.000304884, 0.00028008, 0.000264578, 0.000290415, 0.000253209, 0.000333823, 0.000305918, 0.000272846, 0.000274913, 0.000253209, 0.000242874, 0.000254243, 0.000219103, 0.000253209).toDoubleArray(),
|
||||
)
|
||||
|
||||
private val fineInterpolator = BicubicInterpolator().interpolate(x, yFine, gridFine)
|
||||
|
||||
private val yCoarse = arrayOf(50.0, 150.0, 250.0, 350.0, 450.0, 550.0, 650.0, 750.0, 850.0, 950.0, 1050.0, 1150.0, 1250.0, 1350.0, 1450.0, 1550.0, 1650.0, 1750.0, 1850.0, 1950.0, 2050.0, 2150.0, 2250.0, 2350.0, 2450.0, 2550.0, 2650.0, 2750.0, 2850.0, 2950.0, 3050.0, 3150.0, 3250.0, 3350.0, 3450.0, 3550.0, 3650.0, 3750.0, 3850.0, 3950.0, 4050.0, 4150.0, 4250.0, 4350.0, 4450.0, 4550.0, 4650.0, 4750.0, 4850.0, 4950.0, 5050.0, 5150.0, 5250.0, 5350.0, 5450.0, 5550.0, 5650.0, 5750.0, 5850.0, 5950.0, 6050.0, 6150.0, 6250.0, 6350.0, 6450.0, 6550.0, 6650.0, 6750.0, 6850.0).toDoubleArray()
|
||||
private val gridCoarse = arrayOf(
|
||||
arrayOf(0.000147475, 0.00012202, 0.000112809, 0.00010855, 0.000102103, 9.98996e-5, 9.65858e-5, 9.51404e-5, 9.26289e-5, 9.36896e-5, 9.46953e-5, 9.47557e-5, 9.48931e-5, 9.52174e-5, 9.8174e-5, 9.93006e-5, 0.000102543, 0.000103554, 0.000104719, 0.000105121, 0.000108863, 0.000109841, 0.000112452, 0.000113963, 0.000114397, 0.000117008, 0.000116892, 0.000119992, 0.000120706, 0.000124004, 0.000123993, 0.000128241, 0.000128708, 0.000131478, 0.000132637, 0.000132599, 0.000136561, 0.00013733, 0.000139891, 0.000139386, 0.000142051, 0.000144255, 0.000146838, 0.000148157, 0.000150459, 0.000152883, 0.000153806, 0.000155164, 0.000157181, 0.000158538, 0.00016078, 0.000163797, 0.000165572, 0.000167496, 0.000171244, 0.000173514, 0.000176421, 0.00017929, 0.000181493, 0.000181383, 0.000185703, 0.000189929, 0.000192166, 0.000196502, 0.000198447, 0.00020252, 0.000205614, 0.000210164, 0.00021461).toDoubleArray(),
|
||||
arrayOf(0.000161395, 0.000134655, 0.000125136, 0.000119532, 0.000114759, 0.000110552, 0.000109602, 0.000104268, 0.000102225, 0.000101225, 0.000100466, 0.000101693, 0.000101097, 0.000101608, 0.000102055, 0.000102225, 0.000104438, 0.000106729, 0.00010802, 0.000109354, 0.000111439, 0.000112624, 0.000114829, 0.000113602, 0.00011512, 0.000118248, 0.000119511, 0.000122064, 0.000123526, 0.00012659, 0.000126668, 0.000127845, 0.000128604, 0.000130576, 0.00013191, 0.00013281, 0.000134059, 0.000136364, 0.000137747, 0.000140684, 0.00014096, 0.000141343, 0.00014423, 0.000146337, 0.000149025, 0.000150614, 0.000151373, 0.000152621, 0.000154153, 0.000157466, 0.000156764, 0.000159927, 0.000161551, 0.000163388, 0.000166751, 0.000167644, 0.000169247, 0.000170311, 0.000174354, 0.000176206, 0.000178121, 0.000178085, 0.000180149, 0.000185923, 0.000186292, 0.00018432, 0.000189917, 0.000191966, 0.000197038).toDoubleArray(),
|
||||
arrayOf(0.000170891, 0.000143806, 0.000135651, 0.000127574, 0.000122781, 0.00011852, 0.000115988, 0.000113604, 0.000110522, 0.000108025, 0.00010744, 0.000106968, 0.000105012, 0.000105903, 0.0001062, 0.000107204, 0.00010744, 0.000107658, 0.000108033, 0.000111771, 0.000114477, 0.000112652, 0.000114923, 0.000118485, 0.00011597, 0.000119699, 0.000121122, 0.000121235, 0.00012272, 0.000122921, 0.000126544, 0.000126186, 0.000127635, 0.000131276, 0.000132743, 0.000132237, 0.000136227, 0.000136611, 0.000135625, 0.000138803, 0.000139781, 0.000140322, 0.000141676, 0.000144941, 0.00014729, 0.000147464, 0.000149979, 0.000149403, 0.000151856, 0.000154397, 0.00015486, 0.000155279, 0.000159793, 0.00016009, 0.000161592, 0.000162282, 0.000162456, 0.00016477, 0.000166543, 0.000168621, 0.000171083, 0.000170664, 0.000172524, 0.000178164, 0.000174174, 0.00018053, 0.000181246, 0.000181945, 0.000183438).toDoubleArray(),
|
||||
arrayOf(0.000182073, 0.000151698, 0.000142614, 0.000135978, 0.000129633, 0.000127452, 0.000123029, 0.000120011, 0.000118605, 0.000116755, 0.00011228, 0.000111267, 0.000111391, 0.000110006, 0.000109479, 0.000111216, 0.000112042, 0.000110637, 0.000112032, 0.000113572, 0.000110761, 0.000112394, 0.00011536, 0.000116476, 0.00011906, 0.000118233, 0.000120672, 0.000120062, 0.000121954, 0.000124031, 0.000126098, 0.00012771, 0.00012738, 0.000128206, 0.000129137, 0.000131266, 0.000133653, 0.000132527, 0.000137012, 0.000137787, 0.000138635, 0.000139492, 0.000139244, 0.000142789, 0.00014251, 0.000145383, 0.000143595, 0.000148639, 0.000148908, 0.000150665, 0.000148194, 0.000155687, 0.000153641, 0.000154416, 0.000155388, 0.000158602, 0.000159408, 0.00016254, 0.000163408, 0.000166405, 0.000164296, 0.000168275, 0.000165609, 0.000168751, 0.000170756, 0.000172926, 0.000172037, 0.000177877, 0.000176285).toDoubleArray(),
|
||||
)
|
||||
|
||||
private val coarseOInterpolator = BicubicInterpolator().interpolate(x, yCoarse, gridCoarse)
|
||||
|
||||
override fun value(ei: Double, delta: Double): Double {
|
||||
|
||||
val ei = max(12000.0, min(18000.0, ei))
|
||||
|
||||
return if (delta < 50.0) {
|
||||
fineInterpolator.value(ei, min(49.0, delta))
|
||||
} else {
|
||||
coarseOInterpolator.value(ei, min(6850.0, delta))
|
||||
}
|
||||
}
|
||||
}
|
||||
1
numass-workspace/src/main/resources/trap-fine-2-day.json
Normal file
1
numass-workspace/src/main/resources/trap-fine-2-day.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user