Skip to content

Commit

Permalink
Merge branch 'master' into 20240909_v0.10.12_nsbgrid
Browse files Browse the repository at this point in the history
  • Loading branch information
vuillaut committed Sep 18, 2024
2 parents 0762e35 + 70c1247 commit 48ef09a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
12 changes: 6 additions & 6 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/MIT",
"codeRepository": "git+https://github.com/cta-observatory/lstmcpipe.git",
"dateCreated": "2019-09-09",
"datePublished": "2024-09-09",
"downloadUrl": "https://github.com/cta-observatory/lstmcpipe/archive/refs/tags/v0.11.0.tar.gz",
"dateCreated": "2019-09-18",
"datePublished": "2024-09-18",
"downloadUrl": "https://github.com/cta-observatory/lstmcpipe/archive/refs/tags/v0.11.1.tar.gz",
"issueTracker": "https://github.com/cta-observatory/lstmcpipe/issues",
"name": "lstmcpipe",
"version": "0.11.0",
"softwareVersion": "0.11.0",
"version": "0.11.1",
"softwareVersion": "0.11.1",
"readme": "https://github.com/cta-observatory/lstmcpipe/blob/master/README.rst",
"description": "Scripts to ease the reduction of MC data on the LST cluster at La Palma. With this package, the analysis/creation of R1/DL0/DL1/DL2/IRFs can be orchestrated.",
"applicationCategory": "CTA, LST",
"releaseNotes": "v0.11.0 introduces a new config to split the gamma diffuse into train and test datasets. For bug fixes, see the **full changelog**: https://github.com/cta-observatory/lstmcpipe/compare/v0.10.5...v0.11.0",
"releaseNotes": "v0.11.1 includes fixes for the NSB-grid prod. For bug fixes, see the **full changelog**: https://github.com/cta-observatory/lstmcpipe/compare/v0.11.0...v0.11.1",
"funding": "824064",
"developmentStatus": "active",
"isPartOf": "https://www.cta-observatory.org/",
Expand Down
17 changes: 11 additions & 6 deletions lstmcpipe/scripts/generate_nsb_levels_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def build_argparser():
parser.add_argument("--nsb",
nargs="+", type=float, default=0,
help="List of nsb tuning values in p.e. If not provided, no NSB tuning is applied.")
parser.add_argument("--prod_id_prefix", "-pid",
type=str, default=None,
help="The PROD ID prefix. Example: '20240918_v0.10.12'")

parser.add_argument(
"--dec_list",
Expand Down Expand Up @@ -83,17 +86,18 @@ def dump_lstchain_nsb_config(nsb_tuning, outdir="."):
logger.info(f"Dumped lstchain configuration file: {json_filename}")


def prod_id(nsb_tuning):
def prod_id(nsb_tuning, prefix=None):
"""
Generate the prod ID based on the given nsb_tuning_ratio.
Parameters:
nsb_tuning_ratio (float): The nsb tuning ratio.
prefix (str): The prefix of the prod ID. Example: "20240918_v0.10.12"
Returns:
str: The product ID.
str: The prod ID.
"""
return f"{date.today()}_allsky_nsb_tuning_{nsb_tuning:.2f}"
prefix_string = f"{prefix}_" if prefix else ""
return f"{prefix_string}allsky_nsb_tuning_{nsb_tuning:.2f}"


def lstmcpipe_config_filename(nsb_tuning, outdir="."):
Expand All @@ -118,7 +122,8 @@ def main():

nsb_tuning_values = args.nsb
config_class = args.config_class

prod_id_prefix = args.prod_id_prefix

for nsb_tuning in nsb_tuning_values:
logger.info(f"Working on NSB {nsb_tuning}")
outdir = Path(f"NSB-{nsb_tuning:.2f}")
Expand All @@ -129,7 +134,7 @@ def main():
"lstmcpipe_generate_config",
config_class,
"--prod_id",
prod_id(nsb_tuning),
prod_id(nsb_tuning, prod_id_prefix),
"-o",
lstmcpipe_config_filename(nsb_tuning, outdir),
"--lstchain_conf",
Expand Down

0 comments on commit 48ef09a

Please sign in to comment.