Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def append_resampled_values(nc_cell, ds, slice_start, binning_functions):
:param binning_functions: list of numpy function names for binning
:return: end index of the slice
"""
df_cell = nc_cell.squeeze().to_dataframe()
df_cell = nc_cell.to_dataframe().reset_index().set_index('TIME')
# shift the index forward 30min to centre the bins on the hour
df_cell.index = df_cell.index + pd.Timedelta(minutes=30)

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ def test_all_rejected(self):
self.assertRaises(NoInputFilesError, velocity_hourly_aggregated, [BAD_FILE], 'NRSROT',
input_dir=TEST_ROOT, output_dir='/tmp')

def test_size1_dimensions(self):
input_files = [
'IMOS_ANMN-NRS_ADCP_LAT_LON_DIMS.nc',
'IMOS_ANMN-NRS_ADCP_SINGLE_TIMESTAMP.nc'
]
output_file, bad_files = velocity_hourly_aggregated(input_files, 'NRSROT',
input_dir=TEST_ROOT, output_dir='/tmp')

self.assertEqual(0, len(bad_files))


if __name__ == '__main__':
unittest.main()