AssessingSolar / AssessingSolar/solarpy
Intraday heatmap should support automatically adding sunrise/sunset lines
- Dominant language
- Python
- Stars
- 1
- Forks
- 2
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 1
Description
Currently, the sunrise/sunset lines need to be added separately which is a hassle.
I am imagining that two additional parameters can be added (``latitude``/``longitude``), which defaults to None (optional) and when they are both specified, then sunset/sunrise lines are added.
```python
fig, ax = plt.subplots(figsize=(6, 3))
_ = solarpy.plotting.plot_intraday_heatmap(
time=data.index,
values=data["ghi"],
cmap=cmap,
norm=norm,
colorbar_label="GHI [W/m²]",
ax=ax, # pass in existing axes
)
# Overlay sunrise and sunset times
sun_rise_set = pvlib.solarposition.sun_rise_set_transit_spa(
pd.date_range(data.index.min(), data.index.max(), freq="1d"),
meta["latitude"],
meta["longitude"],
)
sunrise = (
sun_rise_set["sunrise"] - sun_rise_set["sunrise"].index.normalize()
).dt.total_seconds() / 3600
sunset = (
sun_rise_set["sunset"] - sun_rise_set["sunset"].index.normalize()
).dt.total_seconds() / 3600
ax.plot(sunrise, c="r", linestyle="dashed", lw=1.5, alpha=0.7)
ax.plot(sunset, c="r", linestyle="dashed", lw=1.5, alpha=0.7)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the plot_intraday_heatmap entry point and inspect how its parameters and axes are handled. Add optional latitude and longitude inputs, then verify that supplying both produces sunrise and sunset lines while omitting either preserves the current plot behavior. Check the existing plotting tests or test suite to confirm the expected figure output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100