Doc: add information about the fact that data type should be constant and existing workaround
workaroud: if a dataset is named 'data_cast' then will be picked. Here is a script that can be useful if users needs to cast a dataset:
import os
import numpy
import h5py
import shutil
data_path = "/4.1/instrument/pco2linux/data"
ouput_data_path = "/4.1/instrument/pco2linux/data_cast"
input_file_path = "/tmp_14_days/payno/test_ludo/Apple-LFOV-3p1um_High_Quality_2/Apple-LFOV-3p1um_High_Quality_2.h5"
output_cast_type = numpy.uint16
name, ext = os.path.splitext(os.path.basename(input_file_path))
output_file_path = os.path.join(
os.path.dirname(input_file_path),
f"{name}_cast{ext}",
)
shutil.copyfile(input_file_path, output_file_path)
with h5py.File(output_file_path, mode="a") as h5f:
dataset = h5f[data_path][()]
h5f[ouput_data_path] = dataset.astype(output_cast_type)
Edited by payno