Skip to content

Instantly share code, notes, and snippets.

View vuillaut's full-sized avatar

Thomas Vuillaume vuillaut

View GitHub Profile
@vuillaut
vuillaut / magic_sens_crab_unit.py
Created July 13, 2022 14:08
MAGIC sensitivity in Crab unit
from ctaplot.ana.ana import get_magic_sensitivity
from pyirf.spectral import CRAB_MAGIC_JHEAP2015
def magic_sens_in_crab_unit():
magic_sens = get_magic_sensitivity()
energy = magic_sens['e_center']
crab = CRAB_MAGIC_JHEAP2015(energy)
return energy, (magic_sens['sensitivity_lima_5off']/crab).decompose()
@vuillaut
vuillaut / slurm_job_dep.py
Last active February 19, 2024 14:59
SLURM job dependencies status checker.
"""
This script get the dependencies of a job and list all of them that are not COMPLETED
"""
import subprocess
import re
import argparse
# Create the argument parser
@vuillaut
vuillaut / lstmcpipe_reduced_logs_status_check.py
Last active February 19, 2024 14:59
Analyse a `logs_reduced_*.yml` file from lstmcpipe by going through all job ids and printing their status if not COMPLETED
"""
Analyse a `logs_reduced_*.yml` file from lstmcpipe by going through all job ids and printing their status if not COMPLETED
"""
import argparse
import yaml
import subprocess
import re
def get_data_from_yaml(file_path):