Skip to content

Commit

Permalink
Fix bug in tests whereby angles would fail depending on time of day, …
Browse files Browse the repository at this point in the history
…as `utcnow` was being used by tests.
  • Loading branch information
simonrp84 committed Aug 22, 2023
1 parent 5a7aae3 commit f916cb1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pycoxmunk/Tests/test_CM_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def create_test_scene(band_names, angle_names):
wvl_mock.central = band
scn[band] = xr.DataArray(da.from_array(np.zeros((10, 10))),
coords={'y': np.zeros(10), 'x': np.zeros(10)},
attrs={'start_time': datetime.utcnow(),
attrs={'start_time': datetime(2022, 6, 15, 6, 20, 12),
'area': targ_area,
'wavelength': wvl_mock,
'orbital_parameters': orb_par})
Expand All @@ -60,22 +60,22 @@ def create_test_scene(band_names, angle_names):
np.random.seed(1024)
scn['solar_zenith_angle'] = xr.DataArray(da.from_array(np.linspace(0, 89, 100).reshape((10, 10))),
coords={'y': np.zeros(10), 'x': np.zeros(10)},
attrs={'start_time': datetime.utcnow()})
attrs={'start_time': datetime(2022, 6, 15, 6, 20, 12)})
if 'saa' in angle_names.keys():
np.random.seed(2048)
scn['solar_azimuth_angle'] = xr.DataArray(da.from_array(np.linspace(0, 360, 100).reshape((10, 10))),
coords={'y': np.zeros(10), 'x': np.zeros(10)},
attrs={'start_time': datetime.utcnow()})
attrs={'start_time': datetime(2022, 6, 15, 6, 20, 12)})
if 'vza' in angle_names.keys():
np.random.seed(4096)
scn['satellite_zenith_angle'] = xr.DataArray(da.from_array(np.linspace(0, 89, 100).reshape((10, 10))),
coords={'y': np.zeros(10), 'x': np.zeros(10)},
attrs={'start_time': datetime.utcnow()})
attrs={'start_time': datetime(2022, 6, 15, 6, 20, 12)})
if 'vaa' in angle_names.keys():
np.random.seed(8192)
scn['satellite_azimuth_angle'] = xr.DataArray(da.from_array(np.linspace(0, 360, 100).reshape((10, 10))),
coords={'y': np.zeros(10), 'x': np.zeros(10)},
attrs={'start_time': datetime.utcnow()})
attrs={'start_time': datetime(2022, 6, 15, 6, 20, 12)})
return scn

def setup_method(self):
Expand Down

0 comments on commit f916cb1

Please sign in to comment.