atlite 0.3.0__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.
Files changed (61) hide show
  1. atlite/__init__.py +49 -0
  2. atlite/aggregate.py +29 -0
  3. atlite/convert.py +1190 -0
  4. atlite/csp.py +58 -0
  5. atlite/cutout.py +671 -0
  6. atlite/data.py +251 -0
  7. atlite/datasets/__init__.py +11 -0
  8. atlite/datasets/cordex.py +252 -0
  9. atlite/datasets/era5.py +449 -0
  10. atlite/datasets/gebco.py +87 -0
  11. atlite/datasets/ncep.py +333 -0
  12. atlite/datasets/sarah.py +244 -0
  13. atlite/gis.py +866 -0
  14. atlite/hydro.py +104 -0
  15. atlite/pv/__init__.py +6 -0
  16. atlite/pv/irradiation.py +257 -0
  17. atlite/pv/orientation.py +197 -0
  18. atlite/pv/solar_panel_model.py +85 -0
  19. atlite/pv/solar_position.py +121 -0
  20. atlite/resource.py +523 -0
  21. atlite/resources/cspinstallation/SAM_parabolic_trough.yaml +4175 -0
  22. atlite/resources/cspinstallation/SAM_solar_tower.yaml +4175 -0
  23. atlite/resources/cspinstallation/lossless_installation.yaml +31 -0
  24. atlite/resources/solarpanel/CSi.yaml +30 -0
  25. atlite/resources/solarpanel/CdTe.yaml +30 -0
  26. atlite/resources/solarpanel/KANENA.yaml +45 -0
  27. atlite/resources/windturbine/Bonus_B1000_1000kW.yaml +19 -0
  28. atlite/resources/windturbine/Enercon_E101_3000kW.yaml +19 -0
  29. atlite/resources/windturbine/Enercon_E126_7500kW.yaml +19 -0
  30. atlite/resources/windturbine/Enercon_E82_3000kW.yaml +19 -0
  31. atlite/resources/windturbine/NREL_ReferenceTurbine_2016CACost_10MW_offshore.yaml +19 -0
  32. atlite/resources/windturbine/NREL_ReferenceTurbine_2016CACost_6MW_offshore.yaml +19 -0
  33. atlite/resources/windturbine/NREL_ReferenceTurbine_2016CACost_8MW_offshore.yaml +19 -0
  34. atlite/resources/windturbine/NREL_ReferenceTurbine_2019ORCost_12MW_offshore.yaml +19 -0
  35. atlite/resources/windturbine/NREL_ReferenceTurbine_2019ORCost_15MW_offshore.yaml +19 -0
  36. atlite/resources/windturbine/NREL_ReferenceTurbine_2020ATB_12MW_offshore.yaml +19 -0
  37. atlite/resources/windturbine/NREL_ReferenceTurbine_2020ATB_15MW_offshore.yaml +19 -0
  38. atlite/resources/windturbine/NREL_ReferenceTurbine_2020ATB_18MW_offshore.yaml +19 -0
  39. atlite/resources/windturbine/NREL_ReferenceTurbine_2020ATB_4MW.yaml +19 -0
  40. atlite/resources/windturbine/NREL_ReferenceTurbine_2020ATB_5.5MW.yaml +19 -0
  41. atlite/resources/windturbine/NREL_ReferenceTurbine_2020ATB_7MW.yaml +19 -0
  42. atlite/resources/windturbine/NREL_ReferenceTurbine_5MW_offshore.yaml +19 -0
  43. atlite/resources/windturbine/Siemens_SWT_107_3600kW.yaml +19 -0
  44. atlite/resources/windturbine/Siemens_SWT_2300kW.yaml +19 -0
  45. atlite/resources/windturbine/Suzlon_S82_1.5_MW.yaml +19 -0
  46. atlite/resources/windturbine/Vestas_V112_3MW.yaml +19 -0
  47. atlite/resources/windturbine/Vestas_V112_3MW_offshore.yaml +19 -0
  48. atlite/resources/windturbine/Vestas_V164_7MW_offshore.yaml +19 -0
  49. atlite/resources/windturbine/Vestas_V25_200kW.yaml +19 -0
  50. atlite/resources/windturbine/Vestas_V47_660kW.yaml +19 -0
  51. atlite/resources/windturbine/Vestas_V66_1750kW.yaml +19 -0
  52. atlite/resources/windturbine/Vestas_V80_2MW_gridstreamer.yaml +19 -0
  53. atlite/resources/windturbine/Vestas_V90_3MW.yaml +19 -0
  54. atlite/utils.py +138 -0
  55. atlite/wind.py +129 -0
  56. atlite-0.3.0.dist-info/AUTHORS.rst +46 -0
  57. atlite-0.3.0.dist-info/LICENSE +21 -0
  58. atlite-0.3.0.dist-info/METADATA +262 -0
  59. atlite-0.3.0.dist-info/RECORD +61 -0
  60. atlite-0.3.0.dist-info/WHEEL +5 -0
  61. atlite-0.3.0.dist-info/top_level.txt +1 -0
atlite/__init__.py ADDED
@@ -0,0 +1,49 @@
1
+ # SPDX-FileCopyrightText: Contributors to atlite <https://github.com/pypsa/atlite>
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ """
5
+ atlite helps you to convert weather data into energy systems model data.
6
+
7
+ atlite is a free software, xarray-based Python library for converting
8
+ weather data (like wind speeds) into energy systems data. It is designed
9
+ to by lightweight and work with big weather datasets while keeping the
10
+ resource requirements especially on CPU and RAM resources low.
11
+ """
12
+
13
+ __author__ = (
14
+ "Gorm Andresen, "
15
+ "Jonas Hoersch (FIAS/KIT/RLI), "
16
+ "Johannes Hampp (JLUG),"
17
+ "Fabian Hofmann (FIAS)"
18
+ "Tom Brown (FIAS/KIT), "
19
+ "Markus Schlott (FIAS), "
20
+ "David Schlachtberger (FIAS), "
21
+ )
22
+
23
+ __copyright__ = "Copyright Contributors to atlite"
24
+
25
+ import re
26
+ from importlib.metadata import version
27
+
28
+ from atlite.cutout import Cutout
29
+ from atlite.gis import ExclusionContainer, compute_indicatormatrix, regrid
30
+ from atlite.resource import cspinstallations, solarpanels, windturbines
31
+
32
+ # e.g. "0.17.1" or "0.17.1.dev4+ga3890dc0" (if installed from git)
33
+ __version__ = version("atlite")
34
+ # e.g. "0.17.0" # TODO, in the network structure it should use the dev version
35
+ match = re.match(r"(\d+\.\d+(\.\d+)?)", __version__)
36
+ assert match, f"Could not determine release_version of pypsa: {__version__}"
37
+ release_version = match.group(0)
38
+ assert not __version__.startswith("0.0"), "Could not determine version of atlite."
39
+
40
+ __all__ = [
41
+ Cutout,
42
+ ExclusionContainer,
43
+ compute_indicatormatrix,
44
+ regrid,
45
+ cspinstallations,
46
+ solarpanels,
47
+ windturbines,
48
+ __version__,
49
+ ]
atlite/aggregate.py ADDED
@@ -0,0 +1,29 @@
1
+ # SPDX-FileCopyrightText: Contributors to atlite <https://github.com/pypsa/atlite>
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ """
5
+ Functions for aggregating results.
6
+ """
7
+
8
+ import dask
9
+ import xarray as xr
10
+
11
+
12
+ def aggregate_matrix(da, matrix, index):
13
+ if index.name is None:
14
+ index = index.rename("dim_0")
15
+ if isinstance(da.data, dask.array.core.Array):
16
+ da = da.stack(spatial=("y", "x"))
17
+ da = da.chunk(dict(spatial=-1))
18
+ return xr.apply_ufunc(
19
+ lambda da: da * matrix.T,
20
+ da,
21
+ input_core_dims=[["spatial"]],
22
+ output_core_dims=[[index.name]],
23
+ dask="parallelized",
24
+ output_dtypes=[da.dtype],
25
+ dask_gufunc_kwargs=dict(output_sizes={index.name: index.size}),
26
+ ).assign_coords(**{index.name: index})
27
+ else:
28
+ da = da.stack(spatial=("y", "x")).transpose("spatial", "time")
29
+ return xr.DataArray(matrix * da, [index, da.coords["time"]])