- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发安装在阿姆斯特丹的光伏系统。 PV系统代码如下。我使用使用 retrieve_sam
获得的代码中指定的逆变器和模块获得了良好的结果。
import pvlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS
from pandas.plotting import register_matplotlib_converters
from pvlib.modelchain import ModelChain
# Define location for the Netherlands
location = pvlib.location.Location(latitude=52.53, longitude=5.15, tz='UTC',
altitude=50, name='amsterdam')
#import the database
module_database = pvlib.pvsystem.retrieve_sam(name='SandiaMod')
inverter_database = pvlib.pvsystem.retrieve_sam(name='cecinverter')
module = module_database.Canadian_Solar_CS5P_220M___2009_
# module = module_database.DMEGC_Solar_320_M6_120BB_ (I want to add this module)
inverter = inverter_database.ABB__PVI_3_0_OUTD_S_US__208V_
temperature_model_parameters =
pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
modules_per_string = 10
inverter_per_string = 1
# Define a PV system characteristics
surface_tilt = 12.5
surface_azimuth = 180
system = pvlib.pvsystem.PVSystem(surface_tilt=surface_tilt,
surface_azimuth=surface_azimuth, albedo=0.25,
module=module, module_parameters=module,
temperature_model_parameters=temperature_model_parameters,
modules_per_string=modules_per_string,
inverter_per_string=inverter_per_string,
inverter=inverter,
inverter_parameters=inverter,
racking_model='open_rack')
# Define a weather file
def importPSMData():
df = pd.read_csv('/Users/laxmikantradkar/Desktop/PVLIB/solcast_data1.csv', delimiter=';')
# Rename the columns for input to PVLIB
df.rename(columns={'Dhi': 'dhi', 'Dni': 'dni', 'Ghi': 'ghi', 'AirTemp':
'temp_air', 'WindSpeed10m': 'wind_speed', }, inplace=True)
df.rename(columns={'Year': 'year', 'Month': 'month', 'Day': 'day', 'Hour':
'hour', 'Minute': 'minute'}, inplace=True)
df['dt'] = pd.to_datetime(df[['year', 'month', 'day', 'hour', 'minute']])
df.set_index(df['dt'], inplace=True)
# Rename data parameters to run to datetime
# df.rename(columns={'PeriodEnd': 'period_end'}, inplace=True)
# Drop unnecessary columns
df = df.drop('PeriodStart', 1)
df = df.drop('Period', 1)
df = df.drop('Azimuth', 1)
df = df.drop('CloudOpacity', 1)
df = df.drop('DewpointTemp', 1)
df = df.drop('Ebh', 1)
df = df.drop('PrecipitableWater', 1)
df = df.drop('SnowDepth', 1)
df = df.drop('SurfacePressure', 1)
df = df.drop('WindDirection10m', 1)
df = df.drop('Zenith', 1)
return df
mc = ModelChain(system=system, location=location)
weatherData = importPSMData()
mc.run_model(weather=weatherData)
ac_energy = mc.ac
# ac_energy.to_csv('/Users/laxmikantradkar/Desktop/ac_energy_netherlands.csv')
plt.plot(ac_energy)
plt.show()
现在我想更换库中不存在的模块和逆变器。谁能告诉我该怎么做吗?
是否可以访问库并手动添加逆变器和模块的行/列?如果是,图书馆位于哪里?
是../Desktop/PVLIB/venv/lib/python3.8/site-packages/pvlib/data/sam-library-sandia-modules-2015-6-30.csv
当我尝试更改上述路径中的模块/逆变器参数时,我收到错误,因为 DataFrame' 对象没有属性“模块名称”
我两天前开始使用 PVLIB_python,所以我对这门语言很陌生。我真的很感谢你的帮助。请随时纠正我。
最佳答案
I started working on PVLIB_python 2 days ago, so I am new to the language. I really appreciate your help. Feel free to correct me at any point.
欢迎来到社区!如果您还没有,我鼓励您深入研究 pvlib-python 文档,并通过使用文档中的示例继续学习 Python 基础知识。我鼓励您查看 pandas tutorials以及您可以找到的任何其他高评价的 pandas 学习 Material ,让您自己在 Python 中运行数据科学。
When I change try to change the module/inverter parameters from above path, I receive an error as DataFrame' object has no attribute 'Module name'
这是因为您要求的 DataFrame 表中不存在一列。不用担心,您可以制作自己的模块。
Now I want to change the module and inverter which is not present in the library. Could anyone please tell me how to do this? Is it possible to access the library and manually add the row/column of inverter and module? If yes, where is the library located?
无需更改库。您可以自己构建一个模块,因为它是 pandas 库中的一个系列。下面的示例展示了如何将模块输出为字典、更改几个参数并创建您自己的模块。
my_new_module = module.copy() # create your own copy of the module
print("Before:", my_new_module, sep="\n") # show module before
my_new_module["Notes"] = "This is how to change a field in the module. Do this for every field in the module."
my_new_module.name = "DMEGC_Solar_320_M6_120BB_" # rename the Series appropriately
print("\nAfter:", my_new_module, sep="\n") # show module after
然后您可以将“my_new_module”插入PVSystem:
system = pvlib.pvsystem.PVSystem(
surface_tilt=surface_tilt,
surface_azimuth=surface_azimuth,
albedo=0.25,
module=my_new_module, # HERE'S THE NEW MODULE!
module_parameters=module,
temperature_model_parameters=temperature_model_parameters,
modules_per_string=modules_per_string,
inverter_per_string=inverter_per_string,
inverter=inverter,
inverter_parameters=inverter,
racking_model='open_rack')
这里的困难部分是拥有您可以信任的正确系数。您可能会更轻松地使用 module_database = pvlib.pvsystem.retrieve_sam(name='CECMod')
并替换这些参数,因为它们可以更轻松地用模块规范表中的数据替换。
这对于逆变器也应该同样有效。
关于PVLIB:如何添加 CEC 和 SAM 库中不存在的模块和逆变器规范?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59708281/
我有一个安装了 OSMC 的 RPI2,我想执行一些 cec 命令来检查电视是开着还是关着。 问题是在执行任何命令 cec-client(除了 cec-client -h :))之后,OSMC 将不会
我读过这篇文章http://www.oracle.com/technetwork/issue-archive/2011/11-jan/o11java-195110.html 其中提到了实体控制边界和
我正在使用 Android 版本 4.4.4 的 PlugPC(计算棒),将其连接到电视的 HDMI 端口以控制电视上显示的内容。我的应用程序在启动时启动,控制屏幕。现在通过我的应用程序,我想控制电视
我知道 Chromecast 会随任何带有“Cast”图标的应用自动启动。这意味着我们可以在没有电视 Controller 的情况下直接使用手机或平板电脑来启动连接。HDMI-CEC与此有关。电视自动
谷歌最近宣布 Chromecast 现在支持 HDMI-CEC 控制。 https://plus.google.com/+LeonNicholls/posts/FyGeJavgmX3 我想在我的应用程
我在 raspberry pi 1 上运行 stretch。repo 中只有 libcec4 和 libcec4-dev 可用。 我从 github 中找到的简单代码基于旧版本的 libcec。 //
我在访问 this 上的 HDMI CEC 时遇到问题安卓加密狗。 我想打开电视并更改电视的输入源,但我做不到。 Android API 方法 我正在运行一个系统应用,我已经安顿好了 在 Andro
如何通过 adb shell 关闭 HDMI CEC 控制? 最佳答案 adb shell settings put global hdmi_control_enabled 0 关于Android 禁
我的 raspberry pi 上运行着 cec-client,我可以在索尼电视上的事件源 HDMI 1 - 4 之间切换: echo "tx 4F 82 10 00" | cec-client -s
我正在开发安装在阿姆斯特丹的光伏系统。 PV系统代码如下。我使用使用 retrieve_sam 获得的代码中指定的逆变器和模块获得了良好的结果。 import pvlib import pandas
我正在开发安装在阿姆斯特丹的光伏系统。 PV系统代码如下。我使用使用 retrieve_sam 获得的代码中指定的逆变器和模块获得了良好的结果。 import pvlib import pandas
我正在尝试通过网络打开我的电视,我正在尝试通过 Raspberry PI LibCec 模块来执行此操作。 当我运行 echo shell_exec("sudo echo 'on 0' | cec-c
我正在尝试将 HDMI-CEC 命令从电视机发送到我的 Android 手机(它们都支持 CEC 协议(protocol))。虽然我已经阅读了 CEC 规范,但问题是我不知道如何仅通过 HDMI 电缆
我正在发送 HDMI CEC 命令以启动和待机我的 LG LED 电视 2015 制造。该设备是基于 Amlogic S922x 的 SBC,运行 Android 9。开机命令有效,但待机命令无效。谁
我的总体计划是能够从我的树莓派发送 CEC 命令来执行诸如打开/关闭电视以及连接到电视的其他设备之类的操作。然后我将添加语音识别来发送这些命令......那是另一天。我已经阅读了 CEC,但从我收集到
我尝试为我的 Raspberry 编写一个脚本,以便在我的电视打开时打开继电器(在 gpio 上)。我想通过 HDMI 捕捉状态。 我可以使用 cec-client 从我的电视获取状态: echo p
首先,我有一个可行的解决方案,但它很容易失败。 我想从 Logitech Squeeze Center 打开我的放大器。 服务器在 192.168.0.30 上运行 玩家在 192.168.0.31
如我所见,Chromecast 支持 HDMI-CEC 来控制电视,例如 - 切换电视输入。但是我没有在文档中找到它是如何实现的。 SDK for Android 是否支持通过HDMI-CEC 控制电
我将运行 Raspbian 的 RPi B+ 通过 HDMI 连接到我的 LG 电视。我成功地编译并安装了 cec-client,我可以使用命令 echo "on 0"| 轻松打开电视。 cec-cl
我有一个 MK809,想发送一个 HDMI CEC 命令来打开/关闭该设备所连接的电视。有没有办法或库来发送 CEC 命令,因为我在任何地方都看不到任何记录? 最佳答案 “HDMI-CEC 是一种单线
我是一名优秀的程序员,十分优秀!