Skip to content

AllSky file and events stats

Thomas Vuillaume edited this page Oct 24, 2023 · 3 revisions

Stats

dec particle number of subdirs total number of events (approx) average per node
dec_931 GammaDiffuse 20 263340000 13167000.0
dec_3476 GammaDiffuse 20 264900000 13245000.0
dec_6676 GammaDiffuse 20 264120000 13206000.0
dec_min_413 GammaDiffuse 20 261420000 13071000.0
dec_2276 GammaDiffuse 19 648774000 34146000.0
dec_4822 GammaDiffuse 19 235353000 12387000.0
dec_931 Protons 20 58877000 2943850.0
dec_3476 Protons 20 87395000 4369750.0
dec_6676 Protons 20 58688000 2934400.0
dec_min_413 Protons 20 58590000 2929500.0
dec_2276 Protons 19 173458600 9129400.0
dec_4822 Protons 19 52535000 2765000.0

Code snippet to reproduce

import os

base_dir = "/fefs/aswg/data/mc/DL1/AllSky/20221215_v0.9.12_base_prod/TrainingDataset"
categories = [("GammaDiffuse", 3000), ("Protons", 350)]

print("dir | particle | number of subdirs | total number | average per nod")
print("--- | --- | --- | --- | ---")

for category, multiplier in categories:
    root_path = base_dir
    # root_path = os.path.join(base_dir, category)
    summary_table = []

    for dir_name in os.listdir(root_path):
        dir_path = os.path.join(root_path, dir_name, category)

        if os.path.isdir(dir_path):
            num_subdirs = 0
            total_files = 0

            for subdir_name in os.listdir(dir_path):
                subdir_path = os.path.join(dir_path, subdir_name)

                if os.path.isdir(subdir_path):
                    num_subdirs += 1
                    num_files_in_subdir = len(os.listdir(subdir_path))
                    total_files += num_files_in_subdir

            total_number = num_subdirs * total_files * multiplier
            summary_table.append((dir_name, category, num_subdirs, total_number))

    for row in summary_table:
        print(f"{row[0]} | {row[1]} | {row[2]} | {row[3]} | {row[3]/row[2]}")
Clone this wiki locally