<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Experimenting with shadow patterns and cell temperatures on a PV system
Pvmmxlsio was made for easy manual experimentation with different shadow patterns and temperature inputs on PVMismatch PV system models.
Importing necessary modules
Step1:  PVMismatch
Defining cell, module and PV system parameters
Step2:  Building a PV system in PVMismatch
Step3:  PVMismatch xls I/O
Creating a human-readable xls of the PV system layout with the PV cell indexes, irradiances and temperatures with pvmmxlsio.
Also calculating the PV system power with PVMismatch using the default 1000 W/m2 irradiance.
Step4:  Now let's change the Irradiance in the xls files and save them with a different name.
I have already done it, see ExcelLayoutFromPVMM_input_1-6.xlsx files.
The 3 yellow columns are the 3 PV strings we defined earlier.
Each cell in the xls file is a PV cell
Labels for PV modules (in the xls files)
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from pvmismatch.pvmismatch_lib import (pvcell, pvconstants, pvmodule,
                                       pvstring, pvsystem)
from pvmismatch.contrib import xlsio
Explanation: Experimenting with shadow patterns and cell temperatures on a PV system
Pvmmxlsio was made for easy manual experimentation with different shadow patterns and temperature inputs on PVMismatch PV system models.
Importing necessary modules
End of explanation
str_len = 6 # number of modules in a string
str_num = 3 # number of (parallel connected) strings in the array
v_bypass = np.float64(-0.5)  # [V] trigger voltage of bypass diode
cell_area = np.float64(246.49)  # [cm^2] cell area
Isc0_T0 = 9.68 # [A] reference short circuit current
ncols_per_substr=[2]*3 # 3 bypass diodes with 2 series connected cell-columns
nrows=10 # number of cell rows in the module
Explanation: PVMismatch
Defining cell, module and PV system parameters:
End of explanation
pv_mod_pattern = pvmodule.standard_cellpos_pat(nrows=nrows,
                                            ncols_per_substr=ncols_per_substr)
pv_mod = pvmodule.PVmodule(cell_pos=pv_mod_pattern, pvcells=None,
                           pvconst=None, Vbypass=v_bypass, cellArea=cell_area)
pv_cells = pv_mod.pvcells
for c in pv_cells:
    c.update(Isc0_T0 = Isc0_T0) # updating short circuit currents
pv_mod.setSuns(cells=list(range(0, len(pv_cells))), Ee=[1]*len(pv_cells))
pv_str = pvstring.PVstring(numberMods=str_len, pvmods=[pv_mod]*str_len)
pv_sys = pvsystem.PVsystem(numberStrs=str_num, pvstrs=[pv_str]*str_num,
                           numberMods=[str_len]*str_num,
                           pvmods=[pv_mod]*str_len)
Explanation: Building a PV system in PVMismatch:
End of explanation
output_xls_name=r'ExcelLayoutFromPVMM.xlsx' # the mod. & sys. layout in xls
xlsio.system_layout_to_xls(output_xls_name, pv_sys, write_bpd_act=False)
print('PV power with 1 suns: ', pv_sys.calcSystem()[2].max(), ' [W]')
plot = pv_sys.plotSys()
plt.show(block=False)
Explanation: PVMismatch xls I/O
Creating a human-readable xls of the PV system layout with the PV cell indexes, irradiances and temperatures with pvmmxlsio.
Also calculating the PV system power with PVMismatch using the default 1000 W/m2 irradiance.
End of explanation
for i in list(range(1,7)):
    input_xls_name=r'ExcelLayoutFromPVMM_input{}.xlsx'.format(i)
    xlsio.set_input_from_xls(input_xls_name, pv_sys, str_num, str_len)
    print('PV power with irradiances read in from {}: '.format(input_xls_name),
          pv_sys.calcSystem()[2].max(), ' [W]')
    # updating the input excel with the bypass diode activation
    xlsio.system_layout_to_xls(output_xls_name=input_xls_name, pv_sys=pv_sys,
                               write_bpd_act=True)
    pv_sys.plotSys()
    plt.show(block=False)
Explanation: Now let's change the Irradiance in the xls files and save them with a different name.
I have already done it, see ExcelLayoutFromPVMM_input_1-6.xlsx files.
The 3 yellow columns are the 3 PV strings we defined earlier.
Each cell in the xls file is a PV cell
Labels for PV modules (in the xls files):
Rows: m_cr, where m is the number of the given module within the string and cr is the cell row within the module
Columns: s_b_cc, where s is the number of the string in the PV system, b is the number of the bypass diode in the module and cc is the number of the PV cell column within a PV module substring. Therefore a cell with the labels "2_7" (m_cr) and "1_2_1" (s_b_cc) is a PV cell in the 8th cell row of the second column of the 3rd bypass diode of the 3rd module of the 2nd string (everything is zero-indexed).
Now we can read in the irradiance patterns we made and calculate the PV system power with PVMismatch:
End of explanation
<END_TASK>