Skip to content

get_sun_rise_set_transit() results on wrong day #1631

Open
@mdeceglie

Description

@mdeceglie

Describe the bug
location.Location.get_sun_rise_set_transit() yields results that are time stamps on the wrong day

To Reproduce

import pvlib
import pandas as pd
loc = pvlib.location.Location(39.74, -105.17, tz='America/Denver')
times = pd.date_range('2023/01/01 00:00', '2023/01/02 12:00', freq='4H', tz='America/Denver')
result = loc.get_sun_rise_set_transit(times)

Expected behavior
sunrise, sunset, transit occur on the day of the timestamp in the timezone of times (or maybe loc? I'm not sure what the expected behavior should be when those don't match...)

Screenshots
Screen Shot 2023-01-09 at 9 40 29 AM

Versions:

  • pvlib.__version__: 0.9.4
  • pandas.__version__: 1.4.2
  • python: 3.9.12

Additional context
Seems related to #316. Thanks to @silverman for finding this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions