Skip to content

Improve performance of solarposition.ephemeris #512

Closed
@cwhanse

Description

@cwhanse

solarposition.ephemeris returns results in dataframe with a localized time index, rather than UTC time. This results in slow performance because the dataframe is assembled from Series and np.arrays that are calculated using UTC time, requiring a timezone conversion.

To Reproduce
Change line 693 from
DFOut = pd.DataFrame(index=time)

to

DFOut = pd.DataFrame(index=time_utc)

to observe the speedup: roughly 23 sec calculation time for 500k timesteps with index=time, and <5 seconds for index=time_utc

  • pvlib.__version__: 0.5.2
  • pandas.__version__: 0.20.3

Recommend that solarposition.ephemeris return a dataframe indexed in UTC time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions