Skip to content
Snippets Groups Projects
Select Git revision
  • cbb0c20f162e1a97a0977f4982253bf5e4ed4364
  • master default protected
  • zhang-master-patch-34807
  • add-single-element-interface
  • ast-919-readthedocs
  • ncp_fix
  • workaround-wsclean-issue-83
  • ast-645-add-beam-normalisation-mode-preapplied
  • ast-645-add-beam-normalisation-mode-jm
  • activate-oskar-pybindings
  • disable-element-beam-1
  • submodulesync
  • fix-eigen
  • ncp_check
  • random-fixes
  • lobes-se607-1
  • test-schaapcommon
  • just-testing
  • extend-add_beaminfo-script
  • extend-telescope-interface-to-support-dp3
  • lobes-investigation
  • v0.3.1
  • v0.3.0
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
28 results

load.h

Blame
  • Forked from ResearchAndDevelopment / EveryBeam
    Source project has a limited visibility.
    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")