Skip to content
Snippets Groups Projects
Select Git revision
  • 8ba7b9fdeff7ca28c97df4f6dc0683bf77e7b2c2
  • master default protected
  • Work_Gijs protected
3 results

CCD_I2C.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    aggregate_and_plot.py NaN GiB
    #!/usr/bin/env python3
    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("/mnt/workdir/inputs.txt", "r") as file:
            for line in file:
                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 = "/mnt/workdir/inspect.h5"
        join_inspect_ds(h5_paths, h5_output_path)
        plot_paths = plot_inspect_ds(h5_output_path, "/mnt/workdir", min_elevation=15)
    
        with open("/mnt/workdir/outputs.txt", "w") as file:
            file.write(str(Path(h5_output_path).absolute()) + "\n")
            for file_path in plot_paths:
                path = Path(file_path).absolute()
                file.write(str(path) + "\n")