Skip to content

Localized time index not working when using 'nrel_c' method #237

Closed
@anomam

Description

@anomam

Hi,

I'm not sure if that was already covered in an other issue (couldn't find it) or intentional in the code, but when using the function get_solarposition() with method='nrel_c', it doesn't seem to matter whether the time index is localized or not.
The function will assume that the time index is at 'UTC' no matter what. Which goes against what was described in http://pvlib-python.readthedocs.io/en/latest/timetimezones.html.

So I ended up converting my timezone to 'UTC' before calculation, and then back to local after the calculation

Example:
pvlib_loc = location.Location(latitude, longitude, tz='Etc/GMT+8')
localized_index = index.tz_localize('Etc/GMT+8')
utc_index = localized_index.tz_convert('UTC')
solarAngles = pvlib_loc.get_solarposition(utc_index, method='nrel_c')
solarAngles.index = localized_index

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions