reskit.csp
==========

.. py:module:: reskit.csp


Submodules
----------

.. toctree::
   :maxdepth: 1

   /_readthedocs/reskit/csp/data/index
   /_readthedocs/reskit/csp/validation/index
   /_readthedocs/reskit/csp/workflows/index


Functions
---------

.. autoapisummary::

   reskit.csp.CSP_PTR_ERA5


Package Contents
----------------

.. py:function:: CSP_PTR_ERA5(placements, era5_path, global_solar_atlas_dni_path, global_solar_atlas_tamb_path=None, datasets=None, cost_year=2050, HTF_sel=['Heliosol', 'SolarSalt', 'Therminol'], elev_path=None, output_netcdf_path=None, output_variables=None, return_self=True, JITaccelerate=False, verbose=False, debug_vars=False, onlynightuse=True, fullvariation=False, _validation=False)

   This function is the overall workflow for the csp simulation and calls all subfunctions.
   It is a wrapper around the function "CSP_PTR_ERA5_specific_dataset" below, to include the case of multiple datasets.
   Multiple datasets are refering to multiple heat transfer fluids and therefore also different power plants. In that case, for each placement the optimal HTF is selected.

   :param placements: Locations where to perform simulations at.
                      Required columns: longitude, latitude, and one area column ("area_m2", "area", "aperture_area_m2", or "land_area_m2").
   :type placements: Pandas DataFrame
   :param era5_path: Path to ERA5 weather data or an NCSource object.
                     Required columns: "direct_horizontal_irradiance", "surface_wind_speed", "surface_air_temperature".
   :type era5_path: str or rk_weather.NCSource
   :param global_solar_atlas_dni_path:
                                       Long-term average DNI data for placements. Could be provided as:
                                           - str: Path to raster file with DNI data from Global Solar Atlas.
                                           - float: Constant DNI value for all placements.
                                           - np.ndarray: Array of DNI values, shape must match (placements,) or (time, placements).
   :type global_solar_atlas_dni_path: str or float or np.ndarray
   :param global_solar_atlas_tamb_path: path to temperature data from global solar atlas. Used for selecting at which placement which HTF is optimal.
   :type global_solar_atlas_tamb_path: str, optional
   :param datasetname: Name of the CSP technology dataset (e.g., "Heliosol", "SolarSalt").
                       Defaults to "Validation 10". See csp/data/CSP_database.xlsx for options.
   :type datasetname: str, optional
   :param cost_year: Year for cost calculation of the CSP plant.
                     Defaults to 2050.
   :type cost_year: int, optional
   :param HTF_sel: List of heat transfer fluids to consider for the simulation.
                   Each heat transfer fluid corresponds to a different CSP technology dataset.
                   Options: ["Heliosol", "SolarSalt", "Therminol"].
   :type HTF_sel: list of str, optional
   :param elev_path:
                     Elevation data for placements. Could be provided as:
                         - str: Path to raster file with elevation data.
                         - list: Elevation values for each placement.
   :type elev_path: str or list, optional
   :param output_netcdf_path: Path to a file that you want to save your output NETCDF file at.
                              Defaults to None.
   :type output_netcdf_path: str, optional
   :param output_variables: Output variables of the simulation that you want to save.
                            If None, includes all suitable variables from placements, workflow parameters, simulation data, and time index.
   :type output_variables: list of {str, number}, optional
   :param return_self: If True, returns the workflow manager object.
                       If False, returns the output as an XArray dataset.
                       Defaults to True.
   :type return_self: bool, optional
   :param JITaccelerate: If True, enables JIT acceleration for some calculations.
                         Defaults to False.
   :type JITaccelerate: bool, optional
   :param verbose: If True, prints progress information.
                   Defaults to False.
   :type verbose: bool, optional
   :param debug_vars: If True, retains intermediate variables for debugging.
                      Defaults to False.
   :type debug_vars: bool, optional
   :param onlynightuse: If True, optimizes plant size for night use only.
                        Defaults to True.
   :type onlynightuse: bool, optional
   :param fullvariation: If True, applies full variation in calculations.
                         Defaults to False.
   :type fullvariation: bool, optional
   :param _validation: If True, runs in validation mode (some input data may be replaced).
                       Defaults to False.
   :type _validation: bool, optional

   :returns: * *if return_self is True, the workflow manager object (PTRWorkflowManager) containing all simulation results and data.*
             * *if return_self is False, a xarray dataset containing the final simulation results. This dataset is optionally written to disk if output_netcdf_path was specified.* -- rest: see CSP_PTR_ERA5_specific_dataset


