reskit.solar
============

.. py:module:: reskit.solar


Submodules
----------

.. toctree::
   :maxdepth: 1

   /_readthedocs/reskit/solar/core/index
   /_readthedocs/reskit/solar/workflows/index


Classes
-------

.. autoapisummary::

   reskit.solar.SolarWorkflowManager


Functions
---------

.. autoapisummary::

   reskit.solar.frank_correction_factors
   reskit.solar.location_to_tilt
   reskit.solar.openfield_pv_era5
   reskit.solar.openfield_pv_era5_unvalidated
   reskit.solar.openfield_pv_era5pure
   reskit.solar.openfield_pv_iconlam
   reskit.solar.openfield_pv_merra_ryberg2019
   reskit.solar.openfield_pv_sarah_unvalidated


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

.. py:function:: frank_correction_factors(ghi, dni_extra, times, solar_elevation)

   Applies the proposed transmissivity-based irradiance corrections to COSMO
   data based on Frank et al.

   TODO: Add citation to Frank!


.. py:function:: location_to_tilt(locs, convention='Ryberg2020', **kwargs)

   Simple system tilt estimator based off latitude and longitude coordinates


   :param locs: The locations at which to estimate system tilt angle
   :type locs: geokit.LocationSet or iterable of (lon,lat) pairs
   :param convention: The calculation method used to suggest system tilts
                      Options are:
                          * "Ryberg2020"
                          * A string consumable by 'eval'
                          - Can use the variable 'latitude'
                          - Ex. "latitude*0.76"
                          * A path to a raster file
   :type convention: str, optional
   :param kwargs: Only applies when `convention` is a path to a raster file
   :type kwargs: Optional keyword arguments to use in geokit.raster.interpolateValues(...).

   :returns: Suggested tilt angle at each of the provided `locs`.
             Has the same length as the number of `locs`.
   :rtype: np.ndarray

   .. rubric:: Notes

   "Ryberg2020"
       When `convention` equals "Ryberg2020", the following equation is followed:

       .. math:: 42.327719357601396 * arctan( 1.5 * abs(latitude) )

   .. [1] TODO: Cite future Ryberg2020 publication


.. py:class:: SolarWorkflowManager(placements)

   Bases: :py:obj:`reskit.workflow_manager.WorkflowManager`


   The WorkflowManager class assists with the construction of more specialized WorkflowManagers,
   such as the WindWorkflowManager or the SolarWorkflowManager. In addition to providing the
   general structure for simulation workflow management, the WorkflowManager also defines
   functionalities which should be common across all WorkflowManagers.

   This includes:
     - Basic initialization
     - Time domain management
     - Reading weather data
     - Adjusting variables by a long-run-average value
     - Applying simple loss factors
     - Saving the state of WorkflowManagers to XArray datasets, either in memory or on disc

   Initialization:
   ---------------

   WorkflowManager( placements )


   __init_(self, placements)

   Initialization of an instance of the generic SolarWorkflowManager class.

   :param placements: The locations that the simulation should be run for.
                      Columns must include "lon", "lat"
   :type placements: pandas Dataframe

   :rtype: SolarWorkflorManager


   .. py:attribute:: _time_sel_
      :value: None



   .. py:attribute:: _time_index_
      :value: None



   .. py:attribute:: module
      :value: None



   .. py:method:: estimate_tilt_from_latitude(convention)

      estimate_tilt_from_latitude(self, convention)

      Estimates the tilt of the solar panels based on the latitude of the placements of the instance.

      :param convention: The calculation method used to suggest system tilts.
                         Option 1 of convention is "Ryberg2020".
                         Option 2 of convention is a string consumable by 'eval'. This string can use the variable latitude.
                         For example "latitude*0.76".
                         Option 3 of convention is a path to a rasterfile.
                         To get more information check out reskit.solar.location_to_tilt for more information.
      :type convention: str, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object



   .. py:method:: estimate_azimuth_from_latitude()

      estimate_azimuth_from_latitude(self)

      Estimates the azimuth of the placements of the instance.
      For a positive latitude the azimuth is set to 180.
      For a negative latitude the azimuth is set to 0.

      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object



   .. py:method:: apply_elevation(elev, fallback_elev=0)

      apply_elevation(self)

      Adds an elevation (name: 'elev') column to the placements data frame.

      :param elev: If a string is given it must be a path to a rasterfile including the elevations.
                   If an iterable is given it has to include the elevations at each location and be
                   of equal length to self.placements dataframe.
                   If an integer is given, it will be applied to all locations equally.
      :type elev: str, int, iterable
      :param fallback_elev: The fallback value that will be used in case that elev is a raster path and the
                            extraction of the elevation from raster fails (applied only to no-data locations).
                            By default 0.
      :type fallback_elev: int, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object



   .. py:method:: determine_solar_position(lon_rounding=1, lat_rounding=1, elev_rounding=-2)

      determine_solar_position(self, lon_rounding=1, lat_rounding=1, elev_rounding=-2)

      Calculates azimuth and apparent zenith for each location using the pvlib function pvlib.solarposition.spa_python() [1].
      Adds azimuth and apparent zenit to the sim_data dictionary.


      :param lon_rounding: Decimal places that the longitude should be rounded to. Default is 1.
      :type lon_rounding: int, optional
      :param lat_rounding: Decimal places that the latitude should be rounded to. Default is 1.
      :type lat_rounding: int, optional
      :param elev_rounding: Decimal places that the elevation should be rounded to. Default is -2.
      :type elev_rounding: int, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object

      .. rubric:: Notes

      Required columns in the placements dataframe to use this functions are 'lon', 'lat' and 'elev'.
      Required data in the sim_data dictionary are 'surface_pressure' and 'surface_air_temperature'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.solarposition.spa_python.html

      [2] I. Reda and A. Andreas, Solar position algorithm for solar
          radiation applications. Solar Energy, vol. 76, no. 5, pp. 577-589, 2004.

      [3] I. Reda and A. Andreas, Corrigendum to Solar position algorithm for
          solar radiation applications. Solar Energy, vol. 81, no. 6, p. 838,
          2007.

      [4] USNO delta T:
          http://www.usno.navy.mil/USNO/earth-orientation/eo-products/long-term



   .. py:method:: filter_positive_solar_elevation()

      filter_positive_solar_elevation(self)

      Filters positive solar elevations so that future operations are only executed for time steps when the sun is above (or at least near-to) the horizon


      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'apparent_solar_zenith'.



   .. py:method:: determine_extra_terrestrial_irradiance(**kwargs)

      determine_extra_terrestrial_irradiance(self, **kwargs)

      Determines extra terrestrial irradiance using the pvlib.irradiance.get_extra_radiation() function [1].

      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.irradiance.get_extra_radiation.html

      [2]     M. Reno, C. Hansen, and J. Stein, “Global Horizontal Irradiance Clear Sky Models: Implementation and Analysis”, Sandia National Laboratories, SAND2012-2389, 2012.

      [3]     <http://solardat.uoregon.edu/SolarRadiationBasics.html>, Eqs. SR1 and SR2

      [4]     Partridge, G. W. and Platt, C. M. R. 1976. Radiative Processes in Meteorology and Climatology.

      [5]     Duffie, J. A. and Beckman, W. A. 1991. Solar Engineering of Thermal Processes, 2nd edn. J. Wiley and Sons, New York.

      [6]     ASCE, 2005. The ASCE Standardized Reference Evapotranspiration Equation, Environmental and Water Resources Institute of the American Civil Engineers, Ed. R. G. Allen et al.



   .. py:method:: determine_air_mass(model='kastenyoung1989')

      determine_air_mass(self, model='kastenyoung1989')

      Determines air mass using the pvlib function pvlib.atmosphere.get_relative_airmass() [1].


      :param model: default 'kastenyoung1989' [1]

                    'simple' - secant(apparent zenith angle) - Note that this gives -inf at zenith=90 [2]
                    'kasten1966' - See reference [2] - requires apparent sun zenith [2]
                    'youngirvine1967' - See reference [3] - requires true sun zenith [2]
                    'kastenyoung1989' - See reference [4] - requires apparent sun zenith [2]
                    'gueymard1993' - See reference [5] - requires apparent sun zenith [2]
                    'young1994' - See reference [6] - requires true sun zenith [2]
                    'pickering2002' - See reference [7] - requires apparent sun zenith [2]
      :type model: str, optional

      :rtype: Nothing is returned.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'apparent_solar_zenith'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.atmosphere.get_relative_airmass.html

      [2]     Fritz Kasten. “A New Table and Approximation Formula for the Relative Optical Air Mass”. Technical Report 136, Hanover, N.H.: U.S. Army Material Command, CRREL.

      [3]     A. T. Young and W. M. Irvine, “Multicolor Photoelectric Photometry of the Brighter Planets,” The Astronomical Journal, vol. 72, pp. 945-950, 1967.

      [4]     Fritz Kasten and Andrew Young. “Revised optical air mass tables and approximation formula”. Applied Optics 28:4735-4738

      [5]     C. Gueymard, “Critical analysis and performance assessment of clear sky solar irradiance models using theoretical and measured data,” Solar Energy, vol. 51, pp. 121-138, 1993.

      [6]     A. T. Young, “AIR-MASS AND REFRACTION,” Applied Optics, vol. 33, pp. 1108-1110, Feb 1994.

      [7]     Keith A. Pickering. “The Ancient Star Catalog”. DIO 12:1, 20,

      [8]     Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, “Global Horizontal Irradiance Clear Sky Models: Implementation and Analysis” Sandia Report, (2012).



   .. py:method:: apply_DIRINT_model(use_pressure=False, use_dew_temperature=False)

      apply_DIRINT_model(self, use_pressure=False, use_dew_temperature=False)

      Determines direct normal irradiance (DNI) using the pvlib.irradiance.dirint() function [1].


      :param use_pressure: Default: False
      :type use_pressure: boolian, optional
      :param use_dew_temperature: Default: False
      :type use_dew_temperature: boolian, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'global_horizontal_irradiance', 'surface_pressure',
      'surface_dew_temperature', 'apparent_solar_zenith', 'air_mass' and 'extra_terrestrial_irradiance'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.irradiance.dirint.html

      [2]     Perez, R., P. Ineichen, E. Maxwell, R. Seals and A. Zelenka, (1992). “Dynamic Global-to-Direct Irradiance Conversion Models”. ASHRAE Transactions-Research Series, pp. 354-369

      [3]     Maxwell, E. L., “A Quasi-Physical Model for Converting Hourly Global Horizontal to Direct Normal Insolation”, Technical Report No. SERI/TR-215-3087, Golden, CO: Solar Energy Research Institute, 1987.



   .. py:method:: diffuse_horizontal_irradiance_from_trigonometry()

      diffuse_horizontal_irradiance_from_trigonometry(self)

      Calculates the diffuse horizontal irradiance from global horizontal irradiance, direct normal irradiance and apparent zenith.

      [TODO: Add a simple equation such as the one given in 'direct_normal_irradiance_from_trigonometry']

      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'global_horizontal_irradiance', 'direct_normal_irradiance' and
      'apparent_solar_zenith'.



   .. py:method:: direct_normal_irradiance_from_trigonometry()

      direct_normal_irradiance_from_trigonometry(self):

      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required columns in the placements dataframe to use this functions are 'lon', 'lat' and 'elev'.
      Required data in the sim_data dictionary are 'direct_horizontal_irradiance' and 'apparent_solar_zenith'.

      Calculates the direct normal irradiance from the following equation:
          .. math:: dir_nor_irr = dir_hor_irr / cos( solar_zenith )

          Where:
          dir_nor_irr  -> The direct irradiance on the normal plane
          dir_hor_irr  -> The direct irradiance on the horizontal plane
          solar_zenith -> The solar zenith angle in radians



   .. py:method:: permit_single_axis_tracking(max_angle=90, backtrack=True, gcr=2.0 / 7.0)

      permit_single_axis_tracking(self, max_angle=90, backtrack=True, gcr=2.0 / 7.0)

      Permits single axis tracking in the simulation using the pvlib.tracking.singleaxis() function [1].


      :param max_angle: default 90
                        A value denoting the maximum rotation angle, in decimal degrees, of the one-axis tracker from its horizontal position
                        (horizontal if axis_tilt = 0). A max_angle of 90 degrees allows the tracker to rotate to a vertical position to point the
                        panel towards a horizon. max_angle of 180 degrees allows for full rotation [1].
      :type max_angle: float, optional
      :param backtrack: default True
                        Controls whether the tracker has the capability to “backtrack” to avoid row-to-row shading.
                        False denotes no backtrack capability. True denotes backtrack capability [1].
      :type backtrack: bool, optional
      :param gcr: default 2.0/7.0
                  A value denoting the ground coverage ratio of a tracker system which utilizes backtracking; i.e. the ratio between the
                  PV array surface area to total ground area. A tracker system with modules 2 meters wide, centered on the tracking axis,
                  with 6 meters between the tracking axes has a gcr of 2/6=0.333. If gcr is not provided, a gcr of 2/7 is default. gcr must be <=1 [1].
      :type gcr: float, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required columns in the placements dataframe to use this functions are 'lon', 'lat', 'elev', 'tilt' and 'azimuth'.
      Required data in the sim_data dictionary are 'apparent_solar_zenith' and 'solar_azimuth'.

      .. rubric:: References

      [1] https://wholmgren-pvlib-python-new.readthedocs.io/en/doc-reorg2/generated/tracking/pvlib.tracking.singleaxis.html

      [2]     Lorenzo, E et al., 2011, “Tracking and back-tracking”, Prog. in Photovoltaics: Research and Applications, v. 19, pp. 747-753.



   .. py:method:: determine_angle_of_incidence()

      determine_angle_of_incidence(self)

      Determines the angle of incidence [TODO: credit the PVLib function as you've done in previous examples].

      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'apparent_solar_zenith' and 'solar_azimuth'.



   .. py:method:: estimate_plane_of_array_irradiances(transposition_model='perez', albedo=0.25, **kwargs)

      estimate_plane_of_array_irradiances(self, transposition_model="perez", albedo=0.25, **kwargs)

      Estimates the plane of array irradiance using the pvlib.irradiance.get_total_irradiance() function [1].


      :param transportion_model: default "perez"
      :type transportion_model: str, optional
      :param albedo: default 0.25
                     Surface albedo [1].
      :type albedo: numeric, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'apparent_solar_zenith', 'solar_azimuth', 'direct_normal_irradiance',
      'global_horizontal_irradiance', 'diffuse_horizontal_irradiance', 'extra_terrestrial_irradiance' and 'air_mass'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.irradiance.get_total_irradiance.html



   .. py:method:: _fix_bad_plane_of_array_values()


   .. py:method:: cell_temperature_from_sapm(mounting='glass_open_rack')

      cell_temperature_from_sapm(self, mounting="glass_open_rack")

      Calculates the cell temperature based on the pvlib.temperature.sapm_cell() function [1].


      :param mounting: Options:
                       "glass_open_rack" [1]
                       "glass_close_roof" [1]
                       "polymer_open_rack" [1]
                       "polymer_insulated_back" [1]
      :type mounting: str

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'surface_wind_speed', 'surface_air_temperature' and 'poa_global'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.temperature.sapm_cell.html



   .. py:method:: apply_angle_of_incidence_losses_to_poa()

      apply_angle_of_incidence_losses_to_poa(self)

      Applies the angle of incidence losses to the plane-of-array irradiance using the pvlib.pvsystem.iam.physical() function [1].

      :param None:

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'poa_direct', 'poa_ground_diffuse' and 'poa_sky_diffuse'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.iam.physical.html



   .. py:method:: configure_cec_module(module='WINAICO WSx-240P6', tech_year=2050)

      configure_cec_module(self, module="WINAICO WSx-240P6")

      Configures CEC of a module based on the outputs of the pvlib.pvsystem.retrieve_sam() function [1].

      :param module:
                     Must be one of:
                         * A module found in the pvlib.pvsystem.retrieve_sam("CECMod") database
                         * "WINAICO WSx-240P6" -> Good for open-field applications
                         * "LG Electronics LG370Q1C-A5" -> Good for rooftop applications
                         * A dict containing a set of module parameters, including:
                             T_NOCT, A_c, N_s, I_sc_ref, V_oc_ref, I_mp_ref, V_mp_ref, alpha_sc,
                             beta_oc, a_ref, I_L_ref, I_o_ref, R_s, R_sh_ref, Adjust, gamma_r, PTC
      :type module: str or dict
      :param tech_year: If given in combination with the projected module str names "WINAICO WSx-240P6" or
                        "LG Electronics LG370Q1C-A5", the effifiency will be scaled linearly to the given
                        year. Must then be between year of market comparison in analysis (2019) and 2050.
                        Will be ignored when non-projected existing module names or specific parameters
                        are given, can then be None. By default 2050.
      :type tech_year: int, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.pvsystem.retrieve_sam.html



   .. py:method:: simulate_with_interpolated_single_diode_approximation(module='WINAICO WSx-240P6', tech_year=2050)

      simulate_with_interpolated_single_diode_approximation(self, module="WINAICO WSx-240P6")

      Does the simulation with an interpolated single diode approximation using the pvlib.pvsystem.calcparams_desoto() [1] function and the
      pvlib.pvsystem.singlediode() [2] function.


      :param module:
                     Must be one of:
                         * A module found in the pvlib.pvsystem.retrieve_sam("CECMod") database
                         * "WINAICO WSx-240P6" -> Good for open-field applications
                         * "LG Electronics LG370Q1C-A5" -> Good for rooftop applications
      :type module: str
      :param tech_year: If given in combination with the projected module str names "WINAICO WSx-240P6" or
                        "LG Electronics LG370Q1C-A5", the effifiency will be scaled linearly to the given
                        year. Must then be between year of market comparison in analysis (2019) and 2050.
                        Will be ignored when non-projected existing module names or specific parameters
                        are given, can then be None. By default 2050.
      :type tech_year: int, optional

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required columns in the placements dataframe to use this functions are 'lon', 'lat', 'elev', 'tilt' and 'azimuth'.
      Required data in the sim_data dictionary are 'poa_global' and 'cell_temperature'.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.pvsystem.calcparams_desoto.html

      [2] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.pvsystem.singlediode.html

      [3]     (1, 2) W. De Soto et al., “Improvement and validation of a model for photovoltaic array performance”, Solar Energy, vol 80, pp. 78-88, 2006.

      [4]     System Advisor Model web page. https://sam.nrel.gov.

      [5]     A. Dobos, “An Improved Coefficient Calculator for the California Energy Commission 6 Parameter Photovoltaic Module Model”, Journal of Solar Energy Engineering, vol 134, 2012.

      [6]     O. Madelung, “Semiconductors: Data Handbook, 3rd ed.” ISBN 3-540-40488-0

      [7]     S.R. Wenham, M.A. Green, M.E. Watt, “Applied Photovoltaics” ISBN 0 86758 909 4

      [8]     A. Jain, A. Kapoor, “Exact analytical solutions of the parameters of real solar cells using Lambert W-function”, Solar Energy Materials and Solar Cells, 81 (2004) 269-277.

      [9]     D. King et al, “Sandia Photovoltaic Array Performance Model”, SAND2004-3535, Sandia National Laboratories, Albuquerque, NM

      [10]    “Computer simulation of the effects of electrical mismatches in photovoltaic cell interconnection circuits” JW Bishop, Solar Cell (1988) https://doi.org/10.1016/0379-6787(88)90059-2



   .. py:method:: apply_inverter_losses(inverter, method='sandia')

       apply_inverter_losses(self, inverter, method="sandia", )

       Applies inverter losses using the pvlib.pvsystem.snlinverter() function [1], the pvlib.pvsystem.retrieve_sam() function [2] and the
       pvlib.pvsystem.adrinverter() function [3].


      :param inverter: Describes the inverter.
                       [TODO: Add a more detailed description following the example of 'configure_cec_module']
      :type inverter: str
      :param method: Options:
                     "scandia"
                     "driesse"
                     Describes the used method to apply the inverter losses.
      :type method: str

      :rtype: Returns a reference to the invoking SolarWorkflowManager object.

      .. rubric:: Notes

      Required data in the sim_data dictionary are 'module_dc_power_at_mpp' and 'module_dc_voltage_at_mpp'.
      Required data in the placements dataframe are 'modules_per_string' and 'strings_per_inverter'.
      Cannot simultaneously provide 'capacity' and inverter-string parameters.

      .. rubric:: References

      [1] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.pvsystem.snlinverter.html

      [2] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.pvsystem.retrieve_sam.html

      [3] https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.pvsystem.adrinverter.html

      [4]     SAND2007-5036, “Performance Model for Grid-Connected Photovoltaic Inverters by D. King, S. Gonzalez, G. Galbraith, W. Boyson

      [5]     System Advisor Model web page. https://sam.nrel.gov.

      [6]     Beyond the Curves: Modeling the Electrical Efficiency of Photovoltaic Inverters, PVSC 2008, Anton Driesse et. al.



   .. py:method:: estimate_missing_params(elev, convention='Ryberg2020')


.. py:function:: openfield_pv_era5(placements, era5_path, global_solar_atlas_ghi_path, global_solar_atlas_dni_path, module='WINAICO WSx-240P6', elev=300, tracking='fixed', inverter=None, inverter_kwargs={}, tracking_args={}, DNI_nodata_fallback=1.0, DNI_nodata_fallback_scaling=1.0, GHI_nodata_fallback=1.0, GHI_nodata_fallback_scaling=1.0, output_netcdf_path=None, output_variables=None, gsa_nodata_fallback='source', tech_year=2050)

   Simulation of an openfield  PV openfield system based on ERA5 Data.

   :param placements: Locations that you want to do the simulations for.
                      Columns need to be lat (latitudes), lon (longitudes), tilt and capacity.
   :type placements: Pandas Dataframe
   :param era5_path: Path to the ERA5 Data on your computer.
                     Can be a single ".nc" file, or a directory containing many ".nc" files.
   :type era5_path: str
   :param global_solar_atlas_ghi_path: Path to the global solar atlas ghi data on your computer.
   :type global_solar_atlas_ghi_path: str
   :param global_solar_atlas_dni_path: Path to the global solar atlas dni data on your computer.
   :type global_solar_atlas_dni_path: str
   :param module: Name of the module that you wanna use for the simulation.
                  Default is Winaico Wsx-240P6
   :type module: str
   :param elev: Elevation that you want to model your PV system at.
   :type elev: float
   :param tracking: Determines whether your PV system is fixed or not.
                    Default is fixed.
                    Option 1 is 'fixed' meaning that the module does not have any tracking capabilities.
                    Option 2 is 'single_axis' meaning that the module has single_axis tracking capabilities.
   :type tracking: str
   :param inverter: Determines whether you want to model your PV system with an inverter or not.
                    Default is None.
                    See reskit.solar.SolarWorkflowManager.apply_inverter_losses for more usage information.
   :type inverter: str
   :param DNI_nodata_fallback: When global_solar_atlas_dni_path has no data, one can decide between different fallback options, by default 1.0:
                               - np.nan or None : return np.nan for missing values in global_solar_atlas_dni_path
                               - float : Apply this float value as a scaling factor for all no-data locations only: source_long_run_average * DNI_nodata_fallback.
                               NOTE: A value of 1.0 will return the source lra value in case of missing global_solar_atlas_dni_path values.
                               - str : Will be interpreted as a filepath to a raster with alternative absolute global_solar_atlas_dni_path values
                               - callable : any callable method taking the arguments (all iterables): 'locs' and 'source_long_run_average_value'
                               (the locations as gk.geom.point objects and original value from source data). The output values will be considered as
                               the new real_long_run_average for missing locations only.
                               NOTE: np.nan will also be returned in case that the nodata fallback does not yield values either.
   :type DNI_nodata_fallback: str, optional
   :param DNI_nodata_fallback_scaling: The scaling factor that will be applied to the DNI nodata fallback e.g. in case of different units compared to source data.
                                       By default 1.0, i.e. no effect.
   :type DNI_nodata_fallback_scaling: float, optional
   :param GHI_nodata_fallback: When global_solar_atlas_ghi_path has no data, one can decide between different fallback options, by default 1.0:
                               - np.nan or None : return np.nan for missing values in global_solar_atlas_ghi_path
                               - float : Apply this float value as a scaling factor for all no-data locations only: source_long_run_average * GHI_nodata_fallback.
                                   NOTE: A value of 1.0 will return the source lra value in case of missing global_solar_atlas_ghi_path values.
                               - str : Will be interpreted as a filepath to a raster with alternative absolute global_solar_atlas_ghi_path values
                               - callable : any callable method taking the arguments (all iterables): 'locs' and 'source_long_run_average_value'
                                   (the locations as gk.geom.point objects and original value from source data). The output values will be considered as
                                   the new real_long_run_average for missing locations only.
                               NOTE: np.nan will also be returned in case that the nodata fallback does not yield values either
   :type GHI_nodata_fallback: str, optional
   :param GHI_nodata_fallback_scaling: The scaling factor that will be applied to the GHI nodata fallback e.g. in case of different units compared to source data.
                                       By default 1.0, i.e. no effect.
   :type GHI_nodata_fallback_scaling: float, optional
   :param output_netcdf_path: Path to a file that you want to save your output NETCDF file at.
                              Default is None
   :type output_netcdf_path: str
   :param output_variables: Output variables of the simulation that you want to save into your NETCDF Outputfile.
   :type output_variables: str
   :param gsa_nodata_fallback: NOTE: DEPRECATED! Will be removed soon!
                               When real_long_run_average has no data, it can be decided between fallback options:
                               -'source': use source data (ERA5 raw simulation)
                               -'nan': return np.nan for missing values
                               get flags for missing values:
                               - f'missing_values_{os.path.basename(path_to_LRA_source)}
   :type gsa_nodata_fallback: str, optional
   :param tech_year: If given in combination with the projected module str names "WINAICO WSx-240P6" or
                     "LG Electronics LG370Q1C-A5", the effifiency will be scaled linearly to the given
                     year. Must then be between year of market introduction for that module and 2050.
                     Will be ignored when non-projected existing module names or specific parameters
                     are given, can then be None. By default 2050.
   :type tech_year: int, optional

   :rtype: A xarray dataset including all the output variables you defined as your output_variables.


.. py:function:: openfield_pv_era5_unvalidated(**kwargs)

   Simulation of an openfield  PV openfield system based on ERA5 Data,
   with unvalidated default loss factor of 0.107 based on literature.


.. py:function:: openfield_pv_era5pure(**kwargs)

   Simulation of an openfield  PV openfield system based on ERA5 original
   Data without further disaggregation.


.. py:function:: openfield_pv_iconlam(placements, icon_lam_path, module='WINAICO WSx-240P6', elev=300, tracking='fixed', inverter=None, inverter_kwargs={}, tracking_args={}, output_netcdf_path=None, output_variables=None, tech_year=2050)

   Simulation of an openfield  PV openfield system based on ICON-LAM Data.

   :param placements: Locations that you want to do the simulations for.
                      Columns need to be lat (latitudes), lon (longitudes), tilt and capacity.
   :type placements: Pandas Dataframe
   :param icon_lam_path: Path to the ICON-LAM Data on your computer.
                         Can be a single ".nc" file, or a directory containing many ".nc" files.
   :type icon_lam_path: str
   :param module: Name of the module that you wanna use for the simulation.
                  Default is Winaico Wsx-240P6
   :type module: str
   :param elev: Elevation that you want to model your PV system at.
                SChen: Or you can provide a string directory when a terrain raster can be found
   :type elev: float
   :param tracking: Determines whether your PV system is fixed or not.
                    Default is fixed.
                    Option 1 is 'fixed' meaning that the module does not have any tracking capabilities.
                    Option 2 is 'single_axis' meaning that the module has single_axis tracking capabilities.
   :type tracking: str
   :param inverter: Determines whether you want to model your PV system with an inverter or not.
                    Default is None.
                    See reskit.solar.SolarWorkflowManager.apply_inverter_losses for more usage information.
   :type inverter: str
   :param output_netcdf_path: Path to a file that you want to save your output NETCDF file at.
                              Default is None
   :type output_netcdf_path: str
   :param output_variables: Output variables of the simulation that you want to save into your NETCDF Outputfile.
   :type output_variables: str
   :param tech_year: If given in combination with the projected module str names "WINAICO WSx-240P6" or
                     "LG Electronics LG370Q1C-A5", the effifiency will be scaled linearly to the given
                     year. Must then be between year of market introduction for that module and 2050.
                     Will be ignored when non-projected existing module names or specific parameters
                     are given, can then be None. By default 2050.
   :type tech_year: int, optional

   :rtype: A xarray dataset including all the output variables you defined as your output_variables.


.. py:function:: openfield_pv_merra_ryberg2019(placements, merra_path, global_solar_atlas_ghi_path, module='WINAICO WSx-240P6', elev=300, tracking='fixed', inverter=None, inverter_kwargs={}, tracking_args={}, output_netcdf_path=None, output_variables=None, tech_year=2050)

   openfield_pv_merra_ryberg2019(placements, merra_path, global_solar_atlas_ghi_path, module="WINAICO WSx-240P6", elev=300, tracking="fixed",
                                   inverter=None, inverter_kwargs={}, tracking_args={}, output_netcdf_path=None, output_variables=None)

   Simulation of an openfield  PV openfield system based on MERRA Data.

   :param placements: Locations where to perform simulations at.
                      Columns need to be lat (latitudes), lon (longitudes), tilt and capacity.
   :type placements: Pandas Dataframe
   :param merra_path: Path to the MERRA Data on your computer.
                      Can be a single ".nc" file, or a directory containing many ".nc" files.
   :type merra_path: str
   :param global_solar_atlas_ghi_path: Path to the global solar atlas ghi data on your computer.
   :type global_solar_atlas_ghi_path: str
   :param module: Name of the module that you want to use for the simulation.
                  Default is Winaico Wsx-240P6.
                  See reskit.solar.SolarWorkflowManager.configure_cec_module for more usage information.
   :type module: str
   :param elev: Elevation that you want to model your PV system at.
   :type elev: float
   :param tracking: Option 1 is 'fixed' meaning that the module does not have any tracking capabilities.
                    Option 2 is 'single_axis' meaning that the module has single_axis tracking capabilities.
   :type tracking: str

   inverter: str
       Determines whether or not you want to model your PV system with an inverter.
       Default is None, meaning no inverter is assumed
       See reskit.solar.SolarWorkflowManager.apply_inverter_losses for more usage information

   output_netcdf_path: str
       Path to a file that you want to save your output NETCDF file at.
       Default is None

   output_variables: str
       Output variables of the simulation that you want to save into your NETCDF Outputfile.

   tech_year : int, optional
               If given in combination with the projected module str names "WINAICO WSx-240P6" or
               "LG Electronics LG370Q1C-A5", the effifiency will be scaled linearly to the given
               year. Must then be between year of market introduction for that module and 2050.
               Will be ignored when non-projected existing module names or specific parameters
               are given, can then be None. By default 2050.

   :rtype: A xarray dataset including all the output variables you defined as your output_variables.


.. py:function:: openfield_pv_sarah_unvalidated(placements, sarah_path, era5_path, module='WINAICO WSx-240P6', elev=300, tracking='fixed', inverter=None, inverter_kwargs={}, tracking_args={}, output_netcdf_path=None, output_variables=None, tech_year=2050)

   openfield_pv_sarah_unvalidated(placements, sarah_path, era5_path, module="WINAICO WSx-240P6", elev=300, tracking="fixed", inverter=None, inverter_kwargs={}, tracking_args={}, output_netcdf_path=None, output_variables=None)

   Simulation of an openfield  PV openfield system based on Sarah and ERA5 Data.

   :param placements: Locations that you want to do the simulations for.
                      Columns need to be lat (latitudes), lon (longitudes), tilt and capacity.
   :type placements: Pandas Dataframe
   :param sarah_path: Path to the SARAH Data on your computer.
                      Can be a single ".nc" file, or a directory containing many ".nc" files.
   :type sarah_path: str
   :param era5_path: Path to the ERA5 Data on your computer.
                     Can be a single ".nc" file, or a directory containing many ".nc" files.
   :type era5_path: str

   module: str
           Name of the module that you wanna use for the simulation.
           Default is Winaico Wsx-240P6

   elev: float
           Elevation that you want to model your PV system at.

   tracking: str
               Determines whether your PV system is fixed or not.
               Default is fixed.
               Option 1 is 'fixed' meaning that the module does not have any tracking capabilities.
               Option 2 is 'single_axis' meaning that the module has single_axis tracking capabilities.

   inverter: str
               Determines whether you want to model your PV system with an inverter or not.
               Default is None.
               See reskit.solar.SolarWorkflowManager.apply_inverter_losses for more usage information.

   output_netcdf_path: str
                       Path to a file that you want to save your output NETCDF file at.
                       Default is None

   output_variables: str
                       Output variables of the simulation that you want to save into your NETCDF Outputfile.

   tech_year : int, optional
               If given in combination with the projected module str names "WINAICO WSx-240P6" or
               "LG Electronics LG370Q1C-A5", the effifiency will be scaled linearly to the given
               year. Must then be between year of market introduction for that module and 2050.
               Will be ignored when non-projected existing module names or specific parameters
               are given, can then be None. By default 2050.

   :rtype: A xarray dataset including all the output variables you defined as your output_variables.


