pvdeg.pysam.pysam#

pvdeg.pysam.pysam(weather_df: ~pandas.DataFrame, meta: dict, pv_model: str, pv_model_default: str = None, config_files: dict[slice(<class 'str'>, <class 'str'>, None)] = None, results: list[str] = None, practical_pitch_tilt_considerations: bool = False) dict[source]#

Run SAM solar simulation.

Parameters:
  • weather_df (pd.DataFrame) – DataFrame of weather data. As returned by pvdeg.weather.get

  • meta (dict) – Dictionary of metadata for the weather data. As returned by pvdeg.weather.get

  • pv_model (str) –

    choose pySam photovoltaic system model. Some models are less thorough and run faster. pvwatts8 is ~50x faster than pvsamv1 but only calculates 46 parameters while pvsamv1 calculates 195.

    options: pvwatts8, pvsamv1

    Documentation Links - [pvwatts8](https://nrel-pysam.readthedocs.io/en/main/modules/Pvwattsv8.html) - [pvsamv1](https://nrel-pysam.readthedocs.io/en/main/modules/Pvsamv1.html)

  • pv_model_default (str) –

    pysam config for pv model. [Pysam Modules](https://nrel-pysam.readthedocs.io/en/main/ssc-modules.html)

    On the docs some modules have availabile defaults listed.

    For example: [Pvwattsv8](https://nrel-pysam.readthedocs.io/en/main/modules/Pvwattsv8.html) - “FuelCellCommercial” - “FuelCellSingleOwner” - “GenericPVWattsWindFuelCellBatteryHybridHostDeveloper” - “GenericPVWattsWindFuelCellBatteryHybridSingleOwner” - “PVWattsBatteryCommercial” - “PVWattsBatteryHostDeveloper” - “PVWattsBatteryResidential” - “PVWattsBatteryThirdParty” - “PVWattsWindBatteryHybridHostDeveloper” - “PVWattsWindBatteryHybridSingleOwner” - “PVWattsWindFuelCellBatteryHybridHostDeveloper” - “PVWattsWindFuelCellBatteryHybridSingleOwner” - “PVWattsAllEquityPartnershipFlip” - “PVWattsCommercial” - “PVWattsCommunitySolar” - “PVWattsHostDeveloper” - “PVWattsLCOECalculator” - “PVWattsLeveragedPartnershipFlip” - “PVWattsMerchantPlant” - “PVWattsNone” - “PVWattsResidential” - “PVWattsSaleLeaseback” - “PVWattsSingleOwner” - “PVWattsThirdParty”

    [Pvsamv1](https://nrel-pysam.readthedocs.io/en/main/modules/Pvsamv1.html) - “FlatPlatePVAllEquityPartnershipFlip” - “FlatPlatePVCommercial” - “FlatPlatePVHostDeveloper” - “FlatPlatePVLCOECalculator” - “FlatPlatePVLeveragedPartnershipFlip” - “FlatPlatePVMerchantPlant” - “FlatPlatePVNone” - “FlatPlatePVResidential” - “FlatPlatePVSaleLeaseback” - “FlatPlatePVSingleOwner” - “FlatPlatePVThirdParty” - “PVBatteryAllEquityPartnershipFlip” - “PVBatteryCommercial” - “PVBatteryHostDeveloper” - “PVBatteryLeveragedPartnershipFlip” - “PVBatteryMerchantPlant” - “PVBatteryResidential” - “PVBatterySaleLeaseback” - “PVBatterySingleOwner” - “PVBatteryThirdParty” - “PhotovoltaicWindBatteryHybridHostDeveloper” - “PhotovoltaicWindBatteryHybridSingleOwner”

  • grid_default (str) – pysam default config for grid model. [Grid Defaults](https://nrel-pysam.readthedocs.io/en/main/modules/Grid.html)

  • cashloan_default (str) – pysam default config for cashloan model. [Cashloan Defaults](https://nrel-pysam.readthedocs.io/en/main/modules/Cashloan.html) # noqa - “FlatPlatePVCommercial” - “FlatPlatePVResidential” - “PVBatteryCommercial” - “PVBatteryResidential” - “PVWattsBatteryCommercial” - “PVWattsBatteryResidential” - “PVWattsCommercial” - “PVWattsResidential”

  • utiltityrate_default (str) – pysam default config for utilityrate5 model. [Utilityrate5 Defaults](https://nrel-pysam.readthedocs.io/en/main/modules/Utilityrate5.html()) # noqa

  • config_files (dict) –

    SAM configuration files. A dictionary containing a mapping to filepaths.

    Keys must be ‘pv’, ‘grid’, ‘utilityrate’, ‘cashloan’. Each key should contain a value as a string representing the file path to a SAM config file. Cannot deal with the entire SAM config json.

    ``` files = {

    ’pv’ : ‘example/path/1/pv-file.json’ ‘grid’ : ‘example/path/1/grid-file.json’ ‘utilityrate’ : ‘example/path/1/utilityrate-file.json’ ‘cashloan’ : ‘example/path/1/cashloan-file.json’

  • results (list[str]) –

    list of strings corresponding to pysam outputs to return. Pysam models such as Pvwatts8 and Pvsamv1 return hundreds of results. So we can chose to take only the specified results while throwing away the others.

    To grab only ‘annual_energy’ and ‘ac’ from the model results.

    >>> results = ['annual_energy', 'ac']
    

    This may cause some undesired behavior with geospatial calculations if the lengths of the results within the list are different.

  • practical_pitch_tilt_considerations (bool) –

    Use inspire practical considerations to limit/override defined pitch and tilt from SAM configs.

    Calculates optimal GCR using pvdeg.utilities.optimal_gcr_pitch for fixed tilt bifacial systems. Imposes a minimum pitch of 3.8m and maximum pitch of 12m.

Returns:

pysam_res (dict) – dictionary of outputs. Keys are result name and value is the corresponding result. If results is not specified, the dictionary will contain every calculation from the model.