From 35bd45f55f61e55904693242792a8b7cba64d91e Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Tue, 19 Nov 2024 07:12:08 -0600 Subject: [PATCH] Changes to convert the creation_timestamp and closing_timestamp HDF5 file Attribute types from string to integer --- .../print_values_for_file_transfer_metadata.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/print_values_for_file_transfer_metadata.py b/scripts/print_values_for_file_transfer_metadata.py index bd235cb..008d2d9 100755 --- a/scripts/print_values_for_file_transfer_metadata.py +++ b/scripts/print_values_for_file_transfer_metadata.py @@ -12,14 +12,24 @@ def main(filename): h5_file = HDF5RawDataFile(filename) + file_layout_version = h5_file.get_version() + #print(f'file_layout_verion {file_layout_version}') attr_name = "creation_timestamp" - attr_value = h5_file.get_attribute(attr_name) - print(f'{attr_name} {attr_value}') + if file_layout_version >= 6: + attr_value = h5_file.get_int_attribute(attr_name) + print(f'{attr_name} {attr_value}') + else: + attr_value = h5_file.get_attribute(attr_name) + print(f'{attr_name} {attr_value}') attr_name = "closing_timestamp" - attr_value = h5_file.get_attribute(attr_name) - print(f'{attr_name} {attr_value}') + if file_layout_version >= 6: + attr_value = h5_file.get_int_attribute(attr_name) + print(f'{attr_name} {attr_value}') + else: + attr_value = h5_file.get_attribute(attr_name) + print(f'{attr_name} {attr_value}') attr_name = "offline_data_stream" try: