diff --git a/aodntools/timeseries_products/aggregated_timeseries.py b/aodntools/timeseries_products/aggregated_timeseries.py index 87c38ed..c95de7c 100644 --- a/aodntools/timeseries_products/aggregated_timeseries.py +++ b/aodntools/timeseries_products/aggregated_timeseries.py @@ -288,8 +288,8 @@ def main_aggregator(files_to_agg, var_to_agg, site_code, input_dir='', output_di LATITUDE[index] = nc.LATITUDE.values LONGITUDE[index] = nc.LONGITUDE.values NOMINAL_DEPTH[index] = get_nominal_depth(nc) - source_file[index] = stringtochar(np.array(file, dtype='S256')) - instrument_id[index] = stringtochar(np.array(get_instrument_id(nc), dtype='S256')) + source_file[index] = stringtochar(np.array(file, dtype='S256'), encoding='ascii') + instrument_id[index] = stringtochar(np.array(get_instrument_id(nc), dtype='S256'), encoding='ascii') start = end diff --git a/aodntools/timeseries_products/velocity_aggregated_timeseries.py b/aodntools/timeseries_products/velocity_aggregated_timeseries.py index b5649ad..452fd23 100644 --- a/aodntools/timeseries_products/velocity_aggregated_timeseries.py +++ b/aodntools/timeseries_products/velocity_aggregated_timeseries.py @@ -168,8 +168,8 @@ def velocity_aggregated(files_to_agg, site_code, input_dir='', output_dir='./', LATITUDE[index] = nc.LATITUDE.values LONGITUDE[index] = nc.LONGITUDE.values NOMINAL_DEPTH[index] = utils.get_nominal_depth(nc) - source_file[index] = stringtochar(np.array(file, dtype='S256')) - instrument_id[index] = stringtochar(np.array(utils.get_instrument_id(nc), dtype='S256')) + source_file[index] = stringtochar(np.array(file, dtype='S256'), encoding='ascii') + instrument_id[index] = stringtochar(np.array(utils.get_instrument_id(nc), dtype='S256'), encoding='ascii') ## add time offset to the middle of the measuring window, if it exists if 'seconds_to_middle_of_measurement' in nc.TIME.attrs: SECONDS_TO_MIDDLE[index] = nc.TIME.seconds_to_middle_of_measurement diff --git a/aodntools/timeseries_products/velocity_hourly_timeseries.py b/aodntools/timeseries_products/velocity_hourly_timeseries.py index 9a7e491..f9da4f9 100644 --- a/aodntools/timeseries_products/velocity_hourly_timeseries.py +++ b/aodntools/timeseries_products/velocity_hourly_timeseries.py @@ -230,8 +230,8 @@ def velocity_hourly_aggregated(files_to_agg, site_code, input_dir='', output_dir LATITUDE[index] = nc.LATITUDE.values LONGITUDE[index] = nc.LONGITUDE.values NOMINAL_DEPTH[index] = np.array(utils.get_nominal_depth(nc)) - source_file[index] = stringtochar(np.array(file, dtype='S256')) - instrument_id[index] = stringtochar(np.array(utils.get_instrument_id(nc), dtype='S256')) + source_file[index] = stringtochar(np.array(file, dtype='S256'), encoding='ascii') + instrument_id[index] = stringtochar(np.array(utils.get_instrument_id(nc), dtype='S256'), encoding='ascii') ## add time offset to the middle of the measuring window, if it exists if 'seconds_to_middle_of_measurement' in nc.TIME.attrs: SECONDS_TO_MIDDLE[index] = nc.TIME.seconds_to_middle_of_measurement