围绕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第三方库


热门话题
java如何使用数据库中的值填充p:selectOneMenu   Java/Junit中的异步单元测试一个非常简单但不成功的例子   在Debian上使用Java连接到MySQL   java测试时如何恢复表中的一条记录/行?   java如何将重点放在jbutton上而不是放在另一个jbutton上?   java我可以从HPROF文件中获取JVM标志吗?   java如何使用自定义比较器在2个集合上保留   java让stringTokenizer将一行文本拆分为预定义变量的最佳方法是什么   Kotlin Android/Java字符串日期时间格式,API21   exchange server EWS Java Api自动发现不工作   netbeans是Java新手,似乎无法修复错误;应为类、接口或枚举。274062   我正在尝试将一些scala代码转换为Java8,以创建新的Lambda和并行集合   流中的分配api(java)   用于串行通信的java Python字节数组