import h5py
import numpy as np

file_path = "catalog_triple.hdf5"

# Load datasets into this dictionary
data_dict_triple = {}

# Open and read HDF5 file
with h5py.File(file_path, "r") as f:
    for key in f.keys():
        print(key)
        data = f[key][:]
        dict_key = f"{key}"
        data_dict_triple[dict_key] = data

# Now data_dict holds all datasets as NumPy arrays with keys like 'AmpPN0_triple'

# Example: Access a specific dataset from data_dict
example_key = "AmpPN0"
if example_key in data_dict_triple:
    print(f"Data for '{example_key}':")
    print(data_dict_triple[example_key])
else:
    print(f"Key '{example_key}' not found in data_dict_triple.")
    

file_path = "catalog_binary.hdf5"

# Load datasets into this dictionary
data_dict_binary = {}

# Open and read HDF5 file
with h5py.File(file_path, "r") as f:
    for key in f.keys():
        print(key)
        data = f[key][:]
        dict_key = f"{key}"
        data_dict_binary[dict_key] = data

# Now data_dict holds all datasets as NumPy arrays with keys like 'AmpPN0_triple'

# Example: Access a specific dataset from data_dict
example_key = "AmpPN0"
if example_key in data_dict_binary:
    print(f"Data for '{example_key}':")
    print(data_dict_binary[example_key])
else:
    print(f"Key '{example_key}' not found in data_dict_binary.")
