Overview: PV Workflows¶
This example provides an overview of the PV workflows implemented in RESKit.
Workflow:
- Import required packages
- Calculate capacity factors based on MERRA data
- Calculate capacity factors based on Sarah and ERA5 data
- Calculate capacity factors based on ERA5 data
In [1]:
Copied!
import reskit as rk
import pandas as pd
import reskit as rk
import pandas as pd
Openfield PV system based on MERRA data
In [2]:
Copied!
xds = rk.solar.openfield_pv_merra_ryberg2019(
placements=pd.read_csv(rk.TEST_DATA["module_placements.csv"]),
merra_path=rk.TEST_DATA["merra-like"],
global_solar_atlas_ghi_path=rk.TEST_DATA["gsa-ghi-like.tif"],
)
# Mean value and standard deviation of the capacity factor across all placements
xds["capacity_factor"].values.mean(), xds["capacity_factor"].values.std()
xds = rk.solar.openfield_pv_merra_ryberg2019(
placements=pd.read_csv(rk.TEST_DATA["module_placements.csv"]),
merra_path=rk.TEST_DATA["merra-like"],
global_solar_atlas_ghi_path=rk.TEST_DATA["gsa-ghi-like.tif"],
)
# Mean value and standard deviation of the capacity factor across all placements
xds["capacity_factor"].values.mean(), xds["capacity_factor"].values.std()
FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/solar/workflows/solar_workflow_manager.py:970 Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'N' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
DeprecationWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/workflow_manager.py:413 'nan' value for 'nodata_fallback' is deprecated and will be removed soon. Use np.nan instead.
FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/solar/workflows/solar_workflow_manager.py:970 Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'N' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
Out[2]:
(0.04185119102118096, 0.0983984561675463)
Openfield PV system based on Sarah and ERA5 data
In [3]:
Copied!
xds = rk.solar.openfield_pv_sarah_unvalidated(
placements=pd.read_csv(rk.TEST_DATA["module_placements.csv"]),
sarah_path=rk.TEST_DATA["sarah-like"],
era5_path=rk.TEST_DATA["era5-like"],
)
# Mean value and standard deviation of the capacity factor across all placements
xds["capacity_factor"].values.mean(), xds["capacity_factor"].values.std()
xds = rk.solar.openfield_pv_sarah_unvalidated(
placements=pd.read_csv(rk.TEST_DATA["module_placements.csv"]),
sarah_path=rk.TEST_DATA["sarah-like"],
era5_path=rk.TEST_DATA["era5-like"],
)
# Mean value and standard deviation of the capacity factor across all placements
xds["capacity_factor"].values.mean(), xds["capacity_factor"].values.std()
FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/solar/workflows/solar_workflow_manager.py:970 Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'N' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/weather/NCSource.py:258 ChainedAssignmentError: behaviour will change in pandas 3.0! You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy. A typical example is when you are setting values in a column of a DataFrame, like: df["col"][row_indexer] = value Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`. See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/solar/workflows/solar_workflow_manager.py:970 Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'N' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
Out[3]:
(0.14925653869063787, 0.25206165192398416)
Openfield PV system based ond ERA5 data
In [4]:
Copied!
xds = rk.solar.openfield_pv_era5(
placements=pd.read_csv(rk.TEST_DATA["module_placements.csv"]),
era5_path=rk.TEST_DATA["era5-like"],
global_solar_atlas_ghi_path=rk.TEST_DATA["gsa-ghi-like.tif"],
global_solar_atlas_dni_path=rk.TEST_DATA["gsa-dni-like.tif"],
)
# Mean value and standard deviation of the capacity factor across all placements
xds["capacity_factor"].values.mean(), xds["capacity_factor"].values.std()
xds = rk.solar.openfield_pv_era5(
placements=pd.read_csv(rk.TEST_DATA["module_placements.csv"]),
era5_path=rk.TEST_DATA["era5-like"],
global_solar_atlas_ghi_path=rk.TEST_DATA["gsa-ghi-like.tif"],
global_solar_atlas_dni_path=rk.TEST_DATA["gsa-dni-like.tif"],
)
# Mean value and standard deviation of the capacity factor across all placements
xds["capacity_factor"].values.mean(), xds["capacity_factor"].values.std()
FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/solar/workflows/solar_workflow_manager.py:970 Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'N' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/weather/NCSource.py:258 ChainedAssignmentError: behaviour will change in pandas 3.0! You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy. A typical example is when you are setting values in a column of a DataFrame, like: df["col"][row_indexer] = value Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`. See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
FutureWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/solar/workflows/solar_workflow_manager.py:970 Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'N' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
Out[4]:
(0.07993967759301125, 0.16248591266395318)