Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 7004973

Browse files
committed
Delete datamodule.py and datasets.py
1 parent 07db836 commit 7004973

File tree

4 files changed

+39
-578
lines changed

4 files changed

+39
-578
lines changed

nowcasting_dataset/data_sources/satellite/satellite_data_source.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@
1010
import xarray as xr
1111

1212
import nowcasting_dataset.time as nd_time
13+
from nowcasting_dataset.consts import SAT_VARIABLE_NAMES
1314
from nowcasting_dataset.data_sources.data_source import ZarrDataSource
1415
from nowcasting_dataset.data_sources.satellite.satellite_model import Satellite
1516
from nowcasting_dataset.dataset.xr_utils import join_list_data_array_to_batch_dataset
1617

1718
_LOG = logging.getLogger("nowcasting_dataset")
1819

1920

20-
from nowcasting_dataset.consts import SAT_VARIABLE_NAMES
21-
22-
2321
@dataclass
2422
class SatelliteDataSource(ZarrDataSource):
2523
"""
@@ -139,6 +137,43 @@ def datetime_index(self, remove_night: bool = True) -> pd.DatetimeIndex:
139137
140138
Args:
141139
remove_night: If True then remove datetimes at night.
140+
We're interested in forecasting solar power generation, so we
141+
don't care about nighttime data :)
142+
143+
In the UK in summer, the sun rises first in the north east, and
144+
sets last in the north west [1]. In summer, the north gets more
145+
hours of sunshine per day.
146+
147+
In the UK in winter, the sun rises first in the south east, and
148+
sets last in the south west [2]. In winter, the south gets more
149+
hours of sunshine per day.
150+
151+
| | Summer | Winter |
152+
| ---: | :---: | :---: |
153+
| Sun rises first in | N.E. | S.E. |
154+
| Sun sets last in | N.W. | S.W. |
155+
| Most hours of sunlight | North | South |
156+
157+
Before training, we select timesteps which have at least some
158+
sunlight. We do this by computing the clearsky global horizontal
159+
irradiance (GHI) for the four corners of the satellite imagery,
160+
and for all the timesteps in the dataset. We only use timesteps
161+
where the maximum global horizontal irradiance across all four
162+
corners is above some threshold.
163+
164+
The 'clearsky solar irradiance' is the amount of sunlight we'd
165+
expect on a clear day at a specific time and location. The SI unit
166+
of irradiance is watt per square meter. The 'global horizontal
167+
irradiance' (GHI) is the total sunlight that would hit a
168+
horizontal surface on the surface of the Earth. The GHI is the
169+
sum of the direct irradiance (sunlight which takes a direct path
170+
from the Sun to the Earth's surface) and the diffuse horizontal
171+
irradiance (the sunlight scattered from the atmosphere). For more
172+
info, see: https://en.wikipedia.org/wiki/Solar_irradiance
173+
174+
References:
175+
1. [Video of June 2019](https://www.youtube.com/watch?v=IOp-tj-IJpk)
176+
2. [Video of Jan 2019](https://www.youtube.com/watch?v=CJ4prUVa2nQ)
142177
"""
143178
if self._data is None:
144179
sat_data = self._open_data()

0 commit comments

Comments
 (0)