Comments (6)
I'm inclined to say that we should fix it, but I'm ok with removing it too. If I remember right, @Calama-Consulting is in favor of keeping it. A PR (with tests) is welcome.
from pvlib-python.
We'll keep using this issue to solve the timezone problem in this function.
The pyephem and NREL spa functions use UTC, so as long as Python, pandas, pytz, and dateutils can get the conversion right, DST should be ok there. test_solarposition.py
has several tests that use a Golden, CO Location
with a DST-allowing America/Denver
timezone.
See #41 for a summary of the tz issue.
from pvlib-python.
This code block causes problems.
# this code is needed to handle the new location.tz format string
try:
utc_offset = pytz.timezone(location.tz).utcoffset(
time[0]).total_seconds() / 3600.
except ValueError:
utc_offset = time.tzinfo.utcoffset(time[0]).total_seconds() / 3600.
pvl_logger.debug('utc_offset={}'.format(utc_offset))
It creates a fixed utc_offset
based the first element of the DatetimeIndex. utc_offset
should instead be an array so that it can handle a change from DST to non-DST. I wrote this so you can blame me!
To fix it, I suggest using pvlib.tools.localize
, and the hours
attribute of the returned object in place of UnivHr = DecHours + utc_offset - .5
.
I think this also removes the need for
Hour = time.hour
Minute = time.minute
Second = time.second
...
DecHours = Hour + Minute / float(60) + Second / float(3600)
from pvlib-python.
cc @uvchik.
from pvlib-python.
The Problem is, that I don't really understand the function and it is not well commented. I tried some thing but I didn't succeeded.
I think I won't be able to repair and test this function in an acceptable period. First I have to learn more about Pandas timestamps and how to work with pandas and time zones.
Shall we add another warning, that using this function is on one owns risk. Or does anyone have an idea how to fix an test it?
from pvlib-python.
Thanks for looking. I'll see if I can implement my thoughts above.
from pvlib-python.
Related Issues (20)
- Add new spectral factor models HOT 4
- Gallery examples of ModelChains for the DOE Solar Data Bounty Prize systems HOT 12
- AOI dependence for soiling losses HOT 3
- bug: datetime64[ns] and datetime64[s] HOT 3
- Name field of modelchain.results.dc_ohmic_losses is i_mp, which is not correct
- Add full ASTM G-173-03 tables HOT 9
- CECMod modules return ValueError when run ModelChain HOT 8
- Uncertainty about using timezone locale vs UTC in pandas timestamps for solar position HOT 2
- [BUG]: unused `xtol` argument in `ghi_from_poa_driesse_2023`
- Unable to benchmark functions in pvlib using asv HOT 2
- retire support for python 3.7 HOT 4
- Ambiguous descriptions of axis_azimuth and axis_tilt in pvlib.tracking.singleaxis() docs HOT 11
- Allow arbitrary IAM function in pvlib.iam.marion_diffuse, and possibly improve horizon integral computation. HOT 3
- Function to output exact time, in seconds or microseconds or nanoseconds if possible, of sun reaching specific elevation. HOT 3
- ImportError: cannot import name 'total_irrad' from 'pvlib.irradiance' (/usr/local/lib/python3.10/dist-packages/pvlib/irradiance.py) HOT 2
- Docs improvements tracker and ReadTheDocs warnings
- First Solar CEC modules are inferred to be CIGS instead of CdTe HOT 3
- Whether to consider supporting pv power generation in mountainous scenarios? The mountainous terrain can be an irregular triangular network or elevation point data. HOT 1
- v0.10.4 release planning HOT 3
- Single Diode Model error when low effective irradiance (pvlib==0.10.2) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pvlib-python.