Skip to content
Snippets Groups Projects
Commit edf24c7a authored by Timo Millenaar's avatar Timo Millenaar
Browse files

Mage aggregate_and_plot.py actually aggreagate .h5 files and plot the contents

parent 8a8ad383
No related branches found
No related tags found
1 merge request!12Add aggregate_and_plot.py that for now only prints the contents of input.txt
from lofar_quality.manipulate.common import join_inspect_ds
from lofar_quality.inspect.inspect_dataset import plot_inspect_ds
from pathlib import Path
import logging
FORMAT = '%(levelname)-15s %(asctime)s: %(message)s'
logging.basicConfig(format=FORMAT, level="INFO")
if __name__ == "__main__":
h5_paths = []
with open("inputs.txt", "r") as file: with open("inputs.txt", "r") as file:
for line in file: for line in file:
print(line) line = str(line.strip()) # remove white space
path = Path(line)
if path.exists():
if path.suffix.lower() == ".h5":
h5_paths.append(line)
else:
logging.info(f"File exists but is not an h5 file: {line}")
else:
logging.info(f"Could not find the following input file: {line}")
logging.info(f"Found {len(h5_paths)} h5 files")
h5_output_path = "inspect.h5"
join_inspect_ds(h5_paths, h5_output_path)
plot_inspect_ds(h5_output_path, "./", min_elevation=15)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment