简体   繁体   English

PVLib 预测未针对时区进行调整

[英]PVLib Forecast not adjusting for timezone

Background背景

I'm attempting to produce a forecast of solar power using PVLib.我正在尝试使用 PVLib 对太阳能进行预测。 I've followed all the instructions on the ReadTheDocs Page and am able to run through the query without issue and produce an output.我已按照ReadTheDocs页面上的所有说明进行操作,并且能够毫无问题地运行查询并生成 output。

Problem问题

I've specified the timezone 'Australia/Queensland' (+10), however when I look at the export of forecast data, it doesn't appear as if the GFS data has been adjusted for timezone.我已指定时区“澳大利亚/昆士兰”(+10),但是当我查看预测数据的导出时,似乎 GFS 数据并未针对时区进行调整。 The Air-Temp and short-wave flux fields in the raw data export still seem to be in UTC time.原始数据导出中的 Air-Temp 和短波通量字段似乎仍采用 UTC 时间。

Even when I run the 'process_data' class, the air-temp still appears to be incorrect.即使我运行“process_data”class,空气温度似乎仍然不正确。 The calculated irradiance fields (ghi, dni, dhi) appear to line up correctly with timezone, however since these are calculated fields based on cloud cover & solar position, I don't know if they actually used the right inputs.计算的辐照度字段(ghi、dni、dhi)似乎与时区正确对齐,但是由于这些是基于云层和太阳能 position 的计算字段,我不知道他们是否真的使用了正确的输入。

Requested Help请求帮助

Anyone know what the issue might be?有谁知道可能是什么问题? have I overlooked something, is this a mistake in PVLib, or do I need to adjust for timezone manually before running the process_data class?我是否忽略了什么,这是 PVLib 中的错误,还是在运行 process_data class 之前需要手动调整时区? I've attached my code below if that helps.如果有帮助,我在下面附上了我的代码。

# **********************************************************
# PACKAGES
# **********************************************************
import pandas as pd
from datetime import date

from pvlib.tracking import SingleAxisTracker
from pvlib.modelchain import ModelChain
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS
from pvlib.forecast import GFS

# **********************************************************
# INPUTS
# **********************************************************
latitude = -27.5
longitude = 153.00
tz = 'Australia/Queensland'
start = pd.Timestamp(date.today(), tz=tz)
end = start + pd.Timedelta(days=7)
dc_size = 110
ac_size = 100
module_parameters = {'pdc0': dc_size, 'gamma_pdc': -0.004}
inverter_parameters = {'pdc': ac_size, 'pdc0': dc_size, 'eta_inv_nom': dc_size / ac_size}
temperature_model_parameters = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']

# **********************************************************
# GFS
# **********************************************************
model = GFS(resolution='Quarter')
raw_data = model.get_data(latitude, longitude, start, end)
raw_data.to_csv('raw_gfs_data.csv')

data = model.get_processed_data(latitude, longitude, start, end)
data.to_csv('processed_gfs_data.csv')

# Resample data
resampled_data = data.resample('30min').interpolate()

# **********************************************************
# PV SYSTEM
# **********************************************************
# Define the specs for the PV System (horizontal axis tracking system)
t_system = SingleAxisTracker(
    axis_azimuth=90, axis_tilt=0, max_angle=180, backtrack=True, module='pvwatts_dc', inverter='pvwatts_ac',
    module_parameters=module_parameters,inverter_parameters=inverter_parameters, name='tracking', gcr=.40,
    temperature_model_parameters=temperature_model_parameters
)

# build model chain
mc = ModelChain(
    system=t_system, location=model.location, name='pvwatts', dc_model='pvwatts', ac_model='pvwatts', 
    aoi_model='physical', spectral_model='no_loss', temperature_model='sapm', losses_model='no_loss',
    transposition_model='perez'
)

# Run model, Export AC Power
mc.run_model(resampled_data)
ac = mc.ac
ac.to_csv('export_ac.csv')

The data returned by the thredds server is always in UTC, and pvlib makes no attempt to localize it based on the timezone of the input start or end parameters. thredds 服务器返回的数据始终采用 UTC,pvlib 不会尝试根据输入的 start 或 end 参数的时区对其进行本地化。 You can adjust the timezone of the raw or the processed data: data = data.tz_convert(tz)您可以调整原始数据或处理后数据的时区: data = data.tz_convert(tz)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM