围绕nrel solpos和spectrl2的python包装器

SolarUtils的Python项目详细描述


https://travis-ci.org/SunPower/SolarUtils.svg?branch=master

solarutils是一组围绕公共可用 NRELSOLPOSSPECTRL2C语言计算机 计算太阳位置和光谱分解的程序。请阅读 是NREL disclaimer and license。用法 这个软件意味着接受这些条款。

安装

使用pip安装 SolarUtils from the PyPI

pip install SolarUtils

您还可以从pypi下载源发行版或克隆存储库 使用pythondistutils

python setup.py install

要求

Solarutils对安装、测试和 要制作文档,您需要以下包装:

  • 努比
  • pytest
  • 斯芬克斯

用法

SOLPOS DocumentationSPECTRL2 Documentation 更多细节。

示例

>>> from solar_utils import *
>>> import pandas as pd
>>> location = [35.56836, -119.2022, -8.0]
>>> datetime = [2013, 6, 5, 12, 31, 0]
>>> weather = [1015.62055, 40.0]
>>> (angles, airmass) = solposAM(location, datetime, weather)
>>> zenith, azimuth = angles
>>> zenith
15.074043273925781
>>> azimuth
213.29042053222656]
>>> am, amp = airmass
>>> am
1.0352272987365723
>>> amp
1.0379053354263306]
>>> units = 1
>>> location = [33.65, -84.43, -5.0]
>>> datetime = [1999, 7, 22, 9, 45, 37]
>>> weather = [1006.0, 27.0]
>>> orientation = [33.65, 135.0]
>>> atmospheric_conditions = [1.14, 0.65, -1.0, 0.2, 1.36]
>>> albedo = [0.3, 0.7, 0.8, 1.3, 2.5, 4.0] + ([0.2] * 6)
>>> specdif, specdir, specetr, specglo, specx = spectrl2(
...     units, location, datetime, weather, orientation,
...     atmospheric_conditions, albedo
... )
>>> spec = pd.DataFrame(
...     {'DIF': specdif, 'DIR': specdir, 'ETR': specetr, 'GLO': specglo},
...     index=specx
... )
>>> f = spec.plot()
>>> f.set_title('Solar Spectrum Example')
>>> f.set_xlabel('Wavelength, $\lambda [\mu m]$')
>>> f.set_ylabel('Spectral Irradiance, $I_{\lambda} [W/m^2/\mu m]$')
>>> f.grid(True)
>>> f.figure.show()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaPax考试:从非标准Maven存储库解析Karaf特性存储库(XML文件)   java Spring启动Bean创建异常   java中将ArrayList转换为数组的方法   Android Studio的java Unity插件。   java在CheckStyle中从方法计数中排除getter和setter   HibernateJava。sql。SQLSyntaxErrorException:表/视图“序列”不存在   与命令行程序Java vs C通信   java WebView膨胀异常   java在O(n)java8流中寻找两个列表的交集   java使用Gradle运行单元测试时,最大堆大小在哪里设置?   ssl加载java应用程序(CXF)内的jks文件   CI:Jenkins Git:Simple Java项目:希望在特定时间在脚本上发送消息   java根据位置更改数字   java按数值排序字符串数组   macos java版本“1.6.0_65”是否与java 6模棱两可?   Cassandra中的java时间戳