Skip to content

Daylight saving timestamp issue in solarposition.ephemeris #307

Closed
@anomam

Description

@anomam

In solarposition.ephemeris:

    # make output DataFrame
    DFOut = pd.DataFrame(index=time)
    DFOut['apparent_elevation'] = ApparentSunEl
    DFOut['elevation'] = SunEl
    DFOut['azimuth'] = SunAz
    DFOut['apparent_zenith'] = 90 - ApparentSunEl
    DFOut['zenith'] = 90 - SunEl
    DFOut['solar_time'] = SolarTime

I get an error when assigning ApparentSunEl to the DFOut column:

ValueError: cannot reindex from a duplicate axis

and I believe the reason comes from the fact that DFOut uses time as index and ApparentSunEl uses time_utc as index; and I think it raises an error because in my case time uses daylight saving and contains duplicate indices. Using ApparentSunEl.values instead should solve the issue.

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