feat: add Singlular module for time-series (later add Plural)
This commit is contained in:
42
src/Fvcom.fs
42
src/Fvcom.fs
@@ -551,6 +551,48 @@ module Siglay =
|
||||
Log.Error $"{err}"
|
||||
Array.empty
|
||||
|
||||
module Singular =
|
||||
let readUv (ds: DataSet) e t d =
|
||||
try
|
||||
let u = ds[ "u" ].GetData([| t; d; e |], [| 1; 1; 1 |]) :?> single [,,]
|
||||
let v = ds[ "v" ].GetData([| t; d; e |], [| 1; 1; 1 |]) :?> single [,,]
|
||||
u[0, 0, 0], v[0, 0, 0]
|
||||
with
|
||||
| err ->
|
||||
Log.Warning $"readUv {e} {t}"
|
||||
Log.Error $"{err}"
|
||||
0f, 0f
|
||||
|
||||
let readTemp (ds: DataSet) n t d =
|
||||
try
|
||||
let t = ds[ "temp" ].GetData([| t; d; n |], [| 1; 1; 1 |]) :?> single [,,]
|
||||
t[0, 0, 0]
|
||||
with
|
||||
| err ->
|
||||
Log.Warning $"readTemp {n} {t}"
|
||||
Log.Error $"{err}"
|
||||
0f
|
||||
|
||||
let readSalinity (ds: DataSet) n t d =
|
||||
try
|
||||
let t =
|
||||
ds["salinity"].GetData([| t; d; n |], [| 1; 1; 1 |]) :?> single [,,]
|
||||
t[0, 0, 0]
|
||||
with
|
||||
| err ->
|
||||
Log.Warning $"readS {n} {t}"
|
||||
Log.Error $"{err}"
|
||||
0f
|
||||
|
||||
let readZeta (ds: DataSet) n t =
|
||||
try
|
||||
let zeta = ds[ "zeta" ].GetData([| t; n |], [| 1; 1 |]) :?> single [,]
|
||||
zeta[0, 0]
|
||||
with
|
||||
| e ->
|
||||
Log.Error $"{e}"
|
||||
0f
|
||||
|
||||
let getBBox (ds: DataSet) : BBox =
|
||||
try
|
||||
let x = ds[ "x" ].GetData() :?> single []
|
||||
|
||||
Reference in New Issue
Block a user