foxes 1.2.2__py3-none-any.whl → 1.2.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of foxes might be problematic. Click here for more details.
- examples/field_data_nc/run.py +11 -4
- examples/streamline_wakes/run.py +6 -3
- foxes/algorithms/downwind/downwind.py +1 -0
- foxes/config/__init__.py +1 -1
- foxes/config/config.py +87 -14
- foxes/constants.py +12 -1
- foxes/core/algorithm.py +13 -8
- foxes/core/engine.py +30 -0
- foxes/core/farm_controller.py +41 -24
- foxes/core/states.py +1 -1
- foxes/core/wind_farm.py +109 -0
- foxes/engines/dask.py +88 -4
- foxes/engines/default.py +45 -2
- foxes/engines/mpi.py +5 -16
- foxes/engines/multiprocess.py +1 -10
- foxes/engines/numpy.py +30 -0
- foxes/engines/pool.py +48 -0
- foxes/engines/ray.py +1 -1
- foxes/engines/single.py +30 -0
- foxes/input/farm_layout/from_csv.py +2 -2
- foxes/input/farm_layout/from_file.py +2 -2
- foxes/input/farm_layout/from_json.py +2 -2
- foxes/input/states/__init__.py +0 -1
- foxes/input/states/create/random_abl_states.py +2 -2
- foxes/input/states/field_data_nc.py +286 -141
- foxes/input/states/multi_height.py +3 -3
- foxes/input/states/states_table.py +3 -3
- foxes/input/yaml/dict.py +83 -46
- foxes/input/yaml/windio/__init__.py +2 -1
- foxes/input/yaml/windio/read_attributes.py +17 -34
- foxes/input/yaml/windio/read_farm.py +57 -3
- foxes/input/yaml/windio/read_outputs.py +116 -56
- foxes/input/yaml/windio/{get_states.py → read_site.py} +69 -0
- foxes/input/yaml/windio/windio.py +42 -119
- foxes/input/yaml/yaml.py +3 -3
- foxes/models/model_book.py +1 -0
- foxes/models/point_models/__init__.py +1 -0
- foxes/models/point_models/ustar2ti.py +84 -0
- foxes/models/turbine_models/lookup_table.py +2 -2
- foxes/models/turbine_models/sector_management.py +2 -2
- foxes/models/turbine_models/table_factors.py +2 -2
- foxes/models/turbine_types/CpCt_file.py +2 -2
- foxes/models/turbine_types/CpCt_from_two.py +3 -3
- foxes/models/turbine_types/PCt_file.py +2 -2
- foxes/models/turbine_types/PCt_from_two.py +3 -3
- foxes/models/turbine_types/TBL_file.py +2 -2
- foxes/models/turbine_types/wsrho2PCt_from_two.py +3 -3
- foxes/models/turbine_types/wsti2PCt_from_two.py +3 -3
- foxes/output/__init__.py +1 -0
- foxes/output/output.py +5 -3
- foxes/output/slice_data.py +1 -1
- foxes/output/slices_data.py +323 -0
- foxes/output/state_turbine_table.py +11 -0
- foxes/utils/__init__.py +1 -0
- foxes/utils/load.py +12 -4
- foxes/utils/wrg_utils.py +79 -0
- foxes/utils/xarray_utils.py +14 -3
- foxes/variables.py +5 -0
- {foxes-1.2.2.dist-info → foxes-1.2.4.dist-info}/METADATA +6 -2
- {foxes-1.2.2.dist-info → foxes-1.2.4.dist-info}/RECORD +64 -62
- foxes/input/states/slice_data_nc.py +0 -687
- {foxes-1.2.2.dist-info → foxes-1.2.4.dist-info}/LICENSE +0 -0
- {foxes-1.2.2.dist-info → foxes-1.2.4.dist-info}/WHEEL +0 -0
- {foxes-1.2.2.dist-info → foxes-1.2.4.dist-info}/entry_points.txt +0 -0
- {foxes-1.2.2.dist-info → foxes-1.2.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from foxes.core import PointDataModel
|
|
3
|
+
import foxes.variables as FV
|
|
4
|
+
import foxes.constants as FC
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Ustar2TI(PointDataModel):
|
|
8
|
+
"""
|
|
9
|
+
Calculates TI from Ustar, using TI = Ustar / (kappa*WS)
|
|
10
|
+
|
|
11
|
+
Attributes
|
|
12
|
+
----------
|
|
13
|
+
max_ti: float
|
|
14
|
+
Upper limit of the computed TI values
|
|
15
|
+
|
|
16
|
+
:group: models.point_models
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, max_ti=None, **kwargs):
|
|
21
|
+
"""
|
|
22
|
+
Constructor
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
max_ti: float, optional
|
|
27
|
+
Upper limit of the computed TI values
|
|
28
|
+
kwargs: dict, optional
|
|
29
|
+
Additional parameters for the base class
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
super().__init__(**kwargs)
|
|
33
|
+
self.max_ti = max_ti
|
|
34
|
+
|
|
35
|
+
def output_point_vars(self, algo):
|
|
36
|
+
"""
|
|
37
|
+
The variables which are being modified by the model.
|
|
38
|
+
|
|
39
|
+
Parameters
|
|
40
|
+
----------
|
|
41
|
+
algo: foxes.core.Algorithm
|
|
42
|
+
The calculation algorithm
|
|
43
|
+
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
output_vars: list of str
|
|
47
|
+
The output variable names
|
|
48
|
+
|
|
49
|
+
"""
|
|
50
|
+
return [FV.TI]
|
|
51
|
+
|
|
52
|
+
def calculate(self, algo, mdata, fdata, pdata):
|
|
53
|
+
"""
|
|
54
|
+
The main model calculation.
|
|
55
|
+
|
|
56
|
+
This function is executed on a single chunk of data,
|
|
57
|
+
all computations should be based on numpy arrays.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
algo: foxes.core.Algorithm
|
|
62
|
+
The calculation algorithm
|
|
63
|
+
mdata: foxes.core.MData
|
|
64
|
+
The model data
|
|
65
|
+
fdata: foxes.core.FData
|
|
66
|
+
The farm data
|
|
67
|
+
tdata: foxes.core.TData
|
|
68
|
+
The target point data
|
|
69
|
+
|
|
70
|
+
Returns
|
|
71
|
+
-------
|
|
72
|
+
results: dict
|
|
73
|
+
The resulting data, keys: output variable str.
|
|
74
|
+
Values: numpy.ndarray with shape (n_states, n_points)
|
|
75
|
+
|
|
76
|
+
"""
|
|
77
|
+
ustar = pdata[FV.USTAR]
|
|
78
|
+
ws = pdata[FV.WS]
|
|
79
|
+
|
|
80
|
+
ti = (ustar / FC.KAPPA) / ws
|
|
81
|
+
if self.max_ti is not None:
|
|
82
|
+
ti = np.maximum(ti, self.max_ti)
|
|
83
|
+
|
|
84
|
+
return {FV.TI: ti}
|
|
@@ -4,7 +4,7 @@ import xarray as xr
|
|
|
4
4
|
|
|
5
5
|
from foxes.core import TurbineModel
|
|
6
6
|
from foxes.utils import PandasFileHelper
|
|
7
|
-
from foxes.config import config,
|
|
7
|
+
from foxes.config import config, get_input_path
|
|
8
8
|
import foxes.constants as FC
|
|
9
9
|
|
|
10
10
|
|
|
@@ -128,7 +128,7 @@ class LookupTable(TurbineModel):
|
|
|
128
128
|
if isinstance(self.data_source, pd.DataFrame):
|
|
129
129
|
data = self.data_source
|
|
130
130
|
else:
|
|
131
|
-
fpath =
|
|
131
|
+
fpath = get_input_path(self.data_source)
|
|
132
132
|
if verbosity > 0:
|
|
133
133
|
print(f"{self.name}: Reading file {fpath}")
|
|
134
134
|
data = PandasFileHelper.read_file(fpath, **self._rpars)
|
|
@@ -3,7 +3,7 @@ import pandas as pd
|
|
|
3
3
|
|
|
4
4
|
from foxes.core import TurbineModel
|
|
5
5
|
from foxes.utils import PandasFileHelper
|
|
6
|
-
from foxes.config import
|
|
6
|
+
from foxes.config import get_input_path
|
|
7
7
|
import foxes.variables as FV
|
|
8
8
|
import foxes.constants as FC
|
|
9
9
|
|
|
@@ -91,7 +91,7 @@ class SectorManagement(TurbineModel):
|
|
|
91
91
|
if isinstance(self.source, pd.DataFrame):
|
|
92
92
|
data = self.source
|
|
93
93
|
else:
|
|
94
|
-
fpath =
|
|
94
|
+
fpath = get_input_path(self.source)
|
|
95
95
|
if verbosity > 0:
|
|
96
96
|
print(f"{self.name}: Reading file {fpath}")
|
|
97
97
|
data = PandasFileHelper.read_file(fpath, **self._rpars)
|
|
@@ -4,7 +4,7 @@ from scipy.interpolate import interpn
|
|
|
4
4
|
|
|
5
5
|
from foxes.core import TurbineModel
|
|
6
6
|
from foxes.utils import PandasFileHelper
|
|
7
|
-
from foxes.config import config,
|
|
7
|
+
from foxes.config import config, get_input_path
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class TableFactors(TurbineModel):
|
|
@@ -106,7 +106,7 @@ class TableFactors(TurbineModel):
|
|
|
106
106
|
if isinstance(self.data_source, pd.DataFrame):
|
|
107
107
|
self._data = self.data_source
|
|
108
108
|
else:
|
|
109
|
-
fpath =
|
|
109
|
+
fpath = get_input_path(self.data_source)
|
|
110
110
|
if verbosity > 0:
|
|
111
111
|
print(f"{self.name}: Reading file {fpath}")
|
|
112
112
|
rpars = dict(index_col=0)
|
|
@@ -3,7 +3,7 @@ import pandas as pd
|
|
|
3
3
|
|
|
4
4
|
from foxes.data import parse_Pct_file_name
|
|
5
5
|
from foxes.utils import PandasFileHelper
|
|
6
|
-
from foxes.config import config,
|
|
6
|
+
from foxes.config import config, get_input_path
|
|
7
7
|
import foxes.constants as FC
|
|
8
8
|
|
|
9
9
|
from .PCt_file import PCtFile
|
|
@@ -49,7 +49,7 @@ class CpCtFile(PCtFile):
|
|
|
49
49
|
if not isinstance(data_source, pd.DataFrame):
|
|
50
50
|
pars = parse_Pct_file_name(data_source)
|
|
51
51
|
pars.update(parameters)
|
|
52
|
-
fpath =
|
|
52
|
+
fpath = get_input_path(data_source)
|
|
53
53
|
data = PandasFileHelper.read_file(fpath, **pd_file_read_pars)
|
|
54
54
|
else:
|
|
55
55
|
data = data_source
|
|
@@ -4,7 +4,7 @@ import pandas as pd
|
|
|
4
4
|
from .PCt_from_two import PCtFromTwo
|
|
5
5
|
from foxes.data import parse_Pct_two_files
|
|
6
6
|
from foxes.utils import PandasFileHelper
|
|
7
|
-
from foxes.config import config,
|
|
7
|
+
from foxes.config import config, get_input_path
|
|
8
8
|
import foxes.constants as FC
|
|
9
9
|
|
|
10
10
|
|
|
@@ -56,8 +56,8 @@ class CpCtFromTwo(PCtFromTwo):
|
|
|
56
56
|
data_source_ct, pd.DataFrame
|
|
57
57
|
):
|
|
58
58
|
pars = parse_Pct_two_files(data_source_cp, data_source_ct)
|
|
59
|
-
path_cp =
|
|
60
|
-
path_ct =
|
|
59
|
+
path_cp = get_input_path(data_source_cp)
|
|
60
|
+
path_ct = get_input_path(data_source_ct)
|
|
61
61
|
data_cp = PandasFileHelper.read_file(path_cp, **pd_file_read_pars_cp)
|
|
62
62
|
data_ct = PandasFileHelper.read_file(path_ct, **pd_file_read_pars_ct)
|
|
63
63
|
else:
|
|
@@ -5,7 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
from foxes.core import TurbineType
|
|
6
6
|
from foxes.utils import PandasFileHelper
|
|
7
7
|
from foxes.data import PCTCURVE, parse_Pct_file_name
|
|
8
|
-
from foxes.config import
|
|
8
|
+
from foxes.config import get_input_path
|
|
9
9
|
import foxes.variables as FV
|
|
10
10
|
import foxes.constants as FC
|
|
11
11
|
|
|
@@ -174,7 +174,7 @@ class PCtFile(TurbineType):
|
|
|
174
174
|
if isinstance(self.source, pd.DataFrame):
|
|
175
175
|
data = self.source
|
|
176
176
|
else:
|
|
177
|
-
fpath =
|
|
177
|
+
fpath = get_input_path(self.source)
|
|
178
178
|
if not fpath.is_file():
|
|
179
179
|
if verbosity > 0:
|
|
180
180
|
print(
|
|
@@ -4,7 +4,7 @@ import pandas as pd
|
|
|
4
4
|
from foxes.core import TurbineType
|
|
5
5
|
from foxes.utils import PandasFileHelper
|
|
6
6
|
from foxes.data import PCTCURVE, parse_Pct_two_files
|
|
7
|
-
from foxes.config import
|
|
7
|
+
from foxes.config import get_input_path
|
|
8
8
|
import foxes.variables as FV
|
|
9
9
|
import foxes.constants as FC
|
|
10
10
|
|
|
@@ -195,7 +195,7 @@ class PCtFromTwo(TurbineType):
|
|
|
195
195
|
if isinstance(self.source_P, pd.DataFrame):
|
|
196
196
|
self._data_P = self.source_P
|
|
197
197
|
else:
|
|
198
|
-
fpath =
|
|
198
|
+
fpath = get_input_path(self.source_P)
|
|
199
199
|
if not fpath.is_file():
|
|
200
200
|
fpath = algo.dbook.get_file_path(
|
|
201
201
|
PCTCURVE, self.source_P, check_raw=False
|
|
@@ -210,7 +210,7 @@ class PCtFromTwo(TurbineType):
|
|
|
210
210
|
if isinstance(self.source_ct, pd.DataFrame):
|
|
211
211
|
self._data_ct = self.source_ct
|
|
212
212
|
else:
|
|
213
|
-
fpath =
|
|
213
|
+
fpath = get_input_path(self.source_ct)
|
|
214
214
|
if not fpath.is_file():
|
|
215
215
|
fpath = algo.dbook.get_file_path(
|
|
216
216
|
PCTCURVE, self.source_ct, check_raw=False
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
import pandas as pd
|
|
3
3
|
|
|
4
|
-
from foxes.config import
|
|
4
|
+
from foxes.config import get_input_path
|
|
5
5
|
|
|
6
6
|
from .PCt_file import PCtFile
|
|
7
7
|
|
|
@@ -57,7 +57,7 @@ class TBLFile(PCtFile):
|
|
|
57
57
|
Additional parameters for PCtFile class
|
|
58
58
|
|
|
59
59
|
"""
|
|
60
|
-
fpath =
|
|
60
|
+
fpath = get_input_path(tbl_file)
|
|
61
61
|
assert fpath.suffix == ".tbl", f"Expecting *.tbl file, got '{tbl_file}'"
|
|
62
62
|
|
|
63
63
|
meta = np.genfromtxt(fpath, skip_header=1, max_rows=1)
|
|
@@ -5,7 +5,7 @@ from scipy.interpolate import interpn
|
|
|
5
5
|
from foxes.core import TurbineType
|
|
6
6
|
from foxes.utils import PandasFileHelper
|
|
7
7
|
from foxes.data import PCTCURVE, parse_Pct_two_files
|
|
8
|
-
from foxes.config import config,
|
|
8
|
+
from foxes.config import config, get_input_path
|
|
9
9
|
import foxes.variables as FV
|
|
10
10
|
|
|
11
11
|
|
|
@@ -183,7 +183,7 @@ class WsRho2PCtFromTwo(TurbineType):
|
|
|
183
183
|
if isinstance(self.source_P, pd.DataFrame):
|
|
184
184
|
data = self.source_P
|
|
185
185
|
else:
|
|
186
|
-
fpath =
|
|
186
|
+
fpath = get_input_path(self.source_P)
|
|
187
187
|
if not fpath.is_file():
|
|
188
188
|
fpath = algo.dbook.get_file_path(
|
|
189
189
|
PCTCURVE, self.source_P, check_raw=False
|
|
@@ -202,7 +202,7 @@ class WsRho2PCtFromTwo(TurbineType):
|
|
|
202
202
|
if isinstance(self.source_ct, pd.DataFrame):
|
|
203
203
|
data = self.source_ct
|
|
204
204
|
else:
|
|
205
|
-
fpath =
|
|
205
|
+
fpath = get_input_path(self.source_ct)
|
|
206
206
|
if not fpath.is_file():
|
|
207
207
|
fpath = algo.dbook.get_file_path(
|
|
208
208
|
PCTCURVE, self.source_ct, check_raw=False
|
|
@@ -6,7 +6,7 @@ from foxes.core import TurbineType
|
|
|
6
6
|
from foxes.utils import PandasFileHelper
|
|
7
7
|
from foxes.data import PCTCURVE, parse_Pct_two_files
|
|
8
8
|
import foxes.variables as FV
|
|
9
|
-
from foxes.config import config,
|
|
9
|
+
from foxes.config import config, get_input_path
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class WsTI2PCtFromTwo(TurbineType):
|
|
@@ -195,7 +195,7 @@ class WsTI2PCtFromTwo(TurbineType):
|
|
|
195
195
|
if isinstance(self.source_P, pd.DataFrame):
|
|
196
196
|
data = self.source_P
|
|
197
197
|
else:
|
|
198
|
-
fpath =
|
|
198
|
+
fpath = get_input_path(self.source_P)
|
|
199
199
|
if not fpath.is_file():
|
|
200
200
|
fpath = algo.dbook.get_file_path(
|
|
201
201
|
PCTCURVE, self.source_P, check_raw=False
|
|
@@ -214,7 +214,7 @@ class WsTI2PCtFromTwo(TurbineType):
|
|
|
214
214
|
if isinstance(self.source_ct, pd.DataFrame):
|
|
215
215
|
data = self.source_ct
|
|
216
216
|
else:
|
|
217
|
-
fpath =
|
|
217
|
+
fpath = get_input_path(self.source_ct)
|
|
218
218
|
if not fpath.is_file():
|
|
219
219
|
fpath = algo.dbook.get_file_path(
|
|
220
220
|
PCTCURVE, self.source_ct, check_raw=False
|
foxes/output/__init__.py
CHANGED
|
@@ -13,6 +13,7 @@ from .turbine_type_curves import TurbineTypeCurves
|
|
|
13
13
|
from .animation import Animator
|
|
14
14
|
from .calc_points import PointCalculator
|
|
15
15
|
from .slice_data import SliceData
|
|
16
|
+
from .slices_data import SlicesData
|
|
16
17
|
from .rotor_point_plots import RotorPointPlot
|
|
17
18
|
from .state_turbine_table import StateTurbineTable
|
|
18
19
|
from .plt import plt
|
foxes/output/output.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
from foxes.config import config,
|
|
3
|
+
from foxes.config import config, get_output_path
|
|
4
4
|
from foxes.utils import PandasFileHelper, new_instance, all_subclasses
|
|
5
5
|
|
|
6
6
|
|
|
@@ -34,7 +34,9 @@ class Output:
|
|
|
34
34
|
Modifies file names by f(fname)
|
|
35
35
|
|
|
36
36
|
"""
|
|
37
|
-
self.out_dir =
|
|
37
|
+
self.out_dir = (
|
|
38
|
+
get_output_path(out_dir) if out_dir is not None else config.output_dir
|
|
39
|
+
)
|
|
38
40
|
self.out_fname_fun = out_fname_fun
|
|
39
41
|
|
|
40
42
|
if not self.out_dir.is_dir():
|
|
@@ -59,7 +61,7 @@ class Output:
|
|
|
59
61
|
fnm = Path(fname)
|
|
60
62
|
if self.out_fname_fun is not None:
|
|
61
63
|
fnm = self.out_fname_fun(fnm)
|
|
62
|
-
return self.out_dir / fnm if self.out_dir is not None else
|
|
64
|
+
return self.out_dir / fnm if self.out_dir is not None else get_output_path(fnm)
|
|
63
65
|
|
|
64
66
|
def write(self, file_name, data, format_col2var={}, format_dict={}, **kwargs):
|
|
65
67
|
"""
|
foxes/output/slice_data.py
CHANGED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import xarray as xr
|
|
2
|
+
import pandas as pd
|
|
3
|
+
|
|
4
|
+
import foxes.constants as FC
|
|
5
|
+
|
|
6
|
+
from .output import Output
|
|
7
|
+
from .slice_data import SliceData
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SlicesData(Output):
|
|
11
|
+
"""
|
|
12
|
+
Create data for horizontal or vertical 2D slices, all in a
|
|
13
|
+
single Dataset
|
|
14
|
+
|
|
15
|
+
:group: output
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
algo,
|
|
22
|
+
farm_results,
|
|
23
|
+
verbosity_delta=1,
|
|
24
|
+
**kwargs,
|
|
25
|
+
):
|
|
26
|
+
"""
|
|
27
|
+
Constructor.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
algo: foxes.Algorithm
|
|
32
|
+
The algorithm for point calculation
|
|
33
|
+
farm_results: xarray.Dataset
|
|
34
|
+
The farm results
|
|
35
|
+
verbosity_delta: int
|
|
36
|
+
Verbosity threshold for printing calculation info
|
|
37
|
+
kwargs: dict, optional
|
|
38
|
+
Additional parameters for the Output class
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
super().__init__(**kwargs)
|
|
42
|
+
self._slice_data = SliceData(
|
|
43
|
+
algo=algo,
|
|
44
|
+
farm_results=farm_results,
|
|
45
|
+
verbosity_delta=verbosity_delta,
|
|
46
|
+
**kwargs,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
def get_mean_data_xy(
|
|
50
|
+
self,
|
|
51
|
+
z_list,
|
|
52
|
+
*args,
|
|
53
|
+
verbosity=0,
|
|
54
|
+
**kwargs,
|
|
55
|
+
):
|
|
56
|
+
"""
|
|
57
|
+
Creates mean data of 2D farm flow slices in a xy-plane.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
z_list: list of float
|
|
62
|
+
The z values
|
|
63
|
+
args: tuple, optional
|
|
64
|
+
Arguments for the SliceData function of the same name
|
|
65
|
+
verbosity: int, optional
|
|
66
|
+
The verbosity level, 0 = silent
|
|
67
|
+
kwargs: dict, optional
|
|
68
|
+
Arguments for the SliceData function of the same name
|
|
69
|
+
|
|
70
|
+
Returns
|
|
71
|
+
-------
|
|
72
|
+
data: xarray.Dataset
|
|
73
|
+
The gridded data
|
|
74
|
+
|
|
75
|
+
"""
|
|
76
|
+
dsl = []
|
|
77
|
+
for z in z_list:
|
|
78
|
+
if verbosity > 0:
|
|
79
|
+
print(f"{type(self).__name__}: Creating slice z = {z}")
|
|
80
|
+
dsl.append(
|
|
81
|
+
self._slice_data.get_mean_data_xy(
|
|
82
|
+
*args,
|
|
83
|
+
z=z,
|
|
84
|
+
data_format="xarray",
|
|
85
|
+
ret_states=False,
|
|
86
|
+
ret_grid=False,
|
|
87
|
+
verbosity=verbosity,
|
|
88
|
+
**kwargs,
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
out = xr.concat(dsl, pd.Index(z_list, name="z"))
|
|
92
|
+
del out.attrs["z"]
|
|
93
|
+
return out
|
|
94
|
+
|
|
95
|
+
def get_mean_data_xz(
|
|
96
|
+
self,
|
|
97
|
+
y_list,
|
|
98
|
+
*args,
|
|
99
|
+
verbosity=0,
|
|
100
|
+
**kwargs,
|
|
101
|
+
):
|
|
102
|
+
"""
|
|
103
|
+
Creates mean data of 2D farm flow slices in a xz-plane.
|
|
104
|
+
|
|
105
|
+
Parameters
|
|
106
|
+
----------
|
|
107
|
+
y_list: list of float
|
|
108
|
+
The y values
|
|
109
|
+
args: tuple, optional
|
|
110
|
+
Arguments for the SliceData function of the same name
|
|
111
|
+
verbosity: int, optional
|
|
112
|
+
The verbosity level, 0 = silent
|
|
113
|
+
kwargs: dict, optional
|
|
114
|
+
Arguments for the SliceData function of the same name
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
data: xarray.Dataset
|
|
119
|
+
The gridded data
|
|
120
|
+
|
|
121
|
+
"""
|
|
122
|
+
dsl = []
|
|
123
|
+
for y in y_list:
|
|
124
|
+
if verbosity > 0:
|
|
125
|
+
print(f"{type(self).__name__}: Creating slice y = {y}")
|
|
126
|
+
dsl.append(
|
|
127
|
+
self._slice_data.get_mean_data_xz(
|
|
128
|
+
*args,
|
|
129
|
+
y=y,
|
|
130
|
+
data_format="xarray",
|
|
131
|
+
ret_states=False,
|
|
132
|
+
ret_grid=False,
|
|
133
|
+
verbosity=verbosity,
|
|
134
|
+
**kwargs,
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
out = xr.concat(dsl, pd.Index(y_list, name="y"))
|
|
138
|
+
del out.attrs["y"]
|
|
139
|
+
return out
|
|
140
|
+
|
|
141
|
+
def get_mean_data_yz(
|
|
142
|
+
self,
|
|
143
|
+
x_list,
|
|
144
|
+
*args,
|
|
145
|
+
verbosity=0,
|
|
146
|
+
**kwargs,
|
|
147
|
+
):
|
|
148
|
+
"""
|
|
149
|
+
Creates mean data of 2D farm flow slices in a yz-plane.
|
|
150
|
+
|
|
151
|
+
Parameters
|
|
152
|
+
----------
|
|
153
|
+
x_list: list of float
|
|
154
|
+
The x values
|
|
155
|
+
args: tuple, optional
|
|
156
|
+
Arguments for the SliceData function of the same name
|
|
157
|
+
verbosity: int, optional
|
|
158
|
+
The verbosity level, 0 = silent
|
|
159
|
+
kwargs: dict, optional
|
|
160
|
+
Arguments for the SliceData function of the same name
|
|
161
|
+
|
|
162
|
+
Returns
|
|
163
|
+
-------
|
|
164
|
+
data: xarray.Dataset
|
|
165
|
+
The gridded data
|
|
166
|
+
|
|
167
|
+
"""
|
|
168
|
+
dsl = []
|
|
169
|
+
for x in x_list:
|
|
170
|
+
if verbosity > 0:
|
|
171
|
+
print(f"{type(self).__name__}: Creating slice x = {x}")
|
|
172
|
+
dsl.append(
|
|
173
|
+
self._slice_data.get_mean_data_yz(
|
|
174
|
+
*args,
|
|
175
|
+
x=x,
|
|
176
|
+
data_format="xarray",
|
|
177
|
+
ret_states=False,
|
|
178
|
+
ret_grid=False,
|
|
179
|
+
verbosity=verbosity,
|
|
180
|
+
**kwargs,
|
|
181
|
+
)
|
|
182
|
+
)
|
|
183
|
+
out = xr.concat(dsl, pd.Index(x_list, name="x"))
|
|
184
|
+
del out.attrs["x"]
|
|
185
|
+
return out
|
|
186
|
+
|
|
187
|
+
def get_states_data_xy(
|
|
188
|
+
self,
|
|
189
|
+
z_list,
|
|
190
|
+
*args,
|
|
191
|
+
verbosity=0,
|
|
192
|
+
**kwargs,
|
|
193
|
+
):
|
|
194
|
+
"""
|
|
195
|
+
Creates states data of 2D farm flow slices in a xy-plane.
|
|
196
|
+
|
|
197
|
+
Parameters
|
|
198
|
+
----------
|
|
199
|
+
z_list: list of float
|
|
200
|
+
The z values
|
|
201
|
+
args: tuple, optional
|
|
202
|
+
Arguments for the SliceData function of the same name
|
|
203
|
+
verbosity: int, optional
|
|
204
|
+
The verbosity level, 0 = silent
|
|
205
|
+
kwargs: dict, optional
|
|
206
|
+
Arguments for the SliceData function of the same name
|
|
207
|
+
|
|
208
|
+
Returns
|
|
209
|
+
-------
|
|
210
|
+
data: xarray.Dataset
|
|
211
|
+
The gridded data
|
|
212
|
+
|
|
213
|
+
"""
|
|
214
|
+
dsl = []
|
|
215
|
+
for z in z_list:
|
|
216
|
+
if verbosity > 0:
|
|
217
|
+
print(f"{type(self).__name__}: Creating slice z = {z}")
|
|
218
|
+
dsl.append(
|
|
219
|
+
self._slice_data.get_states_data_xy(
|
|
220
|
+
*args,
|
|
221
|
+
z=z,
|
|
222
|
+
data_format="xarray",
|
|
223
|
+
ret_states=False,
|
|
224
|
+
ret_grid=False,
|
|
225
|
+
verbosity=verbosity,
|
|
226
|
+
**kwargs,
|
|
227
|
+
)
|
|
228
|
+
)
|
|
229
|
+
out = xr.concat(dsl, pd.Index(z_list, name="z"))
|
|
230
|
+
del out.attrs["z"]
|
|
231
|
+
return out.transpose(FC.STATE, "z", ...)
|
|
232
|
+
|
|
233
|
+
def get_states_data_xz(
|
|
234
|
+
self,
|
|
235
|
+
y_list,
|
|
236
|
+
*args,
|
|
237
|
+
verbosity=0,
|
|
238
|
+
**kwargs,
|
|
239
|
+
):
|
|
240
|
+
"""
|
|
241
|
+
Creates states data of 2D farm flow slices in a xz-plane.
|
|
242
|
+
|
|
243
|
+
Parameters
|
|
244
|
+
----------
|
|
245
|
+
y_list: list of float
|
|
246
|
+
The y values
|
|
247
|
+
args: tuple, optional
|
|
248
|
+
Arguments for the SliceData function of the same name
|
|
249
|
+
verbosity: int, optional
|
|
250
|
+
The verbosity level, 0 = silent
|
|
251
|
+
kwargs: dict, optional
|
|
252
|
+
Arguments for the SliceData function of the same name
|
|
253
|
+
|
|
254
|
+
Returns
|
|
255
|
+
-------
|
|
256
|
+
data: xarray.Dataset
|
|
257
|
+
The gridded data
|
|
258
|
+
|
|
259
|
+
"""
|
|
260
|
+
dsl = []
|
|
261
|
+
for y in y_list:
|
|
262
|
+
if verbosity > 0:
|
|
263
|
+
print(f"{type(self).__name__}: Creating slice y = {y}")
|
|
264
|
+
dsl.append(
|
|
265
|
+
self._slice_data.get_states_data_xz(
|
|
266
|
+
*args,
|
|
267
|
+
y=y,
|
|
268
|
+
data_format="xarray",
|
|
269
|
+
ret_states=False,
|
|
270
|
+
ret_grid=False,
|
|
271
|
+
verbosity=verbosity,
|
|
272
|
+
**kwargs,
|
|
273
|
+
)
|
|
274
|
+
)
|
|
275
|
+
out = xr.concat(dsl, pd.Index(y_list, name="y"))
|
|
276
|
+
del out.attrs["y"]
|
|
277
|
+
return out.transpose(FC.STATE, "z", "y", ...)
|
|
278
|
+
|
|
279
|
+
def get_states_data_yz(
|
|
280
|
+
self,
|
|
281
|
+
x_list,
|
|
282
|
+
*args,
|
|
283
|
+
verbosity=0,
|
|
284
|
+
**kwargs,
|
|
285
|
+
):
|
|
286
|
+
"""
|
|
287
|
+
Creates states data of 2D farm flow slices in a yz-plane.
|
|
288
|
+
|
|
289
|
+
Parameters
|
|
290
|
+
----------
|
|
291
|
+
x_list: list of float
|
|
292
|
+
The x values
|
|
293
|
+
args: tuple, optional
|
|
294
|
+
Arguments for the SliceData function of the same name
|
|
295
|
+
verbosity: int, optional
|
|
296
|
+
The verbosity level, 0 = silent
|
|
297
|
+
kwargs: dict, optional
|
|
298
|
+
Arguments for the SliceData function of the same name
|
|
299
|
+
|
|
300
|
+
Returns
|
|
301
|
+
-------
|
|
302
|
+
data: xarray.Dataset
|
|
303
|
+
The gridded data
|
|
304
|
+
|
|
305
|
+
"""
|
|
306
|
+
dsl = []
|
|
307
|
+
for x in x_list:
|
|
308
|
+
if verbosity > 0:
|
|
309
|
+
print(f"{type(self).__name__}: Creating slice x = {x}")
|
|
310
|
+
dsl.append(
|
|
311
|
+
self._slice_data.get_states_data_yz(
|
|
312
|
+
*args,
|
|
313
|
+
x=x,
|
|
314
|
+
data_format="xarray",
|
|
315
|
+
ret_states=False,
|
|
316
|
+
ret_grid=False,
|
|
317
|
+
verbosity=verbosity,
|
|
318
|
+
**kwargs,
|
|
319
|
+
)
|
|
320
|
+
)
|
|
321
|
+
out = xr.concat(dsl, pd.Index(x_list, name="x"))
|
|
322
|
+
del out.attrs["x"]
|
|
323
|
+
return out.transpose(FC.STATE, "z", "y", "x", ...)
|