Skip to content

Add conversion from Solcast to SolarFarmer TSV weather format#13

Open
javlor wants to merge 4 commits intomainfrom
feature/add-conversion-solcast-to-solarfarmerTSV
Open

Add conversion from Solcast to SolarFarmer TSV weather format#13
javlor wants to merge 4 commits intomainfrom
feature/add-conversion-solcast-to-solarfarmerTSV

Conversation

@javlor
Copy link
Copy Markdown
Collaborator

@javlor javlor commented Apr 21, 2026

No description provided.

Comment thread solarfarmer/weather.py
# Solcast timestamps are period_end; SolarFarmer expects period_beginning.
# Infer resolution from the minimum consecutive time difference.
time_deltas = out.index.to_series().diff().dropna()
inferred_timedelta = time_deltas.min()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how this would go wrong in practice but median might be more robust

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Perhaps, a wrong met dataset with duplicated timestamps due to daylight savings could lead to zero.

Comment thread solarfarmer/weather.py
out.index = out.index - inferred_timedelta

# Drop columns that have no SolarFarmer equivalent (e.g. gti, any other custom fields).
out = out[[c for c in out.columns if c in SOLCAST_COLUMN_MAP]]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if I add something to my data like "soiling" then I need to do it after calling this function? the documentation says "unmapped columns are unchanged"... is that contradictory or do I misunderstand?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well spotted. A mistake in the docs string. I had added the columns removal afterwards to avoid passing the weather_type or other unexpected variables. I will add soiling to column map, so that it is preserved if the soiling is added before hand.

Comment thread solarfarmer/weather.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants