feat: add File5 trapping
This commit is contained in:
@@ -24,10 +24,9 @@ data class GridPoint(
|
||||
val grid: List<Double>
|
||||
)
|
||||
|
||||
class FineGridInterpolation(jsonInput: String, private val wall_l: Double) : ITrap {
|
||||
class FineGridInterpolation(jsonInput: String, private val wall_l: Double, private val deltaStep: Double = 1.0) : ITrap {
|
||||
private val hvValues: DoubleArray
|
||||
private val deltaLayers: Array<DoubleArray>
|
||||
private val deltaStep = 1.0
|
||||
|
||||
init {
|
||||
// Parse JSON input
|
||||
@@ -104,6 +103,16 @@ fun getTrapByName(name: String): ITrap {
|
||||
?: throw IllegalArgumentException("Resource not found: $resourcePath")
|
||||
FineGridInterpolation(jsonInput, 2000.0)
|
||||
}
|
||||
"Fine5" -> {
|
||||
val resourcePath = "trap-fine-5-day-2V.json"
|
||||
// Load JSON from resources at compile-time
|
||||
val jsonInput = {}::class.java.classLoader
|
||||
.getResourceAsStream(resourcePath)
|
||||
?.bufferedReader()
|
||||
?.use { it.readText() }
|
||||
?: throw IllegalArgumentException("Resource not found: $resourcePath")
|
||||
FineGridInterpolation(jsonInput, 2000.0, deltaStep = 2.0)
|
||||
}
|
||||
"TrapInterpolator" -> TrapInterpolator()
|
||||
"TrapInterpolator_24_07_12" -> TrapInterpolator_24_07_12()
|
||||
"TrapInterpolatorFull" -> TrapInterpolatorFull()
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user