foxes 1.5.1__tar.gz → 1.6.1__tar.gz
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.
- {foxes-1.5.1/foxes.egg-info → foxes-1.6.1}/PKG-INFO +8 -7
- {foxes-1.5.1 → foxes-1.6.1}/README.md +1 -1
- foxes-1.6.1/examples/parameter_study/run.py +115 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/power_mask/run.py +5 -7
- {foxes-1.5.1 → foxes-1.6.1}/examples/timeseries/run.py +1 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/yawed_wake/run.py +7 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/downwind.py +103 -12
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/__init__.py +3 -0
- foxes-1.6.1/foxes/algorithms/downwind/models/population.py +523 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/set_amb_farm_results.py +2 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/set_amb_point_results.py +2 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/iterative/iterative.py +48 -4
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/iterative/models/convergence.py +72 -37
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/sequential/sequential.py +1 -0
- foxes-1.6.1/foxes/config/__init__.py +5 -0
- foxes-1.5.1/foxes/config/config.py → foxes-1.6.1/foxes/config/conf.py +64 -3
- {foxes-1.5.1 → foxes-1.6.1}/foxes/constants.py +11 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/algorithm.py +115 -133
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/data.py +144 -8
- foxes-1.6.1/foxes/core/engine.py +1065 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/farm_controller.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/model.py +6 -6
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/rotor_model.py +24 -4
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/states.py +14 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/turbine.py +10 -4
- foxes-1.6.1/foxes/core/wind_farm.py +394 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/parse.py +8 -7
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/__init__.py +0 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/dask.py +235 -458
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/default.py +66 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/futures.py +18 -5
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/mpi.py +1 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/multiprocess.py +4 -4
- foxes-1.5.1/foxes/engines/pool.py → foxes-1.6.1/foxes/engines/numpy.py +65 -97
- foxes-1.6.1/foxes/engines/pool.py +419 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/ray.py +6 -6
- {foxes-1.5.1 → foxes-1.6.1}/foxes/engines/single.py +74 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/__init__.py +2 -0
- foxes-1.6.1/foxes/input/farm_layout/from_eww.py +178 -0
- foxes-1.6.1/foxes/input/farm_layout/from_wrf.py +86 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/__init__.py +2 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/dataset_states.py +519 -65
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/field_data.py +26 -174
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/multi_height.py +29 -12
- foxes-1.6.1/foxes/input/states/newa_states.py +536 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/one_point_flow.py +9 -8
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/point_cloud_data.py +124 -173
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/scan.py +9 -7
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/single.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/states_table.py +31 -25
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/__init__.py +0 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/__init__.py +6 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/read_attributes.py +13 -3
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/read_farm.py +123 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/read_fields.py +3 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/read_outputs.py +24 -12
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/read_site.py +33 -12
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/windio/windio.py +80 -14
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/farm_controllers/__init__.py +1 -0
- foxes-1.6.1/foxes/models/farm_controllers/op_flag.py +196 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/model_book.py +30 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/top_hat.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/rotor_models/direct_infusion.py +24 -4
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/rotor_models/grid.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/rotor_models/levels.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/power_mask.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/rotor_centre_calc.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/sector_management.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/set_farm_vars.py +9 -6
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/table_factors.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/dynamic_wakes.py +43 -13
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/seq_dynamic_wakes.py +4 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/timelines.py +16 -10
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/induction/self_similar.py +22 -4
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/induction/self_similar2020.py +1 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/ti/crespo_hernandez.py +1 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/wind/bastankhah14.py +22 -9
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/wind/bastankhah16.py +1 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/wind/turbopark.py +1 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/__init__.py +2 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/calc_points.py +1 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/farm_layout.py +16 -9
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/flow_plots_2d/__init__.py +1 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/flow_plots_2d/flow_plots.py +85 -0
- foxes-1.6.1/foxes/output/flow_plots_2d/from_chunk.py +164 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/results_writer.py +5 -2
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/slice_data.py +8 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/state_turbine_map.py +9 -4
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/state_turbine_table.py +2 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/__init__.py +10 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/area_geometry.py +12 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geopandas_utils.py +1 -3
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/pandas_utils.py +27 -27
- foxes-1.6.1/foxes/utils/utm_utils.py +87 -0
- foxes-1.6.1/foxes/utils/xarray_utils.py +243 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/variables.py +19 -3
- {foxes-1.5.1 → foxes-1.6.1/foxes.egg-info}/PKG-INFO +8 -7
- {foxes-1.5.1 → foxes-1.6.1}/foxes.egg-info/SOURCES.txt +10 -1
- {foxes-1.5.1 → foxes-1.6.1}/foxes.egg-info/requires.txt +5 -5
- {foxes-1.5.1 → foxes-1.6.1}/pyproject.toml +8 -6
- {foxes-1.5.1 → foxes-1.6.1}/tests/0_consistency/iterative/test_iterative.py +1 -1
- foxes-1.6.1/tests/2_models/turbine_models/test_set_farm_vars.py +64 -0
- foxes-1.5.1/foxes/config/__init__.py +0 -5
- foxes-1.5.1/foxes/core/engine.py +0 -671
- foxes-1.5.1/foxes/core/wind_farm.py +0 -187
- foxes-1.5.1/foxes/engines/numpy.py +0 -195
- foxes-1.5.1/foxes/utils/xarray_utils.py +0 -75
- {foxes-1.5.1 → foxes-1.6.1}/LICENSE +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/Logo_FOXES.svg +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/MANIFEST.in +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/docs/source/conf.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/abl_states/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/compare_rotors_pwakes/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/compare_wakes/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/dyn_wakes/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/field_data_nc/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/induction/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/multi_height/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/quickstart/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/random_timeseries/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/scan_row/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/sector_management/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/sequential/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/single_state/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/states_lookup_table/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/streamline_wakes/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/tab_file/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/timelines/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/timeseries_slurm/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/examples/wind_rose/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/farm_wakes_calc.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/init_farm_data.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/point_wakes_calc.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/downwind/models/reorder_farm_output.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/iterative/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/iterative/models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/iterative/models/farm_wakes_calc.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/iterative/models/urelax.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/sequential/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/sequential/models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/sequential/models/plugin.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/algorithms/sequential/models/seq_state.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/axial_induction_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/data_calc_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/farm_data_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/farm_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/ground_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/partial_wakes_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/point_data_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/turbine_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/turbine_type.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/vertical_profile.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/wake_deflection.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/wake_frame.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/wake_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/core/wake_superposition.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/farms/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/farms/test_farm_67.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/power_ct_curves/DTU-10MW-D178d3-H119.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/power_ct_curves/IEA-15MW-D240-H150.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/power_ct_curves/IWT-7d5MW-D164-H100.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/power_ct_curves/NREL-5MW-D126-H90.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/power_ct_curves/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/WRF-Timeseries-3000.nc +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/WRF-Timeseries-4464.csv.gz +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/abl_states_6000.csv.gz +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/point_cloud_100.nc +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/timeseries_100.csv.gz +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/timeseries_3000.csv.gz +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/timeseries_8000.csv.gz +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/weibull_cloud_4.nc +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/weibull_grid.nc +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/weibull_sectors_12.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/weibull_sectors_12.nc +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/wind_rose_bremen.csv +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/wind_rotation.nc +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/states/winds100.tab +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/data/static_data.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/from_arrays.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/from_csv.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/from_df.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/from_file.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/from_json.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/from_random.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/grid.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/ring.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/farm_layout/row.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/create/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/create/random_abl_states.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/create/random_timeseries.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/weibull_sectors.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/states/wrg_states.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/dict.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/input/yaml/yaml.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/axial_induction/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/axial_induction/betz.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/axial_induction/madsen.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/farm_controllers/basic.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/farm_models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/farm_models/turbine2farm.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/ground_models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/ground_models/no_ground.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/ground_models/wake_mirror.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/axiwake.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/centre.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/grid.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/rotor_points.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/partial_wakes/segregated.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/point_models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/point_models/set_uniform_data.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/point_models/tke2ti.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/point_models/ustar2ti.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/point_models/wake_deltas.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/rotor_models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/rotor_models/centre.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/calculator.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/kTI_model.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/lookup_table.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/thrust2ct.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/yaw2yawm.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_models/yawm2yaw.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/CpCt_file.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/CpCt_from_two.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/PCt_file.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/PCt_from_two.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/TBL_file.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/calculator_type.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/lookup.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/null_type.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/wsrho2PCt_from_two.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/turbine_types/wsti2PCt_from_two.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/abl_log_neutral_ws.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/abl_log_stable_ws.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/abl_log_unstable_ws.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/abl_log_ws.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/data_profile.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/sheared_ws.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/vertical_profiles/uniform.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_deflections/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_deflections/bastankhah2016.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_deflections/jimenez.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_deflections/no_deflection.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/farm_order.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/rotor_wd.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_frames/streamlines.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/axisymmetric.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/dist_sliced.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/gaussian.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/induction/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/induction/rankine_half_body.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/induction/rathmann.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/induction/vortex_sheet.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/ti/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/ti/iec_ti.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/top_hat.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/wind/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_models/wind/jensen.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ti_linear.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ti_max.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ti_pow.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ti_quadratic.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/wind_vector.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ws_linear.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ws_max.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ws_pow.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ws_product.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/models/wake_superpositions/ws_quadratic.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/animation.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/farm_results_eval.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/flow_plots_2d/get_fig.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/grids.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/output.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/plt.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/rose_plot.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/rotor_point_plots.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/seq_plugins/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/seq_plugins/seq_flow_ani_plugin.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/seq_plugins/seq_wake_debug_plugin.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/slices_data.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/output/turbine_type_curves.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/abl/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/abl/neutral.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/abl/sheared.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/abl/stable.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/abl/unstable.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/cubic_roots.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/data_book.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/dev_utils.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/dict.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/exec_python.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/factory.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/__init__.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/circle.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/example_intersection.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/example_union.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/half_plane.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/geom2d/polygon.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/load.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/random_xy.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/regularize.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/subclasses.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/tab_files.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/two_circles.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/weibull.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/wind_dir.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes/utils/wrg_utils.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes.egg-info/dependency_links.txt +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes.egg-info/entry_points.txt +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/foxes.egg-info/top_level.txt +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/setup.cfg +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/0_consistency/partial_wakes/test_partial_wakes.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/abl_states/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +0 -0
- {foxes-1.5.1 → foxes-1.6.1}/tests/3_examples/test_examples.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foxes
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.1
|
|
4
4
|
Summary: Farm Optimization and eXtended yield Evaluation Software
|
|
5
5
|
Author: Jonas Schulte
|
|
6
6
|
Maintainer: Jonas Schulte
|
|
@@ -41,23 +41,24 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
41
41
|
Classifier: Programming Language :: Python :: 3.11
|
|
42
42
|
Classifier: Programming Language :: Python :: 3.12
|
|
43
43
|
Classifier: Programming Language :: Python :: 3.13
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
44
45
|
Classifier: License :: OSI Approved :: MIT License
|
|
45
46
|
Classifier: Operating System :: OS Independent
|
|
46
47
|
Classifier: Development Status :: 4 - Beta
|
|
47
48
|
Requires-Python: >=3.9
|
|
48
49
|
Description-Content-Type: text/markdown
|
|
49
50
|
License-File: LICENSE
|
|
50
|
-
Requires-Dist: cycler>=0.10
|
|
51
|
-
Requires-Dist: h5netcdf>=1.0
|
|
52
51
|
Requires-Dist: matplotlib>=3.8
|
|
53
52
|
Requires-Dist: numpy>=1.26
|
|
54
53
|
Requires-Dist: pandas>=2.0
|
|
55
|
-
Requires-Dist: pyyaml>=4.0
|
|
56
54
|
Requires-Dist: scipy>=1.12
|
|
57
|
-
Requires-Dist: tqdm>=2.0
|
|
58
55
|
Requires-Dist: xarray>=2023
|
|
56
|
+
Requires-Dist: netcdf4>=1.0
|
|
57
|
+
Requires-Dist: pyyaml>=4.0
|
|
58
|
+
Requires-Dist: tqdm>=2.0
|
|
59
|
+
Requires-Dist: utm>=0.5
|
|
59
60
|
Provides-Extra: opt
|
|
60
|
-
Requires-Dist: foxes-opt>=0.
|
|
61
|
+
Requires-Dist: foxes-opt>=0.6; extra == "opt"
|
|
61
62
|
Provides-Extra: dask
|
|
62
63
|
Requires-Dist: dask>=2022.0; extra == "dask"
|
|
63
64
|
Requires-Dist: distributed>=2022.0; extra == "dask"
|
|
@@ -139,7 +140,7 @@ Evaluation Software"`
|
|
|
139
140
|
|
|
140
141
|
## Requirements
|
|
141
142
|
|
|
142
|
-
The supported Python versions are `Python 3.9`...`3.
|
|
143
|
+
The supported Python versions are `Python 3.9`...`3.14`.
|
|
143
144
|
|
|
144
145
|
## Installation
|
|
145
146
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import time
|
|
2
|
+
import argparse
|
|
3
|
+
import numpy as np
|
|
4
|
+
from xarray import Dataset
|
|
5
|
+
|
|
6
|
+
import foxes
|
|
7
|
+
import foxes.variables as FV
|
|
8
|
+
import foxes.constants as FC
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
parser = argparse.ArgumentParser()
|
|
12
|
+
parser.add_argument(
|
|
13
|
+
"-l",
|
|
14
|
+
"--layout",
|
|
15
|
+
help="The wind farm layout file (path or static)",
|
|
16
|
+
default="test_farm_67.csv",
|
|
17
|
+
)
|
|
18
|
+
parser.add_argument("-r", "--rotor", help="The rotor model", default="centre")
|
|
19
|
+
parser.add_argument(
|
|
20
|
+
"-p", "--pwakes", help="The partial wakes models", default=None, nargs="+"
|
|
21
|
+
)
|
|
22
|
+
parser.add_argument(
|
|
23
|
+
"-w",
|
|
24
|
+
"--wakes",
|
|
25
|
+
help="The wake models",
|
|
26
|
+
default=["Bastankhah2016_linear"],
|
|
27
|
+
nargs="+",
|
|
28
|
+
)
|
|
29
|
+
parser.add_argument(
|
|
30
|
+
"-m", "--tmodels", help="The turbine models", default=[], nargs="+"
|
|
31
|
+
)
|
|
32
|
+
parser.add_argument("-e", "--engine", help="The engine", default=None)
|
|
33
|
+
parser.add_argument(
|
|
34
|
+
"-n", "--n_cpus", help="The number of cpus", default=None, type=int
|
|
35
|
+
)
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"-c",
|
|
38
|
+
"--chunksize_states",
|
|
39
|
+
help="The chunk size for states",
|
|
40
|
+
default=None,
|
|
41
|
+
type=int,
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"-C",
|
|
45
|
+
"--chunksize_points",
|
|
46
|
+
help="The chunk size for points",
|
|
47
|
+
default=None,
|
|
48
|
+
type=int,
|
|
49
|
+
)
|
|
50
|
+
parser.add_argument(
|
|
51
|
+
"-nf", "--nofig", help="Do not show figures", action="store_true"
|
|
52
|
+
)
|
|
53
|
+
args = parser.parse_args()
|
|
54
|
+
|
|
55
|
+
states = foxes.input.states.Timeseries(
|
|
56
|
+
data_source="timeseries_3000.csv.gz",
|
|
57
|
+
output_vars=[FV.WS, FV.WD, FV.TI, FV.RHO],
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
farm = foxes.WindFarm()
|
|
61
|
+
foxes.input.farm_layout.add_grid(
|
|
62
|
+
farm,
|
|
63
|
+
xy_base=np.array([500.0, 500.0]),
|
|
64
|
+
step_vectors=np.array([[500.0, 0], [0, 700.0]]),
|
|
65
|
+
steps=(5, 5),
|
|
66
|
+
turbine_models=args.tmodels + ["NREL5MW"],
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
k_values = np.linspace(0.01, 0.1, 10)
|
|
70
|
+
n_pop = len(k_values)
|
|
71
|
+
pop_data = np.zeros((n_pop, farm.n_turbines))
|
|
72
|
+
pop_data[:] = k_values[:, None]
|
|
73
|
+
pop_data = Dataset(
|
|
74
|
+
{
|
|
75
|
+
FV.K: (("i", FC.TURBINE), pop_data),
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
print("\nInput population data:\n\n", pop_data)
|
|
79
|
+
print(f"\n{FV.K} values: {pop_data[FV.K].values[:, 0]}\n")
|
|
80
|
+
|
|
81
|
+
algo = foxes.algorithms.Downwind(
|
|
82
|
+
farm,
|
|
83
|
+
states,
|
|
84
|
+
wake_models=args.wakes,
|
|
85
|
+
rotor_model=args.rotor,
|
|
86
|
+
wake_frame="rotor_wd",
|
|
87
|
+
partial_wakes=args.pwakes,
|
|
88
|
+
population_params=dict(
|
|
89
|
+
data_source=pop_data,
|
|
90
|
+
index_coord="i",
|
|
91
|
+
turbine_coord=FC.TURBINE,
|
|
92
|
+
),
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
with foxes.Engine.new(
|
|
96
|
+
engine_type=args.engine,
|
|
97
|
+
n_procs=args.n_cpus,
|
|
98
|
+
chunk_size_states=args.chunksize_states,
|
|
99
|
+
chunk_size_points=args.chunksize_points,
|
|
100
|
+
):
|
|
101
|
+
time0 = time.time()
|
|
102
|
+
farm_results = algo.calc_farm()
|
|
103
|
+
time1 = time.time()
|
|
104
|
+
print("Calc time =", time1 - time0, "\n")
|
|
105
|
+
|
|
106
|
+
pop_results = algo.population_model.farm2pop_results(algo, farm_results)
|
|
107
|
+
print("\nPopulation results:\n\n", pop_results)
|
|
108
|
+
print(f"\n{FV.K} values: {pop_results[FV.K].values[:, 0, 0]}")
|
|
109
|
+
|
|
110
|
+
P_mean = (
|
|
111
|
+
(pop_results[FV.P] * pop_results[FV.WEIGHT])
|
|
112
|
+
.sum(dim=FC.STATE)
|
|
113
|
+
.sum(dim=FC.TURBINE)
|
|
114
|
+
)
|
|
115
|
+
print("\nFarm P_mean:", P_mean.values)
|
|
@@ -153,7 +153,6 @@ if __name__ == "__main__":
|
|
|
153
153
|
]
|
|
154
154
|
|
|
155
155
|
# run calculation with power mask:
|
|
156
|
-
|
|
157
156
|
farm_results = algo.calc_farm(outputs=outputs)
|
|
158
157
|
|
|
159
158
|
fr = farm_results.to_dataframe()
|
|
@@ -167,10 +166,9 @@ if __name__ == "__main__":
|
|
|
167
166
|
o1 = foxes.output.StateTurbineMap(farm_results)
|
|
168
167
|
|
|
169
168
|
# run calculation without power mask:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
models.remove("PMask")
|
|
169
|
+
for t in farm.turbines:
|
|
170
|
+
t.models.remove("set_Pmax")
|
|
171
|
+
t.models.remove("PMask")
|
|
174
172
|
|
|
175
173
|
farm_results = algo.calc_farm(outputs=outputs)
|
|
176
174
|
|
|
@@ -186,7 +184,7 @@ if __name__ == "__main__":
|
|
|
186
184
|
o0 = foxes.output.StateTurbineMap(farm_results)
|
|
187
185
|
|
|
188
186
|
# show power:
|
|
189
|
-
fig, axs = plt.subplots(1, 3, figsize=(
|
|
187
|
+
fig, axs = plt.subplots(1, 3, figsize=(11, 5))
|
|
190
188
|
o0.plot_map(
|
|
191
189
|
FV.P,
|
|
192
190
|
ax=axs[0],
|
|
@@ -218,7 +216,7 @@ if __name__ == "__main__":
|
|
|
218
216
|
plt.close(fig)
|
|
219
217
|
|
|
220
218
|
# show ct:
|
|
221
|
-
fig, axs = plt.subplots(1, 3, figsize=(
|
|
219
|
+
fig, axs = plt.subplots(1, 3, figsize=(11, 5))
|
|
222
220
|
o0.plot_map(
|
|
223
221
|
FV.CT,
|
|
224
222
|
ax=axs[0],
|
|
@@ -131,7 +131,12 @@ if __name__ == "__main__":
|
|
|
131
131
|
print("\nHorizontal flow figure output:")
|
|
132
132
|
o = foxes.output.FlowPlots2D(algo, farm_results)
|
|
133
133
|
g = o.gen_states_fig_xy(
|
|
134
|
-
args.var,
|
|
134
|
+
args.var,
|
|
135
|
+
resolution=10,
|
|
136
|
+
xmin=-500,
|
|
137
|
+
xmax=3000,
|
|
138
|
+
rotor_color="red",
|
|
139
|
+
cmap="BuPu" if args.var == FV.WD else None,
|
|
135
140
|
)
|
|
136
141
|
fig = next(g)
|
|
137
142
|
plt.show()
|
|
@@ -149,6 +154,7 @@ if __name__ == "__main__":
|
|
|
149
154
|
zmin=0,
|
|
150
155
|
zmax=250,
|
|
151
156
|
rotor_color="red",
|
|
157
|
+
cmap="BuPu" if args.var == FV.WD else None,
|
|
152
158
|
verbosity=0,
|
|
153
159
|
)
|
|
154
160
|
fig = next(g)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import numpy as np
|
|
2
|
+
from xarray import Dataset
|
|
2
3
|
|
|
3
4
|
from foxes.core import Algorithm, FarmDataModelList, get_engine
|
|
4
5
|
from foxes.core import PointDataModel, PointDataModelList, FarmController
|
|
@@ -77,6 +78,7 @@ class Downwind(Algorithm):
|
|
|
77
78
|
ground_models=None,
|
|
78
79
|
farm_controller="basic_ctrl",
|
|
79
80
|
mbook=None,
|
|
81
|
+
population_params=None,
|
|
80
82
|
**kwargs,
|
|
81
83
|
):
|
|
82
84
|
"""
|
|
@@ -110,6 +112,9 @@ class Downwind(Algorithm):
|
|
|
110
112
|
looked up in the model book
|
|
111
113
|
mbook: foxes.ModelBook, optional
|
|
112
114
|
The model book
|
|
115
|
+
population_params: dict, optional
|
|
116
|
+
The population parameters. If provided, this will be
|
|
117
|
+
used to create the population model.
|
|
113
118
|
kwargs: dict, optional
|
|
114
119
|
Additional parameters for the base class
|
|
115
120
|
|
|
@@ -119,7 +124,22 @@ class Downwind(Algorithm):
|
|
|
119
124
|
|
|
120
125
|
super().__init__(mbook, farm, **kwargs)
|
|
121
126
|
|
|
122
|
-
self.
|
|
127
|
+
self._SETPOP = None
|
|
128
|
+
if population_params is None:
|
|
129
|
+
self.__states = states
|
|
130
|
+
else:
|
|
131
|
+
self._SETPOP = "set_pop_data"
|
|
132
|
+
assert self._SETPOP not in mbook.turbine_models, (
|
|
133
|
+
f"Algorithm '{self.name}': Model name '{self._SETPOP}' for population data model is reserved"
|
|
134
|
+
)
|
|
135
|
+
self._pop_model = self.get_model("PopulationModel")(**population_params)
|
|
136
|
+
mbook.turbine_models[self._SETPOP] = self._pop_model
|
|
137
|
+
self.__states = self.get_model("PopulationStates")(
|
|
138
|
+
states, n_pop=self._pop_model.n_pop
|
|
139
|
+
)
|
|
140
|
+
for t in self.farm.turbines:
|
|
141
|
+
if self._SETPOP not in t.models:
|
|
142
|
+
t.insert_model(0, self._SETPOP)
|
|
123
143
|
self.n_states = None
|
|
124
144
|
|
|
125
145
|
self.__rotor_model = self.mbook.rotor_models.get_item(rotor_model)
|
|
@@ -313,6 +333,72 @@ class Downwind(Algorithm):
|
|
|
313
333
|
"""
|
|
314
334
|
return self.__farm_controller
|
|
315
335
|
|
|
336
|
+
@property
|
|
337
|
+
def population_model(self):
|
|
338
|
+
"""
|
|
339
|
+
The population model
|
|
340
|
+
|
|
341
|
+
Returns
|
|
342
|
+
-------
|
|
343
|
+
m: foxes.core.PopulationModel
|
|
344
|
+
The population model, or None if not used
|
|
345
|
+
|
|
346
|
+
"""
|
|
347
|
+
if self._SETPOP is None:
|
|
348
|
+
return None
|
|
349
|
+
return self._pop_model
|
|
350
|
+
|
|
351
|
+
def select_population_member(self, pop_farm_results, pop_index):
|
|
352
|
+
"""
|
|
353
|
+
Select a specific population member from the population model results.
|
|
354
|
+
|
|
355
|
+
Parameters
|
|
356
|
+
----------
|
|
357
|
+
pop_farm_results: xarray.Dataset
|
|
358
|
+
The farm results including population index dimension
|
|
359
|
+
pop_index: int or numpy.ndarray
|
|
360
|
+
The population index to select. Either a single index
|
|
361
|
+
for all states, or an array of shape (n_states,)
|
|
362
|
+
|
|
363
|
+
Returns
|
|
364
|
+
-------
|
|
365
|
+
farm_results: xarray.Dataset
|
|
366
|
+
The farm results for the selected population member.
|
|
367
|
+
|
|
368
|
+
"""
|
|
369
|
+
if self._SETPOP is None:
|
|
370
|
+
raise ValueError(f"Algorithm '{self.name}': No population model defined")
|
|
371
|
+
ini = self.initialized
|
|
372
|
+
if ini:
|
|
373
|
+
self.finalize()
|
|
374
|
+
self.states = self.states.states
|
|
375
|
+
for t in self.farm.turbines:
|
|
376
|
+
if self._SETPOP in t.models:
|
|
377
|
+
del t.models[t.models.index(self._SETPOP)]
|
|
378
|
+
if ini:
|
|
379
|
+
self.initialize()
|
|
380
|
+
|
|
381
|
+
POP = self.population_model.index_coord
|
|
382
|
+
assert POP in pop_farm_results.sizes, (
|
|
383
|
+
f"Algorithm '{self.name}': Population index coordinate '{POP}' not found in provided farm results"
|
|
384
|
+
)
|
|
385
|
+
if isinstance(pop_index, np.ndarray):
|
|
386
|
+
return Dataset(
|
|
387
|
+
{
|
|
388
|
+
v: (
|
|
389
|
+
(FC.STATE, FC.TURBINE),
|
|
390
|
+
np.take_along_axis(d.values, pop_index[None, :, None], axis=0)[
|
|
391
|
+
0
|
|
392
|
+
],
|
|
393
|
+
)
|
|
394
|
+
if d.dims == (POP, FC.STATE, FC.TURBINE)
|
|
395
|
+
else d
|
|
396
|
+
for v, d in pop_farm_results.data_vars.items()
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
else:
|
|
400
|
+
return pop_farm_results.sel({POP: pop_index})
|
|
401
|
+
|
|
316
402
|
@classmethod
|
|
317
403
|
def get_model(cls, name):
|
|
318
404
|
"""
|
|
@@ -417,7 +503,7 @@ class Downwind(Algorithm):
|
|
|
417
503
|
"""
|
|
418
504
|
if not self.states.initialized:
|
|
419
505
|
self.states.initialize(self, self.verbosity)
|
|
420
|
-
|
|
506
|
+
self.n_states = self.states.size()
|
|
421
507
|
|
|
422
508
|
def sub_models(self):
|
|
423
509
|
"""
|
|
@@ -550,8 +636,9 @@ class Downwind(Algorithm):
|
|
|
550
636
|
self,
|
|
551
637
|
outputs=None,
|
|
552
638
|
calc_parameters={},
|
|
553
|
-
finalize=True,
|
|
554
639
|
ambient=False,
|
|
640
|
+
finalize=True,
|
|
641
|
+
clear_mem=False,
|
|
555
642
|
**kwargs,
|
|
556
643
|
):
|
|
557
644
|
"""
|
|
@@ -564,10 +651,12 @@ class Downwind(Algorithm):
|
|
|
564
651
|
Key: model name str, value: parameter dict
|
|
565
652
|
outputs: list of str, optional
|
|
566
653
|
The output variables, or None for defaults
|
|
567
|
-
finalize: bool
|
|
568
|
-
Flag for finalization after calculation
|
|
569
654
|
ambient: bool
|
|
570
655
|
Flag for ambient instead of waked calculation
|
|
656
|
+
finalize: bool
|
|
657
|
+
Flag for finalization after calculation
|
|
658
|
+
clear_mem: bool
|
|
659
|
+
Clear idata memory after starting the run
|
|
571
660
|
kwargs: dict, optional
|
|
572
661
|
Additional parameters for run_calculation
|
|
573
662
|
|
|
@@ -614,23 +703,25 @@ class Downwind(Algorithm):
|
|
|
614
703
|
model_data,
|
|
615
704
|
parameters=calc_pars,
|
|
616
705
|
outputs=outputs,
|
|
706
|
+
clear_mem=clear_mem,
|
|
617
707
|
**kwargs,
|
|
618
708
|
)
|
|
619
|
-
farm_results
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
709
|
+
if farm_results is not None:
|
|
710
|
+
farm_results[FC.TNAME] = ((FC.TURBINE,), self.farm.turbine_names)
|
|
711
|
+
for v in [FV.ORDER, FV.ORDER_SSEL, FV.ORDER_INV]:
|
|
712
|
+
if v in farm_results:
|
|
713
|
+
farm_results[v] = farm_results[v].astype(config.dtype_int)
|
|
623
714
|
del model_data
|
|
624
715
|
|
|
625
716
|
# finalize models:
|
|
626
|
-
if finalize:
|
|
717
|
+
if clear_mem or finalize:
|
|
627
718
|
self.print("\n")
|
|
628
719
|
mlist.finalize(self, self.verbosity - 1)
|
|
629
|
-
self.finalize()
|
|
720
|
+
self.finalize(clear_mem=clear_mem)
|
|
630
721
|
else:
|
|
631
722
|
self.del_model_data(mlist)
|
|
632
723
|
|
|
633
|
-
if ambient:
|
|
724
|
+
if ambient and farm_results:
|
|
634
725
|
dvars = [v for v in farm_results.data_vars.keys() if v in FV.var2amb]
|
|
635
726
|
farm_results = farm_results.drop_vars(dvars)
|
|
636
727
|
|
|
@@ -4,3 +4,6 @@ from .farm_wakes_calc import FarmWakesCalculation as FarmWakesCalculation
|
|
|
4
4
|
from .point_wakes_calc import PointWakesCalculation as PointWakesCalculation
|
|
5
5
|
from .init_farm_data import InitFarmData as InitFarmData
|
|
6
6
|
from .reorder_farm_output import ReorderFarmOutput as ReorderFarmOutput
|
|
7
|
+
|
|
8
|
+
from .population import PopulationStates as PopulationStates
|
|
9
|
+
from .population import PopulationModel as PopulationModel
|