Add conversion from Solcast to SolarFarmer TSV weather format#13
Add conversion from Solcast to SolarFarmer TSV weather format#13
Conversation
| # 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() |
There was a problem hiding this comment.
not sure how this would go wrong in practice but median might be more robust
There was a problem hiding this comment.
Good suggestion. Perhaps, a wrong met dataset with duplicated timestamps due to daylight savings could lead to zero.
| 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]] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
No description provided.