<jupyter_start><jupyter_text>Read sample data<jupyter_code>data = pd.read_csv("NonAnnualSimulation-sample_data.csv")
data["Timestamp"] = pd.DatetimeIndex(pd.to_datetime(data["Timestamp"], utc=True))
data = data.set_index("Timestamp")
data.head()
weather_data = np.array([
    data.index.year,
    data.index.month,
    data.index.day,
    data.index.hour,
    data.index.minute,
    data['SRRL BMS Direct Normal Irradiance (W/m²_irr)'],
    data['SRRL BMS Diffuse Horizontal Irradiance (W/m²_irr)'],
    data['SRRL BMS Global Horizontal Irradiance (W/m²_irr)'],
    data["SRRL BMS Wind Speed at 19' (m/s)"],
    data['SRRL BMS Dry Bulb Temperature (°C)']
])<jupyter_output><empty_output><jupyter_text>Set model parameters<jupyter_code>sys_design = {
    "ModelParams": {
        "SystemDesign": {
            "array_type": 2.0,
            "azimuth": 180.0,
            "dc_ac_ratio": 1.08,
            "gcr": 0.592,
            "inv_eff": 97.5,
            "losses": 15.53,
            "module_type": 2.0,
            "system_capacity": 720,
            "tilt": 0.0
        },
        "SolarResource": {
        }
    },
    "Other": {
        "lat": 39.7442,
        "lon": -105.1778,
        "elev": 1829
    }
}
    
model_params = sys_design['ModelParams']
elev = sys_design['Other']['elev']
lat = sys_design['Other']['lat']
lon = sys_design['Other']['lon']
tz = data.index[0].utcoffset().total_seconds()/60/60<jupyter_output><empty_output><jupyter_text>Make predictions<jupyter_code>system_model = pvwatts.new()
system_model.assign(model_params)

solar_resource_data = {
        'tz': tz, # timezone
        'elev': elev, # elevation
        'lat': lat, # latitude
        'lon': lon, # longitude
        'year': tuple(weather_data[0]), # year
        'month': tuple(weather_data[1]), # month
        'day': tuple(weather_data[2]), # day
        'hour': tuple(weather_data[3]), # hour
        'minute': tuple(weather_data[4]), # minute
        'dn': tuple(weather_data[5]), # direct normal irradiance
        'df': tuple(weather_data[6]), # diffuse irradiance
        'gh': tuple(weather_data[7]), # global horizontal irradiance
        'wspd': tuple(weather_data[8]), # windspeed
        'tdry': tuple(weather_data[9]) # dry bulb temperature
        }

system_model.SolarResource.assign({'solar_resource_data': solar_resource_data})
system_model.AdjustmentFactors.assign({'constant': 0})

system_model.execute()
out = system_model.Outputs.export()

ac = np.array(out['ac']) / 1000
dc = np.array(out['dc']) / 1000

predictions = pd.DataFrame({"ac": ac, "dc": dc}, columns = ['ac','dc'])
predictions = predictions.set_index(data.index.copy())        
predictions['ac'].plot()
data['Energy (kW)'].plot()
plt.legend(["Predicted energy", "Actual energy"])
plt.ylabel("Energy (kW)")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16814788482047635, 'fraction_numerical': 0.024884464984002843, 'mean_word_length': 3.4245283018867925, 'pattern_counts': {'":': 18, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '147961', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1052, 'n_tokens_neox': 979, 'n_words': 173, 'path': 'Examples/NonAnnualSimulation.ipynb', 'repo_name': 'mike-welch/pysam', 'size': '2813'}